I'm doing a mediation analysis using the mediation package in R.

These are the mediator and outcome model that I have specified:

model.m1 <- lm(AttentionForWords ~ NewCondition, data = mediate1)

model.y1 <- glmer(cbind(PhonemesCorrectRelative,PhonemesIncorrectRelative) ~
  1 + NewCondition + AttentionForWords + TestingMoment + NewCondition:TestingMoment + 
  (1|Participant), data = data, family = 'binomial')

The causal mediation analysis itself is this:

mediate(model.m1, model.y1, treat = "NewCondition", mediator = "AttentionForWords", 
  control.value = "SilentWithoutNoticing", treat.value = "Noticing", 
  boot = FALSE, sims = 1000)

Thus, my independent variable is NewCondition, my mediator is AttentionForWords, and my outcome is a vector of correct and incorrect phonemes.

As you can see, in the outcome model (model.y1) I have also specified two other predictors: TestingMoment, and NewCondition:TestingMoment. I included these predictors because they make the model fit to the data better.

My question is whether this is allowed. In other words: is it acceptable for the outcome model to contain predictors that were not specified in the mediator model? (the reason they were not specified in that model, is that each participant only has one value for AttentionForWords, whereas TestingMoment is a within-participant manipulation).


Yes, you could. You may find mediation: R Package for Causal Mediation Analysis written by the authors of the package helpful. Your case is similar to that described in Section 4.2.

When doing causal mediation analysis, you should be very careful about the identification assumptions (Imai et al., 2010a; Imai et al., 2010b). Assessing the sensitivity of analytic results to possible violations of these identification assumptions is a necessary step in applications. You could use the medsens function in the package.

I noticed that you have a multivariate outcome model. To my knowledge, they did not discuss this in their articles. I am not sure whether you could simply deal with it in the way as you described.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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