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

前端 未结 1 1876
遥遥无期
遥遥无期 2021-02-18 23:40

I am attempting to use boot.ci from R\'s boot package to calculate bias- and skew-corrected bootstrap confidence intervals from a parametric bootstrap.

1条回答
  •  情深已故
    2021-02-19 00:40

    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
    

    0 讨论(0)
提交回复
热议问题