0

Does anyone know how to bootstrap a linear mixed-effect model constructed by lme function (nlme package)?

Half year ago I was able to do that by "bootstrap" function from "lmeresampler" package, but it doesn't currently run with the same data and code. What happened to these packages?

mod<-lme(PC1~SA+Y+CMIave+MATave,
        random=~1|PLOT_ID,data)

mixed.bootmod<-lmeresampler::bootstrap(mod,function(.)fixef(.),type="parametric",B=1000)

#This doesn't run, showing an error that 

> "some bootstrap runs failed", producing NAs

#However, lmer works

mod1<-lmer(PC1~SA+Y+CMIave+MATave+(1|PLOT_ID),data)

mixed.bootmod<-bootMer(mod,function(.)fixef(.),nsim=1000)
mixed.bootmod<-lmeresampler::bootstrap(mod,function(.)fixef(.),type="parametric",B=1000)
StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Mmm
  • 11
  • 1

1 Answers1

2

I believe the lmeresampler package was pulled recently with command calls edited because I came across two different styles for examples online and only one worked. When I ran bootstrap() for my mixed model it worked using the following command style:

mod<-lme(biomass~Community*Nutrient+Salinity, random=~1|Block,data)
mod_boot<-lmeresampler::bootstrap(mod, fn=fixef, type="parametric",B=10000)