This is a more conceptual question and I think it highlights my lack of knowledge of what can be assumed using mixed-effects modelling on a non-experimental repeated-measures data.

Let's pretend we have a repeated-measures data set where data is :

  • clustered by participant (i = 1, 2, ... 50)
  • collected over several days (t = 1, 2, ... 10)
  • where outcome variable is pain rating (0 to 100)
  • where key predictor variable is happiness rating (0 to 100 as well)
  • and where I expect the relationship between pain rating and happiness rating to be mediated by hours of sleep that day (0 to 10 hrs)

Let's imagine I have sufficient prior theoretical knowledge to reasonably expect increase in happiness rating to decrease pain rating but that effect to be mediated by hours of sleep. I want to test that so I have participants complete my survey for 10 days straight to gather enough data per participant. I create a mixed-effects model and I find exactly what theory suggests.

Example model:

m1 <- lmer(pain rating ~ happiness rating + (1 | sleep) + (1 | participant))

Can I:

  1. Draw a causal inference such as (very simplified) "Happiness reduced pain"?

My intuitive answer is no. But I could say "Happiness is associated with pain".

  1. Go further and conclude causality about sleep, e.g. "Hours of sleep affected pain"?

My intuitive answer again is no and instead I would say "The hours of sleep explained some of the variance in the pain".


1 Answer 1


Can I: Draw a causal inference such as (very simplified) "Happiness reduced pain"?

No, regression coefficient estimates can be thought of very much like correlation coefficient - and you can't infer causation from correlation. As you said, you can conclude that happiness is associated with pain, primarily because of the possibility of unmeasured confounding bias, but there are other sources of bias such as selection bias and collider bias (see the question linked at the end of this answer for more about this).

Can I: Go further and conclude causality about sleep, e.g. "Hours of sleep affected pain"?

No, for the same reason, but you can estimate an association of a 1 unit change in hours of sleep with the pain score (likewise for happiness in the first case above).

Note that you would need 2 models to do this. In the model for $sleep \rightarrow pain$, happiness is a confounder so you would need happiness in the model, wheareas in the model for $happiness \rightarrow pain$ sleep is a mediator and you would not want to include it in the model (as either a fixed or random effect).

You might find this useful to explain how to identify mediators and confounders and when to include them in a model, as well as related issues regarding selection bias and collider bias: How do DAGs help to reduce bias in causal inference?

  • $\begingroup$ Thank you, @Robert Long! I'm glad to hear that my interpretation was accurate. Your link to the DAGs answer was very educational and prompted me to think further about mediators and confounders. $\endgroup$ Jul 28, 2020 at 10:28
  • $\begingroup$ You're welcome, and I would strongly encourage you to go into this in more depth :) $\endgroup$ Jul 28, 2020 at 11:06

Your Answer

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

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