2

I am trying to run a GLMM - binomial logit.

I have four independent variables ($x_1$, $x_2$, $x_3$, $x_4$) and a dependent variable ($y$) - all factors (where $'0'=$no, $'1'=$yes).

m <- glmer(y ~ x1:x2:x3:x4 + (1 | participant), data = mydata, family = binomial)

How can I check for the model's assumptions? How can I account for repeated measures in this case? Your help is much appreciated!

develarist
  • 3,009
  • 8
  • 31
Sharon
  • 71
  • 4

1 Answers1

4

The model:

m <- glmer(y ~ x1:x2:x3:x4 + (1 | participant), data = mydata, family = binomial)

does not make sense. You are fitting a 4-way interaction, without any of the lower level interactions, or main effects. I can't think of any scenario where this would provide useful insight. You almost always need to fit the lower level interactions and main effects too, if indeed you really do want a 4-way interaction. Generally, anything above a 3-way interaction is quite challenging to interpret.

You are accounting for repeated measures within participants by including random effects (intercepts) for them - that's one of the main reasons for using a mixed effects model.

As for assumptions, since all your variables are binary, there isn't much to check. I would be more concerned about model fit.


Edit: Regarding fitting a model with only an interaction term

An interaction between two variables occurs when the effect of one of the variables differs between levels of another. For a 3-way interaction, this means that the two-way interaction differs at different levels of the 3rd variable.

The interaction inherently involves a consideration of the lower level variables and interactions, even when the lower level variables/interactions are not of interest.

For example, if we had sex (male and female) and handedness (left of right handed). We might find that there is no main effect for either variable but a big interaction between them. Let's see what happens when we fit a model with both main effects plus the interaction, which is the standard way of doing things, compared to a model with only the interaction:

First let's simulate some data:

set.seed(15)
dt <- expand.grid(sex = c("male", "female"), hand = c("left","right"), reps = 1:10)

X <- model.matrix(~ sex*hand, data = dt)
dt$Y <- X %*% c(0, 0, 0, 5) + rnorm(nrow(dt))

So we simulated data with no intercept, no main effects but an interaction of 5. When we fit the standard model we obtain:

> lm(Y ~ sex*hand, dt) %>% summary()

Coefficients:
                    Estimate Std. Error t value Pr(>|t|)    
(Intercept)           0.4680     0.2699   1.734   0.0915 .  
sexfemale            -0.1854     0.3817  -0.486   0.6301    
handright            -0.3654     0.3817  -0.957   0.3448    
sexfemale:handright   4.9966     0.5398   9.256  4.7e-11 ***

which is exactly as we would expect. However, when we fit the interaction-only model:

Coefficients: (1 not defined because of singularities)
                  Estimate Std. Error    t value Pr(>|t|)   
(Intercept)           4.9137     0.2699   18.20  < 2e-16 ***
sexmale:handleft     -4.4457     0.3817  -11.65 9.10e-14 ***
sexfemale:handleft   -4.6311     0.3817  -12.13 2.80e-14 ***
sexmale:handright    -4.8112     0.3817  -12.60 9.14e-15 ***
sexfemale:handright       NA         NA      NA       NA    

...this is much harder to make sense of, as well as having a rank-deficient model matrix.

Take a look at some of these questions and answers:
Logistic Regression Models Without Main Effects?
Including the interaction but not the main effects in a model
Do all interactions terms need their individual terms in regression model?

Robert Long
  • 53,316
  • 10
  • 84
  • 148
  • Thank you! Is it necessary to examine lower level interactions and main effects, even if my hypotheses are not dealing with them? – Sharon Aug 30 '20 at 18:27
  • Usually yes, but what is your hypothesis ? – Robert Long Aug 30 '20 at 18:57
  • Currently, an interaction between age (0/1), sex (0/1), experience (0/1) and target size (0/1) on response (where each of the main effects are really not that important from a theoretical point of view). Thanks again :) – Sharon Aug 31 '20 at 06:42
  • 1
    I think you may be misunderstanding what interactions are and how they work. It doesn't matter that you are not interested in the main effects and that your research question concerns the interaction. An interaction occurs when the effect of one variable differs depending on the level of another. The lower level interactions and main effects are inherrently part of the model, but you obscure them by only fitting an the interaction. Moreover, a model with only the interaction will most likely be not identified because the design matrix will be singular. I will edit my answer to show this. – Robert Long Aug 31 '20 at 08:00
  • 4
    (+1) Great answer! – Stefan Aug 31 '20 at 13:07
  • Thank you very much for your detailed answer @Robert Long. Using elimination processes, however, sometimes result in a final model with only the interaction. – Sharon Aug 31 '20 at 16:28
  • 3
    Elimination how ?? Please tell me that you are not removing main effects and lower order interactions because they are not "statistically siginicant" ? ? ? ? ? Any stepwise procedure like that is very, very bad. – Robert Long Aug 31 '20 at 17:26
  • Thank you @Robert Long. How do you handle multicollinearity? – Sharon Sep 01 '20 at 05:46
  • 3
    Multicollinearity ? In other words, perfect correlation (+ or - 1 ) . Remove one of the variables that is collinear. – Robert Long Sep 01 '20 at 06:47
  • Thank you. That is what i meant by referring to an elimination process. – Sharon Sep 01 '20 at 07:32
  • 2
    @Sharon please be very careful. What do you mean **exactly** by an *"elimination process"* ? – Robert Long Sep 01 '20 at 08:01
  • As you've suggested - to "remove one of the variables that is collinear". – Sharon Sep 01 '20 at 08:21
  • OK, but two variables that are perfectly collinear should not be in the same model in the first place. The design matrix would be singular. – Robert Long Sep 01 '20 at 08:25
  • Thank you. You are right of course. They are not "perfectly" collinear (but VIF measures indicate high multicollinearity). – Sharon Sep 01 '20 at 09:23
  • @Sharon does this answer your question ? If so, please consider marking it as the accepted answer. If not then please let us know why – Robert Long Sep 26 '20 at 18:23