1
$\begingroup$

I am teaching myself how to do multi-level models (MLMs) in R. I have two models, which I think should give me the same information (with some omissions in M2), but they are not completely the same. I am hoping you can help explain where the difference is coming from. The data is not important, so here are the models:

M1:

lmer(sound ~ 1 + neg_ttbi*con_bin + (1 | pair_id) + (1 | id) + (1 | round), REML = FALSE, 
                data=df[which(df$win == 1),])

M1 fixed effects:

Fixed effects:
                               Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)                     3.57319    0.39129   58.83567   9.132 7.07e-13 ***
neg_ttbi                        2.38973    0.41013 1522.73067   5.827 6.89e-09 ***
con_binforced_break             0.04115    0.44161   57.23054   0.093 0.926077    
neg_ttbi:con_binforced_break   -1.97734    0.52579 1503.80584  -3.761 0.000176 ***

My M1 interpretation:

  • There is a positive correlation between neg_ttbi and sound
  • There is no significant impact of the forced_break condition on sound
  • There is an interaction between neg_ttbi and forced_break that impacts sound

M2:

lmer(sound ~ 1 + neg_ttbi:con_bin + (1 | pair_id) + (1 | id) + (1 | round), REML = FALSE, 
                data=df[which(df$win == 1),])

M2 fixed effects:

Fixed effects:
                              Estimate Std. Error        df t value Pr(>|t|)    
(Intercept)                     3.6053     0.1865   58.1482  19.333  < 2e-16 ***
neg_ttbi:con_bincontrol         2.3823     0.4025 1536.2505   5.920 3.97e-09 ***
neg_ttbi:con_binforced_break    0.4147     0.3286 1471.6785   1.262    0.207    

My M2 interpretation:

  • There is an interaction between neg_ttbi and control that impacts sound
  • There is not an interaction between neg_ttbi and forced_break that impacts sound

My questions:

  1. Why does M2 give me numbers for each level of con_bin but M1 does not?
  2. Why is neg_ttbi:con_binforced_break different in M1 and M2?
  3. What does M2 tell me that M1 doesn't?
  4. How do I make a model that tells me the impact of neg_ttbi, both levels of con_bin, and the interaction between neg_ttbi and both levels of con_bin (for an intercept + 5 lines of data below it)? (alternatively, why would this not make sense to do?)

I am happy to be referred to articles if these questions reveal a fundamental misunderstanding. I suspect I am doing something incorrect in trying to use a fixed, independent grouping factor.

$\endgroup$
5
  • 1
    $\begingroup$ This is a question that comes up all the time; the reference level of a categorical predictor is absorbed into the intercept (or in the main slope for the interaction). $\endgroup$
    – PBulls
    Commented Apr 25 at 18:32
  • $\begingroup$ @PBulls thanks for the reply. Please forgive my ignorance but I am not sure what to look up from there to get more info... are you able to expand on your reply or give me a link to another question? I have googled around but I must not be using the right language $\endgroup$ Commented Apr 25 at 18:37
  • 1
    $\begingroup$ Your second model contains the interaction but omits the main effects. This violates the principle of marginality (see On the Principle of marginality). So I suggest to focus on understanding M1 instead. $\endgroup$
    – dipetkov
    Commented Apr 25 at 22:04
  • $\begingroup$ This question does come up very often, so I wonder why there isn't a canonical answer... Here is one explanation by @kjetilbhalvorsen What to do in a multinomial logistic regression when all levels of DV are of interest?. Also lookup the {emmeans} package and its vignettes. $\endgroup$
    – dipetkov
    Commented Apr 25 at 22:10
  • 1
    $\begingroup$ @dipetkov, you can always propose an faq canonical post in Meta CV and provide a comprehensive answer yourself and if such post already exists, you can mention it too. $\endgroup$ Commented Apr 26 at 2:51

1 Answer 1

2
$\begingroup$

Your questions and my responses are as follows:

Why does M2 give me numbers for each level of con_bin but M1 does not?

You have coded the main effects and interaction in the first model with *, but only coded the interaction by itself in the second model with :. See my post here about the coding of regressions in R.

Why is neg_ttbi:con_binforced_break different in M1 and M2?

Same issue. You have not included the main effects.

What does M2 tell me that M1 doesn't?

In short, the second model only tells you what the interaction between your two variables should be. Without including the main effects, this can be problematic, as highlighted in the comments.

How do I make a model that tells me the impact of neg_ttbi, both levels of con_bin, and the interaction between neg_ttbi and both levels of con_bin (for an intercept + 5 lines of data below it)? (alternatively, why would this not make sense to do?)

You actually already did this with your first model. When interpreting regressions with categorical predictors, the intercept (without any special coding other than dummy coding by default) will include the intercept as the reference group and the comparison groups as slopes. The underlying linear equation and visualization of such models is touched upon a bit here in this answer.

$\endgroup$
1
  • 1
    $\begingroup$ Amazing, so helpful! thank you! $\endgroup$ Commented Apr 26 at 7:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.