I have calculated a list of 95% confidence intervals (ci) for 12 bars (means) using facet_grid plots in ggplot2:
ci <- c(0.17360519, 0.08659052, 0.19434605, 0.20922361, 0.06032738, 0.17054205,
0.28033997, 0.18371310, 0.11388905, 0.24240948, 0.04037120, 0.19849716)
I can plot these confidence intervals using this code:
geom_errorbar(aes(ymin=Prob-ci, ymax=Prob+ci),
width=.1, # Width of the error bars
position=position_dodge(.09))
where 'Prob' is the mean on the y-axis.
My question is: How do I plot these confidence intervals after I've bootstrapped them using library(boot)?
For example, after bootstrapping as follows:
mean.boot <- function(x,ind)
{
return(c(mean(x[ind]),var(x[ind])/length(ind)))
}
out <- boot(ci,mean.boot,100000)
when this is the output:
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 100000 bootstrap replicates
CALL :
boot.ci(boot.out = out)
Intervals :
Level Normal Basic Studentized
95% ( 0.1232, 0.2025 ) ( 0.1239, 0.2032 ) ( 0.1099, 0.2062 )
Level Percentile BCa
95% ( 0.1224, 0.2017 ) ( 0.1208, 0.2003 )
Calculations and Intervals on Original Scale
Thanks for your time as always.