Skip to content
Prev 298974 / 398506 Next

Help with lmer formula

Hi Camila,

In mixed equation form instead of multilevel, it would be:

Y_it = gamma_00 + gamma_10*X_it + gamma_11*W_it*X + (e_it + u_0t + u_1j*X)

your code seems reasonable.  Note that the random intercept and slope
will be correlated in your specification (unstructured if you want, it
is possible to force out, but is sensible starting place)

model <- lmer(Y ~ X + X:W + (X | ID), data = data)

which gives:
residual variance: e_it
variance of intercept (constant term, gamma_00): u_0t
variance of slope (gamma_10): u_1j*X

as well as overall estimates for the intercept, slope of X, and the
interaction of X and W.

Bert is correct that R sig mixed models is the more appropriate list,
but many people read both and there is no reason it cannot be answered
here.

Cheers,

Josh
On Mon, Jul 2, 2012 at 6:47 PM, Camila Mendes <cacamendes85 at gmail.com> wrote: