Nonparametric bootstrapping linear models

TODO

  • GLM example
  • link to resamplingBoot

Install required packages

boot

Regression parameters: Case resampling


Call:
lm(formula = Y ~ X1 + X2 + X3, data = dfRegr)

Coefficients:
(Intercept)           X1           X2           X3  
    13.9252       0.4762      -0.2827      -0.4057  
(Intercept)          X1          X2          X3 
 9.05357721  0.05008996  0.04104598  0.01122308 
                 2.5 %     97.5 %
(Intercept) -4.0460232 31.8963943
X1           0.3768077  0.5756632
X2          -0.3641438 -0.2011926
X3          -0.4280163 -0.3834611

ORDINARY NONPARAMETRIC BOOTSTRAP


Call:
boot(data = dfRegr, statistic = getRegr, R = nR)


Bootstrap Statistics :
      original        bias    std. error
t1* 13.9251855 -0.4537363444  7.74596234
t2*  0.4762354  0.0026731851  0.04289680
t3* -0.2826682 -0.0002800234  0.04108043
t4* -0.4057387  0.0002494345  0.01197575
     conf                                
[1,] 0.95 26.48 976.31 -1.756034 28.90993
     conf                                 
[1,] 0.95 24.26 974.17 0.3938218 0.5655422
     conf                                
[1,] 0.95 24.04 974 -0.3663432 -0.2021897
     conf                                   
[1,] 0.95 18.29 966.64 -0.4307008 -0.3833435

ANOVA

Model-based resampling

Under the null hypothesis

[1] 0.2748375

ORDINARY NONPARAMETRIC BOOTSTRAP


Call:
boot(data = dfCRp, statistic = getAnova, R = nR)


Bootstrap Statistics :
    original     bias    std. error
t1* 1.304972 -0.3013633   0.8547824
[1] 0.266
plot of chunk rerResamplingBootALM01
plot of chunk rerResamplingBootALM01

Wild boostrap

Under the null hypothesis

[1] 0.251

Detach (automatically) loaded packages (if possible)

Get the article source from GitHub

R markdown - markdown - R code - all posts