Skip to content
Prev 13204 / 20628 Next

problem bootstraping a mixed-model (lme)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 15-04-07 06:50 PM, Ken Beath wrote:
But the OP said that simulate() doesn't allow models with a
correlation structure (which doesn't really surprise me).
There's another problem, which is that simulate() for lme models does
*not*
work the same way that it does for most model type (the nlme package
is old enough that it had a simulate() method quite a while before
it was introduced as a more general method); it returns the
log-likelihoods
of null and full models rather than new (parametric-bootstrapped)
response vectors.

This might be hackable (especially to get simulate.lme() to return
vectors rather than log-likelihoods), but the internals of nlme are
not particularly simple & friendly ...

  cheers
    Ben Bolker

Reproducible example:

library("nlme")
fm1Dial <-
    lme(rate ~(pressure + I(pressure^2) + I(pressure^3) +
I(pressure^4))*QB,
        random= ~1|Subject, data= Dialyzer)
simulate(fm1Dial)
fm3Dial <- update(fm1Dial,
                 corr = corAR1(0.771, form = ~ 1 | Subject))
simulate(fm3Dial)
## Error in simulate.lme(fm3Dial) :
##   models with "corStruct" and/or "varFunc" objects not allowed
return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
return(as.numeric(VarCorr(mod))[1]/(as.numeric(VarCorr(mod))[1]+as.numeric(VarCorr(mod))[2]))
# this is the repeatability estimate
# this is the repeatability estimate
CRICOS Provider No 00002J
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJVJHdkAAoJEOCV5YRblxUHc7UIAMnTzI3edqGmcdKKOJsWqhB+
DlhDK3N+FnEtyncLJZqSfG473IJqp6UpujUDsbKFCnGdiUNHK8mmuCuDFvkFJCX/
XSquyTPZwjCYSmECmvsXep7C18PS/BNj+HuUQSqM7AT82T4Rr2tSJbw7nhhAyncI
xlQpmjCEQSAbmn67aGenhY1ac7B4faieJ8TCkkZ+j4zYEbtP5Ov7ofexGZ1acQYg
9F0H1E6JlVqDyy2iJXcM8AHbB5wU7xLg+fHATPNUE18fp+VTc8PvSBPBvbLIP0QS
EVDbmnzRyLe6zyjMiIgQx7XhayMyLKDCjHBMNfCpzQuWTxliIJTVPuiFLkDQTHo=
=Up8Y
-----END PGP SIGNATURE-----