Stack Exchange
Bootstrap Correlation in R. How to get bootstrapped r coefficient, p.value, Confidence Interval
I am trying to do a bootstrapped correlation in R.
Following what I saw in these two posts: How can I get confidence intervals for a one-tailed, bootstrapped Pearson correlation in R? and Bootstrapped p-value for a correlation coefficient on R I tried the following:
x = data$myData1
y = data$myData2
dat <- data.frame(x, y)
set.seed(1)
bootCorTest3 <- function(data, i){
  d <- data[i, ]
  results  <- cor.test(d$x, d$y)
  c(est = results$estimate, stat = results$statistic, param = results$parameter, p.value = results$p.value, CI = results$conf.int)
}

b3 <- boot(dat, bootCorTest3, R = 2000)
b3

OUTPUT:
Bootstrap Statistics :
       original       bias    std. error
t1*  0.29836749 -0.012284427   0.1492960
t2*  2.16580050 -0.013933040   1.2160051
t3* 48.00000000  0.000000000   0.0000000
t4*  0.03532486  0.107464681   0.2207419
t5*  0.02183300 -0.006166465   0.1612371
t6*  0.53249181 -0.014324511   0.1206106

# Original (non-bootstrap) statistics with label
b3$t0

    est.cor      stat.t    param.df     p.value         CI1         CI2 
 0.29836749  2.16580050 48.00000000  0.03532486  0.02183300  0.53249181 

colMeans(b2$t)

2.1395137 0.1298312 0.2854631

boot.ci(b, type = c("norm", "basic", "perc", "bca"))

Intervals : 
Level      Normal              Basic         
95%   (-0.5130,  0.3679 )   (-0.7692,  0.0706 )  

Level     Percentile            BCa          
95%   ( 0.0000,  0.8399 )   ( 0.0000,  0.8581 )  
Calculations and Intervals on Original Scale

So, I see that I can get the non bootstrapped statistics, which are quite clear to me, by running: b3$t0. But I don't understand how do I get the bootstrapped p.value and r coefficient. Also, the output if I type b3 (bootstrap statistics) is not clear to me. Can anyone help me understand?
Thank you for your time.

This question does not appear to be about programming within the scope defined in the help center.

Sorry about that, should I move it?
