Skip to content

Problems with lme random slope+intercept model

2 messages · anord, Ben Bolker

#
Andreas Nord <andreas.nord at ...> writes:
It doesn't really make any sense to use the *response* variable y
as the random-effects response.  It's the effect of the *predictor*
variable that will vary across individuals, so you should try writing it as

m2.lme<- lme(y~x1+x2+x3+factor,random=~1+x1|id,
             data=data,na.action=na.omit)

It's also better/more coherent to include 'data' as an argument
rather than to use with() in this case.

You can also use random=~x1|id since the intercept is included
implicitly (opinions differ about whether it is better to be compact
or explicit).

  Ben Bolker