# Is it possible to have a variable that acts as both an effect modifier and a confounder?

Is it possible to have a variable that acts as both an effect (measurement) modifier and a confounder for a given pair of risk-outcome associations?

I'm still a little unsure of the distinction. I've looked at graphical notation to help me understand the difference but the differences in notation are bewildering. A graphical/visual explanation of the two and when they may overlap would be useful.

A confounding variable must:

• Be independently associated with the outcome;
• Be associated with the exposure
• Must not lie on the causal pathway between exposure and outcome.

These are the criteria for considering a variable as a potential confounding variable. If the potential confounder is discovered (through stratification and adjustment testing) to actually confound the relation between risk and outcome, then any unadjusted association seen between risk and outcome is an artifact of the confounder and hence not a real effect.

An effect modifier on the other hand does not confound. If an effect is real but the magnitude of the effect is different depending on some variable X, then that variable X is an effect modifier.

To answer your question therefore it is to my understanding not possible to have a variable that acts as both an effect modifier and a confounding variable for a given study sample and a given pair of risk factors and outcomes.

• This definition is wrong. It mirrors what Judea Pearl calls "the associational criterion" for a confounder, and he gives multiple reasons for why this definition fails. See Pearl (2009), Causality, section 6.3. Jan 31, 2016 at 14:34

Yes, it is absolutely possible that a variable is both a confounder and an effect modifier. We can run a quick simulation in R to verify this: Consider the following mechanism with $x$ being the treatment and $y$ the outcome. $c$ influences both $x$ and $y$ and, therefore, it is a confounder. But it also interacts with x and so modifies its effect on y.

set.seed(234)
c <- runif(10000)
x <- c + rnorm(10000, 0, 0.1)
y <- 3*x + 2*x*c + rnorm(10000)


So we know the true causal mechanism is $y = 3*x + 2*x*c$. Clearly, $c$ modifies the effect of $x$. However, when we run the regression of $y$ on $x$ only, we also see the confounding kicking in:

lm(y ~ x)
Coefficients:
(Intercept)            x
-0.258        4.856


Finally, as pointed out in my comment, the definition given by oisyutat is wrong. It mirrors what Judea Pearl calls "the associational criterion" for a confounder, and he gives multiple reasons for why this definition fails. See Pearl (2009), Causality, section 6.3.

• +1, unfortunately there are still many old incorrect answers around here Mar 19, 2018 at 7:54