[R-lang] Simple effects in mixed logit models
Roger van-Gompel
r.p.g.vangompel at dundee.ac.uk
Wed Dec 16 04:27:06 PST 2009
Hi there,
I have a 2 (language: Swe vs. Eng) x 2 (prime: pp vs. do) design and
was wondering how I do simple effects in mixed logit models. I could
delete one level of a variable and then analyse the other level of a
variable (e.g., Swe pp vs. Swe do), but I suspect that that’s not the
appropriate way of doing it.
I have attached my analyses and output. Note that my variables are
effect coded. I don’t have an interaction and so strictly speaking, I
shouldn’t analyse simple effects, but reviewers have asked us to.
Thanks a lot for any help!
Roger van Gompel
> library(lme4)
> L2prim = read.table("forLME.txt", header=TRUE)
> L2prim$langcent <- scale(as.numeric(L2prim$language))
> L2prim$primecent <- scale(as.numeric(L2prim$prime))
> L2prim$PID=as.factor(L2prim$PID)
> L2prim$ITEM=as.factor(L2prim$ITEM)
> head(L2prim)
LIST PID ITEM language prime score langcent primecent
1 1 2 4 swe do 1 1.008740 -0.9742244
2 1 2 7 swe do 0 1.008740 -0.9742244
3 1 2 8 swe pp 0 1.008740 1.0248334
4 1 2 20 swe pp 0 1.008740 1.0248334
5 1 2 22 eng pp 0 -0.989767 1.0248334
6 1 2 23 swe pp 0 1.008740 1.0248334
> primanal=lmer(score ~langcent*primecent + (1|PID) + (1|ITEM),
data=L2prim, family = "binomial")
> summary(primanal)
Generalized linear mixed model fit using PQL
Formula: score ~ langcent * primecent + (1 | PID) + (1 | ITEM)
Data: L2prim
Family: binomial(logit link)
AIC BIC logLik deviance
559.0337 590.1759 -272.5168 545.0337
Random effects:
Groups Name Variance Std.Dev.
ITEM (Intercept) 2.2551 1.5017
PID (Intercept) 2.5343 1.5919
# of obs: 632, groups: ITEM, 40; PID, 32
Estimated scale (compare to 1) 0.880811
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.946211 0.393646 -2.40371 0.016230 *
langcent 0.012060 0.108898 0.11075 0.911818
primecent 0.337744 0.110732 3.05010 0.002288 **
langcent:primecent -0.099484 0.109631 -0.90744 0.364172
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) lngcnt prmcnt
langcent -0.001
primecent -0.025 -0.033
lngcnt:prmc 0.007 -0.048 -0.005
The University of Dundee is a registered Scottish charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.ucsd.edu/pipermail/r-lang/attachments/20091216/baea0328/attachment.htm>
More information about the R-lang
mailing list