1/28
Looks like no tags are added yet.
Confounding
When another variable distorts the observed association between an exposure and an outcome.
Effect modification:
When the association between an exposure and an outcome differs depending on another variable.
How do we identify whether an effect differs between groups?
Outcome | Predictor | Method |
|---|---|---|
Binary | Binary/categorical | |
Continuous | Binary | |
Continuous | Categorical (3+ groups) | |
Binary | Continuous | |
Continuous | Continuous | |
Survival | Categorical | |
Survival | Continuous |
Outcome | Predictor | Method |
|---|---|---|
Binary | Binary/categorical | Chi-square test |
Continuous | Binary | t-test |
Continuous | Categorical (3+ groups) | ANOVA |
Binary | Continuous | Logistic regression |
Continuous | Continuous | Linear regression |
Survival | Categorical | Log-rank test |
Survival | Continuous | Cox regression |
crude association
association calculated without adjusting for other variables.
The structure of confounding: DAG

How can we deal with confounding?
By design: Randomization, as in a randomized controlled trial.
Covariate adjustment: Include potential confounders in a regression model.
Re-weighting approaches: Give different observations different weights to account for differences between groups.
When does covariate adjustment work?
1. No unmeasured confounding
We need to have collected information on the relevant confounders.
For example, if both age and cholesterol are influenced by another important variable, but we never measured that variable, we cannot adjust for it in our regression model.
2. Correct model specification
We must use an appropriate statistical model.
For example, if the relationship between age and cholesterol is strongly nonlinear, but we fit a simple linear regression, our model may not represent the relationship correctly.
So, even if we have measured the confounders, incorrect modelling can still produce misleading results.
Suppose men are older than women and men also have higher cholesterol. What happens to the crude association between age and cholesterol?
It is overestimated
Suppose women are older than men but women have lower cholesterol. What happens to the crude age–cholesterol association?
It is underestimated
Adjusting for a collider can create a false association
Advanced cancer stage → Hospital admission ← Other serious illness
Hospital admission is the collider because both variables point towards it.
Why is adjusting for it a problem?
Imagine looking only at patients who were admitted to hospital. Among those patients, someone without advanced cancer may be more likely to have been admitted because of another serious illness.
This can create an apparent relationship between advanced cancer stage and other serious illness, even if they were not related in the general population.
Difference between cofounder and mediator
Confounder: a variable that influences both the exposure and outcome.
Mediator: a variable through which the exposure influences the outcome.
What is a heterogeneous effect?
The effect of a treatment or exposure is not necessarily the same for everyone.
You want to investigate whether exercise affects glucose levels. Which variable is the outcome and which is the predictor?
Outcome = glucose. Predictor/exposure = exercise.
How do you assess whether BMI confounds the exercise–glucose association?
Compare the exercise coefficients in crude and adjusted models. A change greater than 10% suggests confounding.
The crude coefficient is 6.3 and the adjusted coefficient is 5.0. Calculate the percentage change.

The crude coefficient is 0.08 and adjusted coefficient is 0.076. Is there substantial confounding?
No. The change is 5%, below the 10% rule of thumb.
How do you test whether a continuous confounder is associated with a continuous outcome?
Use linear regression
In regression output, the interaction p-value is 0.003. What do you conclude?
Significant evidence of effect modification
The interaction p-value is 0.42. What do you conclude?
Insufficient evidence of effect modification.
Coffee = 5.6945 and Coffee:Sex = 1.4914. Calculate the coffee effect in males.
5.6945+1.4914=7.1859
Each additional unit of coffee is associated with an increase of 7.186 beats/min in males.

A researcher investigates whether diabetes confounds the association between blood pressure and BMI. Which two models are required?
mod1 <- lm(mass ~ pressure, data = SynthDiabetes2)
mod2 <- lm(mass ~ pressure + diabetes,
data = SynthDiabetes2)
(crude and adjusted)
In the adjusted model, the diabetes coefficient has p = 0.001. Does this alone prove confounding?
No. Also compare the crude and adjusted pressure coefficients.
A researcher investigates whether N-stage modifies the association between ENS and time to distant metastasis. Which regression model is appropriate?
Write the R code to investigate this interaction.
Cox regression, because the outcome is survival time.
mod1 <- coxph(
Surv(DMtime, DM) ~ ENS * factor(N),
data = DM
)
summary(mod1)The likelihood ratio test gives p = 0.25. Is there evidence of effect modification?
No. There is insufficient evidence of interaction.
What is the appropriate regression model when the outcome is DM12 (yes/no)?
Logistic regression.
Crude linear model |
|
Adjusted linear model |
|
Linear interaction |
|
Logistic regression |
|
Logistic interaction |
|
Cox regression |
|
Cox interaction |
|
Odds ratios |
|
OR confidence intervals |
|
Nested model comparison |
|
Likelihood ratio test |
|