[R] Using boot.ci "norm" not working

varin sacha v@r|n@@ch@ @end|ng |rom y@hoo@|r
Thu Dec 16 23:24:27 CET 2021


Dear R-experts,

Here below my R code. Using "bca" in the boot.ci function at the end of my R code works perfectly. Using "perc" and "basic" perfectly works as well. But using "norm", my R code does not work anymore.
Is it possible to solve that problem and to make my R code work ?

################################################
library(boot)

s<- sample(178:798, 10000, replace=TRUE)
mean(s) 

N <- 100
out <- replicate(N, {
a<- sample(s,size=5)
mean(a)

dat<-data.frame(a)
med<-function(d,i) {
temp<-d[i,]
mean(temp)

}

  boot.out <- boot(data = dat, statistic = med, R = 10000)
  boot.ci(boot.out, type = "norm")$norm[, 4:5]
})
mean(out[1,] < mean(s) & mean(s) < out[2,])
################################################



More information about the R-help mailing list