TransWikia.com

Changing the reference level for contrasts on glmer (lme4) changes the output in anova

Cross Validated Asked by Evy on December 13, 2021

I am fitting my data (around 10.000 datapoints) using the following generalised linear mixed model from the lme4 package:

model1<-glmer(reactionTimes ~ congruency * condition + frequencyItem + lengthItem + (1|subject) + (1|item), data = datadf, family=Gamma(link="identity"), control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e5)))

This is a full within participants design. My goal is to find out whether my reaction times are influenced by congruency (factor, congruent vs incongruent) and condition (factor, cond1, cond2, cond3). When I run the model by setting the reference level as “cond1” I have the following output in the Anova:

car::Anova(model1)

Analysis of Deviance Table (Type II Wald chisquare tests)

Response: reactionTimes
                         Chisq Df Pr(>Chisq)    
congruency           115.6393  1  < 2.2e-16 ***
condition              3.3445  2     0.1878    
frequencyItem        663.8526  1  < 2.2e-16 ***
lengthItem            97.4373  1  < 2.2e-16 ***
congruency:condition  32.9506  2  6.996e-08 ***

I then re-run the same model, but this time releveling the contrasts to “cond2”.
The output of car::Anova of this model is the following:

Analysis of Deviance Table (Type II Wald chisquare tests)

Response: reactionTimes
                         Chisq Df Pr(>Chisq)    
congruency            107.6610  1  < 2.2e-16 ***
condition               1.4125  2  0.4934930    
frequencyItem         398.3679  1  < 2.2e-16 ***
lengthItem             54.1887  1  1.821e-13 ***
congruency:condition   16.7656  2  0.0002288 ***

Someone can explain why the Anova results change?
Thanks a lot

my R version: R-4.0.0
lme4 version: lme4_1.1-23

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP