Hi dear R-experts,
I want to compare the bootstrap percentile interval, the Z interval, the T 
interval, etc.So I use a function (I have modified a few things) I have found 
on stats.stackexchange.
simfun <- function(n=20) {x <- rnorm(n)m.x <- mean(x)s.x <- sd(x)z <- 
m.x/(1/sqrt(n))t <- m.x/(s.x/sqrt(n))b <- replicate(1000, mean(sample(x, 
replace=TRUE)))c( t=abs(t) > qt(0.975,n-1), z=abs(z) > qnorm(0.975),z2 = abs(t) 
> qnorm(0.975), b= (0 < quantile(b, 0.025)) | (0 > quantile(b, 0.975))) } out 
<- replicate(1000, simfun())rowMeans(out)
     t          z        z2     b.2.5%  0.045  0.052  0.061  0.070 
I still have the bootstrap percentile interval. Now, starting from this 
function here above, I would like to calculate all the other intervals 
(t-studentized, BCa, etc.) using the boot package and the boot.ci function 
(type="all"). How can I do ?
Thanks for your help.
Best,
SV

        [[alternative HTML version deleted]]

______________________________________________
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