2
$\begingroup$

I found that the default confidence intervals provided by cor.test (Fisher's Z transform according to the help) are quite different from the nonparametric boostrap confidence intervals for the below data. Is it normal this large discrepancy? I am doing something wrong?

dat<-data.frame(x=1:5,y=c(2.4,2.6,3.5,7,8.1))
cor.test(dat$x,dat$y)$conf.int
bootCor<-boot(dat,function(d,i) return(cor(d[i,1],d[i,2])),R=1000)
quantile(bootCor$t,c(.025,.975),na.rm=T)
$\endgroup$
1
  • 6
    $\begingroup$ Your sample is so small that the probability to have only two unique value pairs in the bootstrap resamples (resulting in $r_i=1$) is pretty high. Sometimes there is even only one unique value pair (indicated by the warnings that the standard deviation is zero). I wouldn't recommend bootstrapping pearson r with a sample size of only 5. $\endgroup$
    – Roland
    Dec 17, 2013 at 8:21

1 Answer 1

2
$\begingroup$

You have a sample size of 5! Bootstrap is really a large-sample technique, and should not be expected to work well with $n=5$. From the comments:

Your sample is so small that the probability to have only two unique value pairs in the bootstrap resamples (resulting in $r_i=1$) is pretty high. Sometimes there is even only one unique value pair (indicated by the warnings that the standard deviation is zero). I wouldn't recommend bootstrapping pearson r with a sample size of only 5. – Roland

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.