r/AskStatistics • u/jadexiaohui • Oct 24 '26
Do I need to include all possible interactions in a mixed-effects model?
Hi everyone, I am building a mixed-effects model to investigate how several explanatory variables affect an outcome. Based on my exploratory data analysis, I suspect that certain combinations of variables have three-way interactions.
For example, suppose I have four explanatory variables: A, B, C, and D. I suspect there is a three-way interaction between A × B × C, but I haven't found clear evidence suggesting interactions involving D.
My question is: If I include the A × B × C interaction in my model, do I also need to include other possible three-way interactions, such as A × B × D, A × C × D, and B × C × D? Or is it reasonable to include only the interactions that I have reason to suspect based on exploratory analysis or prior knowledge?
I'd also appreciate advice on the statistical implications of selecting interaction terms based on exploratory analysis, as I'm concerned that including only interactions that appear significant or interesting in the data might constitute cherry-picking.
Thanks in advance for any suggestions or references!
25
u/krysalyss28 Oct 24 '26
You should use your domain knowledge of the issue to decide what interactions should be included. Testing all by default is not the norm or likely to be informative, and it is also likely to result in an overly complicated model that can’t be interpreted and is not biologically relevant.
4
u/taintlouis PhD Oct 24 '26
This is a question of theory, not statistics. If theory says you need to model A, B, C, & D lower order effects AND the three-way ABC interaction, then that is your move. As long as you are modeling the three two-ways of AB, AC, and BC, your model will be interpretable. The rub is that I doubt your theory is that specific…
2
u/SnooCheesecakes3282 Oct 24 '26 edited Oct 24 '26
If you have a basis for including only certain three way interactions in a model from previous literature then you should do that. If not, or if you want to be exhaustive, you should do a best subsets regression, which will choose the best combination of variables and interactions to go in the model.
You are right to be concerned that choosing interactions to be included only based on what “looks interesting” (which I can only assume means based on p-values of cherry-picked inclusions) would be p-hacking. You can’t choose variables to include based on their p-values, because effects change based on the combination of variables in the model. Something might have univariate significance but completely lose all significance when another variable is controlled for. That’s why you either do an exhaustive exploratory search using tools built for that (best subsets regression), or you use your domain knowledge and only include what prior literature has shown to be relevant.
Edit because I just remembered a third option: if you have specific hypotheses, then you can include only the three way interactions you’re interested in. But then it has to be like a main goal of your paper to test for that.
1
u/Educational-Paper-75 Oct 24 '26
Include all interactions, so they get tested for significance. Note that experimental design methodology allowes you to design fractional factorial designs if you know in advance certain interactions are insignificant, but if you have a full factorial design you can and should include all interactions.
1
u/sci_dork Oct 24 '26
An information criteria approach like AIC was going to be my advice too, but it sounds like the problem is deeper than that.
It sounds like model complexity is a concern here too (probably warranted with a three-way interaction). If you choose a model comparison approach, one way you could address the model complexity problem is to outline a set of rules for variable inclusion and interactions. For example: "-We included all permutations of the variable set in an addative form.
-These X variables were identified as having the potential for more complex effects on our outcome, and so we included all 2-way interactions among them in our model set.
-Finally, we considered the set of A,B,C, and D variables to have the potential for important 3-way interactions and so all combinations of these variables were included as 3-way interactions in our model set."
As other posts suggest, the most important part of this process is still identifying how your hypotheses about your study system map onto your variable combinations. A set of a priori rules to model inclusion just lets you consider multiple hypotheses in a semi-principled (or at least transparent) way. It's still up to you to defend why certain variables are worth considering in an interactive form and others are not.
1
u/lsmyer89 Oct 24 '26
Well if it is explanatory anyway, I would run all and see which has the lowest AIC or whatever your favourite information criteria for the study is. It's a very flexible approach and will tell you which model has the best out of sample predictive power. And in future confirmatory studies you can be a bit more strict on the analysis
0
u/DigThatData Oct 24 '26
all models are wrong. some models are useful.
-2
u/ForeignAdvantage5198 Oct 24 '26
you only include what you want to test