[R-sig-ME] problem bootstraping a mixed-model (lme)

David Villegas Ríos chirleu at gmail.com
Wed Apr 1 14:30:31 CEST 2015


Dear all,
I'm trying to boostrap repeatability estimated from a lme output.
The model includes one fixed factor (month), one random factor (ID) and one
correlation term to account for temporal autocorrelation of the replicates.
I prefer parametric bootstraping since it is the recommended option
according to Nakagawa and Schielzeth, 2010 (Biological reviews)

These have been my attepmts so far:

*Option 1: parametric bootstraping of the full model (what I really need)*

bootcoef<-function(data, index){
  dat<-data[index,]

mod<-lme(dvm~factor(month),random=~1|ID,data=dat,correlation=corAR1(form=~month))

return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
# this is the repeatability estimate
}
output=boot(depm3,bootcoef,100,sim=parametric)

*Error*: output$t yields 100 identical values.

*Option 2: non-parametric bootstraping of the full model*

bootcoef<-function(data, index){
  dat<-data[index,]

mod<-lme(dvm~factor(month),random=~1|ID,data=dat,correlation=corAR1(form=~month))

return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
# this is the repeatability estimate
}
output=boot(depm3,bootcoef,100)

*Error*: Error in Initialize.corAR1(X[[2L]], ...) : covariate must have
unique values within groups for "corAR1" objects

*Option 3: parametric bootstraping of the model without the autocorrelation
term*

bootcoef<-function(data, index){
  dat<-data[index,]
  mod<-lme(dvm~factor(month),random=~1|ID,data=dat)

return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
# this is the repeatability estimate
}
output=boot(depm3,bootcoef,100,sim=parametric)

*Erro*r: output$t yields 100 identical values which in addition I don't
like because the autocorrelation term is not int he model

*Option 4: non-parametric bootstraping of the model without the
autocorrelation term*

bootcoef<-function(data, index){
  dat<-data[index,]
  mod<-lme(dvm~factor(month),random=~1|ID,data=dat)

return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
# this is the repeatability estimate
}
output=boot(depm3,bootcoef,100)

*Result*: I got 100 different values (this is ok), but I really need the
autocorrelation term to be in.

Is this something that you can comment about without reproducible data? Any
suggestion would be greatly appreciated.

David

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list