[R-lang] Interactions in lmer

T. Florian Jaeger tiflo at csli.stanford.edu
Sat Jul 25 15:15:28 PDT 2009


On Fri, Jul 24, 2009 at 1:34 AM, Claire Delle Luche <
Claire.Delleluche at univ-lyon2.fr> wrote:

> Dear R users,
>
> Dealing with mixed models with a binomial DV and interactions between
> predictors, I still have a few questions I cannot find the answer to.
> One of my guideline source for the lmer analysis is the Jaeger and Kuperman
> WOMM slides.
>
> 1- all but one predictor are centered, because the latter is a four level
> predictor and I am interested in contrasts. Is this correct? Thus I cannot
> interpret the intercept as the grand mean. Does the intercept has any
> meaning at all?


The intercept always has the meaning of "everything else is 0" --> when the
sum of all other beta * predictors is 0 (e.g. when all other predictors are
0), then the linear predictor is the intercept. So, if you have a balanced
sample and the all predictors are contrast coded except for one 4 level
predictor, which is treatment coded, then the intercept corresponds to the
mean of the reference condition of the 4-level predictor.

2- reporting interactions: as a whole and not just specific contrasts
> For linear models, there is aovlmer.fnc. Is there such a function for mixed
> models?


aovlmer.fnc is for lmer (=mixed) linear models. Do you mean mixed logit
models? You can always do the same thing yourself by comparing the deviance
of *nested* models against a chi-square distribution with df1-df2 degrees of
freedom (the difference in number of parameters in the two models).

>
>
> 3- residualisation
> In the best model (var1 is centered, var2 is not as it is a factor),
> var1(2levels) and var2(4levels) have significant interaction and are
> correlated (-.491, -.527, -.350 for respective contrasts).
> Residualisation is a possibility.
> I was advised to use the following code line, but I get an error I cannot
> fix:
>
> corpus$residinteraction = residuals(lm(I(var1*var2) ~ var1 + var2, data=
> corpus))
>
> The error diagnostic is about having more than two levels for contrast
> analysis.


in order to make var1*var2 a continuous outcome (expected by lm()) you need
to manually recode the factors in to k-1 numerical predictors where k is the
number of levels in the predictor. I suspect that your error message is
linked to this problem.

HTH,
Florian



>
>
>
> Thank you very much in advance.
>
> Claire Delle Luche
> Laboratoire Dynamique du Langage
> 14, avenue Berthelot
> 69007 Lyon FRANCE
>
> _______________________________________________
> R-lang mailing list
> R-lang at ling.ucsd.edu
> http://pidgin.ucsd.edu/mailman/listinfo/r-lang
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.ucsd.edu/pipermail/r-lang/attachments/20090725/5c678ad2/attachment.htm>


More information about the R-lang mailing list