0
$\begingroup$

I'm looking at a glmer for my masters thesis research (I cannot share the data until after thesis is completed so I will try to be very explicit in the descriptions).

But to summarize, my dependent variable is a binary (exhaustbinary), where 1, the participant did the thing, and 0 the participant did not. My independent factors are Age group, (child or adult), and trial type (control or critical), with two random intercepts of individual participant(SubjectID), and individual trial(Item). See code:

agebytrialopt <- glmer (ExhaustBinary ~ Agegroup * TrialType + 
            (1|SubjectID) + (1|Item), data=df, family="binomial", 
             control=glmerControl(optimizer="bobyqa", 
                                     optCtrl=list(maxfun=100000)))

That's all working marvelously. However on the summary and output I get something counterintuitive.

Fixed effects:
                                Estimate Std. Error z value Pr(>|z|)    
(Intercept)                        8.701      1.380   6.306 2.86e-10 ***
AgegroupChild                     -3.805      1.213  -3.137   0.0017 ** 
TrialTypeCritical                 -7.049      1.148  -6.140 8.23e-10 ***
AgegroupChild:TrialTypeCritical    6.493      1.201   5.409 6.35e-08 ***

Basically as we switch from the child to adult level children are more likely to have a 1 value in exhaust binary compared to the adult. But, based on the name that the glmer chose, this should mean that children have a lower "score" compared to the adults. Which isn't accurate to the data, they have a higher score compared to adults.

Compared to the TrialTypeCritical, critical trials have more 0 values in exhaust binary compared to controls. So based on the name, critical trials should have lower "scores" compared to the controls. This is intuitively true/accurate, and the negative estimate makes sense here.

I did check the dummy code for the contrast in the factors, and the base factors look as follows.

> contrasts(df$Agegroup)
      Child
Adult     0
Child     1

> contrasts(df$TrialType)
         Critical
Control         0
Critical        1

To be fair I've been looking at this for the past 5 hours, and before I start manually setting the contrasts, I want to make sure that I'm interpreting these estimates correctly.

Additionally, since we do have that significant interaction, I have done that breakdown and looked at the emmeans already and all that, everything there makes sense and is interpretable and I don't have any issues with any negative/positive flipping there.

Any insight into where I'm going wrong (in either my understanding of the factors/levels and log estimates or how the contrasts work or just in general) would be helpful.

To make it clear though, the glmer is the best choice for the data we have, and I've done all the theoretical justification to use this approach, so I don't really want to have to field questions about why I chose to use a glmer or the like. I just need help with understanding what is going on with the polarity on AgegroupChild.

$\endgroup$
4
  • 7
    $\begingroup$ This is a FAQ. The issue is that these estimates do not describe the bivariate relationship in the data. They tell us about the mutual relationships, after controlling for the other variables. For (much) more about this issue please search our site. Good keywords include "control for," "Simpson's paradox," "mediation," "interaction," and even "added variable plot." $\endgroup$
    – whuber
    Commented Oct 3 at 23:18
  • 5
    $\begingroup$ If you use options(contrasts = c("contr.sum", "contr.poly")) (and re-run the model) you will get main effects based on the average across levels of the other factor, which may be easier to interpret. More radically, you could rely on the emmeans and marginaleffects packages to interpret your models and stop worrying about the coefficients entirely ... see x.com/stephenjwild/status/1838315652165378325 $\endgroup$
    – Ben Bolker
    Commented Oct 4 at 0:39
  • 1
    $\begingroup$ @whuber gave you some good search terms. Very briefly, though, where you are going wrong is that you are interpreting main effects when there is an interaction. $\endgroup$
    – Peter Flom
    Commented Oct 4 at 10:47
  • 1
    $\begingroup$ Check whether your model is overfit. The coefficients from logistic regression are in log-odds units. The intercept of 8.7 thus means about 6000/1 odds of the binary outcome at the reference conditions (Adult and Control), while the TrialTypeCritical coefficient of -7.049 means an odds ratio of about 1/1000 for Critical versus Control for Adult. They might be correct, but one worries with such large magnitudes. $\endgroup$
    – EdM
    Commented Oct 4 at 14:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.