adjusted bootstrap confidence intervals (BCa) with parametric bootstrap in boot package

自作多情 提交于 2019-12-03 23:10:53

After looking at the boot.ci page I decided to use a boot-object constructed along the lines of an example in Ch 6 of Davison and Hinkley and see whether it generated the errors you observed. I do get a warning but no errors.:

require(boot) 
lmcoef <- function(data, i){
      d <- data[i, ]
      d.reg <- lm(y~x, d)
      c(coef(d.reg)) }
lmboot <- boot(d, lmcoef, R=999)
m1
boot.ci(lmboot, index=2)   # I am presuming that the interest is in the x-coefficient
#----------------------------------
BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS
Based on 999 bootstrap replicates

CALL : 
boot.ci(boot.out = lmboot, index = 2)

Intervals : 
Level      Normal              Basic         
95%   (-0.0210,  0.0261 )   (-0.0236,  0.0245 )  

Level     Percentile            BCa          
95%   (-0.0171,  0.0309 )   (-0.0189,  0.0278 )  
Calculations and Intervals on Original Scale
Warning message:
In boot.ci(lmboot, index = 2) :
  bootstrap variances needed for studentized intervals
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!