Dear R-Experts,

Thanks to Prof. Bonnett, I have got an R script working to calculate confidence 
intervals around the semipartial correlation coefficients.
Now, I would like to calculate BCa bootstrap CIs using the boot library and the 
boot.ci(results, type="all") function. How could I modify my R script (here 
below reproducible example) to get the BCa bootstrap CIs ?



CIsemipartcorr <- function(alpha, part, mult, n) {
# Computes a confidence interval for a semipartial correlation
# Arguments: 
#   alpha: alpha value for 1-alpha confidence
#   part:  sample semipartial correlation 
#   mult:  sample squared multiple correlation in full model
#   n:  sample size
# Returns:
#   confidence interval
z <- qnorm(1 - alpha/2)
mult0 <- mult - part^2
zr <- log((1 + part)/(1 - part))/2
a <- (mult^2 - 2*mult + mult0 - mult0^2 + 1)/(1 - part^2)^2
se <- sqrt(a/(n - 3))
LL0 <- zr - z*se
UL0 <- zr + z*se
LL <- (exp(2*LL0) - 1)/(exp(2*LL0) + 1)
UL <- (exp(2*UL0) - 1)/(exp(2*UL0) + 1)
CI <- c(LL, UL)
return(CI)
}
CIsemipartcorr(.05, .3638, .7803, 22)

Thanks for your time,

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to