Dear R-experts, Here below my R code for the percentile bootstrap confidence intervals with an error message. Is there a way to make my R code work ? Many thanks for your help and time.
############################################ library(boot) s=rnorm(100000,0,1) (m<-median(s)) N <- 100 n<-5 out <- replicate(N, { dat<-data.frame(sample(s,size=n)) med<-function(d,i) { median(d[i, ]) } boot.out <- boot(data = dat, statistic = med, R = 10000) boot.ci(boot.out, type = "per")$per[, 4:5] }) mean(out[1, ] < m & m < out[2, ]) ############################################ ______________________________________________ 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.