# Controlling for a variable when estimating interaction effects

Consider the relationships among four variables: sex, activity, height, and weight, as depicted below:

Suppose that weight is the response variable. When sex serves as the predictor, there is no need to control for any covariates. However, when activity is the predictor, we should include both sex and height as covariates.

Here are my questions (with the understanding that weight is always the response variable):

(1) When height is the predictor, what variable(s) should we control for?

(2) Suppose we wish to estimate the interaction effect between sex and activity ("Do the two sexes differ in the association between activity and weight?"). Should we control for height in this scenario?

(3) Suppose we wish to estimate the interaction effect between sex and height ("Do the two sexes differ in the association between height and weight?"). Should we control for activity in this case?

• Thank you for your answer! Just to clarify, for both questions (2) and (3), weight always remains the response/outcome variable. These two questions are specifically centered around the respective interaction effects on weight. Considering this clarification, would your answer change? Commented Aug 6, 2023 at 1:56
• Thanks! With one exposure, it is easy to understand the situation. However, I still have trouble handling an interaction effect between two exposures and determining how to control for a variable when two exposures are involved. Any literature about this topic? Is there a way to figure this out using, for example, the R package dagitty? Commented Aug 6, 2023 at 12:36
• Here is your answer to question (2): "For sex and activity interaction, you should include height because it is a backdoor path to the combined cause {sex, activity}." I'm confused about this because height also acts as a mediator between sex and weight. In this case, should we avoid using it as a covariate for the interaction between sex and activity on weight? Commented Aug 6, 2023 at 15:18
• That's a good question. I think I would still include (that is, control for) height, even if you choke off some of the causal effect of the mediator, and here's why: you would still get the specific effect of sex and activity on weight while avoiding confounding. This seems to me a better way of getting at the interaction of sex and activity than not including height. But I have no other, more fundamental way of thinking about this case. Commented Aug 7, 2023 at 17:13