Parametric, semiparametric and nonparametric bootstrapping for mixed models Following grafts are taken from this article . I'm newbie to bootstrap and trying to implement the parametric, semiparametric and nonparametric bootstrapping bootstrapping for linear mixed model with R boot package.





R Code
Here is my R code:
library(SASmixed)
library(lme4)
library(boot)

fm1Cult <- lmer(drywt ~ Inoc + Cult + (1|Block) + (1|Cult), data=Cultivation)
fixef(fm1Cult)


boot.fn <- function(data, indices){
 data <- data[indices, ]
 mod <- lmer(drywt ~ Inoc + Cult + (1|Block) + (1|Cult), data=data)
 fixef(mod)
 }

set.seed(12345)
Out <- boot(data=Cultivation, statistic=boot.fn, R=99)
Out

Questions


*

*How to do parametric, semiparametric and nonparametric bootstrapping for mixed models with boot package?

*I guess I'm doing nonparametric bootstrapping for mixed model in my code.


I found these slides but could not get the R package merBoot. Any idea where I can get this package. Any help will be highly appreciated. Thanks in advance for your help and time.
 A: You might want to have a look at the bootMer function in the development version of lme4,
install_github("lme4",user="lme4")
library(lme4)

that can do model-based (semi-)parametric bootstrapping of mixed models...
Just check ?bootMer
A: Bootstrapping in mixed linear models is very much like bootstrapping in regression except that you have the complication that the effects are divided into fixed and random.  In regression to do the parametric bootstrap, you fit the parametric model to the data, compute the model residuals, bootstrap the residuals, take the bootstrap residuals and add them to the fitted model to get a bootstrap sample for the data and then fit the model to the bootstrap data to get bootstrap sample parameter estimates.  You repeat the procedure by bootstrapping the original residuals again and then repeating the other steps in the procedure to get another bootstrap sample estimate of the parameters.
For the nonparametric bootstrap, you create the vector of the response and covariate values and bootstrap the selection of vectors for the bootstrap sample.  From the bootstrap sample, you fit the model to get the parameters and you repeat the process.  The only difference between the parametric and nonparametric bootstrap is that you bootstrap the residuals for the parametric bootstrap while the nonparametric bootstrap bootstraps the vectors.  In the mixed model case you also can have a semiparametric bootstrap by treating some effects parametrically and the others nonparametrically.  If your code is bootstrapping vectors you are doing the nonparametric bootstrap.  I don't have a specific solution to provide for doing this in R but if you look at Efron and Tibshirani's book or my book with Robert LaBudde you will see R code for similar types of models to the linear mixed model.  The nonparametric bootstrap has been shown to be more robust than the parametric bootstrap when the model is misspecified.
