Skip to content
Prev 5703 / 20628 Next

coding for an interaction

If time is being modelled as a continuous variable, i.e. you are
looking at a continuous change in x over time, then

mod2=lmer(x~time+(1|site),  data=mydata)
mod3=lmer(x~time+(time|site),  data=mydata)

is probably what you want.

And you can test whether time interacts with site (the slope for time
differs between sites) by a likelihood ratio test

anova(mod2, mod3)



andydolman at gmail.com
On 27 March 2011 07:10, Saang-Yoon Hyun <shyunuw at gmail.com> wrote: