I would like to bootstrap my data to get a confidence intervals around a mean for a vector different lengths. For example with the code below I calculate y
based on my vector x
and then apply bootstrap to get CI.
set.seed(001)
x <- rnorm(length(iris$Sepal.Length),iris$Sepal.Length,0.05*iris$Sepal.Length)
mydata<-data.frame(x=x,y=pi*x^2)
library(boot)
myboot<-boot(mydata$y, function(u,i) mean(u[i]), R = 999)
boot.ci(myboot, type = c("perc"))
My question is how can I compute the bootstrapped mean CI for different size of x
like for 3-4, 4-5, 5-6, 6-7, 7-8?