我使用ggplot2中的facet_grid图计算了12个柱(均值)的95%置信区间(ci)列表:

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)

我可以使用以下代码绘制这些置信区间:

geom_errorbar(aes(ymin=Prob-ci, ymax=Prob+ci),
            width=.1, # Width of the error bars
            position=position_dodge(.09))

其中'Prob'是y轴上的平均值 .

我的问题是:在使用库(引导)引导它们之后,如何绘制这些置信区间?

例如,引导后如下:

mean.boot <- function(x,ind)
{
return(c(mean(x[ind]),var(x[ind])/length(ind)))
}
out <- boot(ci,mean.boot,100000)

当这是输出:

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

一如既往地感谢您的时间 .