I found a three-way interaction effect (each of the three factors has two levels) during a robust linear mixed model(RLMM). I'm wondering how to unpack this interaction.

What I had done is: first separated it into two more RLMMs based on the two levels of factor 1. and then for further simple comparisons, I used paired or unpaired Mann-Whitney nonparametric tests. It's a bit troublesome. I don't know whether there exists a function like pairs() to get the results of all the simple comparisons once.

Thank you for your attention!


1 Answer 1


Models on subsets are not a good way to go. That throws away, within each subset, all the information from the other subset(s). With fewer cases being modeled, error estimates will be less reliable and coefficient standard errors will tend to be increased over those in the combined model.

Your combined model, with its robust variance-covariance matrix for the coefficient estimates, contains all of the information you need. Each of the "simple effects" represents a particular linear combination of model coefficients. You calculate the appropriate linear combination of coefficients for a point estimate, and use the formula for the variance of a weighted sum of correlated variables to get the standard error.

Instead of doing this on your own, take advantage of post-modeling software designed for this purpose. The tools in the emmeans package are particularly useful and allow for things like reliable pairwise comparisons among combinations of predictor values.

  • $\begingroup$ Thanks for your answer. The tools in the emmeans package are also suitable for the robust models? $\endgroup$
    – sasa ZHAO
    Commented Feb 26, 2023 at 17:59
  • $\begingroup$ @sasaZHAO yes. All that matters is having a robust coefficient variance-covariance matrix available to the tools in the package. Depending on the functions you used to build the model, the package might extract that directly from your model. Alternatively, you can specify that matrix yourself. I have an example here, where the covariance matrix was generated by bootstrapping and then submitted to emmeans. $\endgroup$
    – EdM
    Commented Feb 26, 2023 at 18:05

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.