Add uncertainty to CI bands
dif <- flexBoot$z11[1:500] - flexBoot$z00[1:500]
summary(dif)
sortDif <- sort(dif)
trueCI <- quantile(sortDif, probs=c(0.05,0.95), type = 6)
trueWidth <- trueCI[2] - trueCI[1]
nReps <- 500
bootWidth <- rep(NA,nReps)
for (iRep in 1:nReps){
difB <- sample(dif,500,replace = TRUE)
difB <- sort(difB)
CI <- quantile(difB, probs=c(0.05, 0.95), type = 6)
bootWidth[iRep] <- CI[2] - CI[1]
}
print(sd(bootWidth))
summary(bootWidth)
cat("\n", trueWidth)
pct <- 100 *sd(bootWidth) / trueWidth
cat("\nCV of widths in percent", pct)