Maybe there's already a function to do it, but (based on my possibly flawed
understanding) it should be pretty easy, and something like:
x <- runif(15,1,10) # make play data
# NOTE: it's non-linear (to make things interesting)
y <- runif(15,0.5,1)*x^4
plot(x,y)
# now beginning the jacknife...
# basically just loop through and drop one
# data point at a time
jack.cor <- numeric(length(x)) # make an empty vector
for(i in 1:length(x)) {
jack.cor[i] <- cor(x[-i],y[-i],method="s")
}
# some different ways you could look at it:
plot(density(jack.cor)) # pdf of test statistic
plot(x,jack.cor) # which x values are "outliers"
plot(y,jack.cor) # which y values are "outliers"
###############
The above plots don't really tell you much in the case of 15 points,
hopefully you have more data to work with. Also, if you play around with
'method' in the function cor, you can get some interestingly different
results, wikipedia has a nice description of why...but maybe you already
know...
Hope that helps--
Andy
On Tue, Jun 1, 2010 at 6:41 AM, Carmen Burghelea
<[email protected]>wrote:
>
> Hi there,
>
> I would very much appreciate if somebody can help me with a syntax example
> of
> jackknife to obtain estimates of correlation coefficients in R.
>
> Many thanks in advance.
>
> Carmen
>
>
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-ecology mailing list
> [email protected]
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>
[[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology