# NOT RUN {
data(danish)
require(lme4)
require(lmerTest)
require(optimx)
# ---- mixed-effects regression with three random intercepts
danish.lmer = lmer(LogRT ~ PC1 + PC2 + PrevError + Rank +
ResidSemRating + ResidFamSize + LogWordFreq*LogAffixFreq*Sex +
poly(LogCUP, 2, raw=TRUE) + LogUP + LogCUPtoEnd +
(1|Subject) + (1|Word) + (1|Affix), data = danish,
control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")))
danish.lmerA = lmer(LogRT ~ PC1 + PC2 + PrevError + Rank +
ResidSemRating + ResidFamSize + LogWordFreq*LogAffixFreq*Sex +
poly(LogCUP, 2, raw=TRUE) + LogUP + LogCUPtoEnd +
(1|Subject) + (1|Word) + (1|Affix), data = danish,
control=lmerControl(optimizer="optimx",optCtrl=list(method="nlminb")),
subset=abs(scale(resid(danish.lmer)))<2.5)
summary(danish.lmerA)
# }
Run the code above in your browser using DataLab