Inferences marginal of random effects in multi-level models

Hi,
The answer to your question is IMHO a big “it depends” and it depends on the real-world problem you are trying to attack. Some examples:

  • I want to analyze, whether the average subject in each condition changed reaction over time. Then just looking at the fixed beta is IMHO a good idea.
  • I want to analyze, whether a randomly selected subject in the study would have their reaction changed over time. Then including the varying intercept and effect is IMHO necessary, but I would use the fitted clusters.
  • I want to analyze whether a random person in a hypothethical new realization of the experiment will change their reaction over time. Then I would use the varying intercept and effect and simulate a new cluster.

Does that make sense?

So the big questions are: do I care about the average effect or do I care about individuals? And do I want to analyze what happened or do I want to generalize?

Note also that there are other options, like simulating a hypothetical replication with a limited number of new subjects (with simulated new cluster values) and taking the mean which would get you somewhere in between and might be useful if you want to understand how likely is a replication to see a similar result or when predicting what next few customers will do.

I’ll also note that in brms, the posterior_predict and posterior_linpred functions can do most of what you were computing manually with a combination of the re_formula, allow_new_levels and sample_new_levels parameters (more in the docs https://rdrr.io/cran/brms/man/extract_draws.html).

Best of luck with your modelling!

3 Likes