1 What is confounding?
You can edit a code cell and press “Run Code” to re-run it (R is running inside your browser). The first time, loading the packages takes a few tens of seconds.
1.1 Smoking and death over 24 years
We compare death over the following 24 years between people who were smoking at the first Framingham examination and those who were not.
The proportions who died are 36.1% and 33.8%, and the odds ratio is 1.11 (95% CI 0.98–1.25). There appears to be almost no association between smoking and death.
1.1.1 The two groups differ in more than smoking
Smokers are 3.6 years younger and more often male. Age is strongly related to death, so smokers may appear to die less often simply because many of them are young.
1.1.2 Adjusting for age and sex
When age and sex are added to the model, the odds ratio for smoking becomes 1.63 (1.40–1.90). This means that, comparing people of the same age and the same sex, smokers have about 1.6 times higher odds of death.
1.2 What is confounding?
When there is a third variable (age) related to both the exposure (smoking) and the outcome (death), and the association between exposure and outcome appears distorted because of it, this is called confounding.
flowchart LR A["Age"] --> E["Smoking"] A --> Y["Death"] E -- "Effect of interest" --> Y
- Age → smoking: the younger, the more smokers (in this population)
- Age → death: the older, the more deaths
- As a result, the relation between smoking and death mixes in an association “through age” that is separate from the effect of smoking
The conditions for a confounder are roughly the following three:
- It is a cause of the outcome (death) (or a proxy for one)
- It is associated with the exposure (smoking)
- It is not a consequence of the exposure (it is not an intermediate between exposure and outcome; Chapter 2)
1.3 Confounding by indication: antihypertensive medication and death
Here is another example. We look at death over 24 years among people who were taking antihypertensive medication at the first examination.
The 144 people taking antihypertensive medication had a death proportion of 66.0% (33.6% among those not taking it). However, people on antihypertensive medication are older, have higher blood pressure, and more often have a history of heart disease. Medication is prescribed more often to sicker people, so those taking it appear to have a worse prognosis. This is called confounding by indication.
How does the odds ratio change as we adjust for more variables?
- Unadjusted: 3.82
- Age and sex: 2.67
- blood pressure: 1.70
- history and risk factors: 1.40 (95% CI 0.92–2.13)
The more we adjust, the smaller the odds ratio becomes, but it does not reach 1. Does this mean that “antihypertensive medication increases death”?
Whether antihypertensive medication is prescribed depends not only on the variables measured here, but also on information not in the data, such as the severity the physician observed, organ damage, and family history. Only measured variables can go into a model. Even if the adjusted odds ratio remains above 1, this data alone cannot distinguish whether it is an effect of the drug or unmeasured confounding (residual confounding). Confirming a treatment effect requires a randomized controlled trial (propensity scores in Chapter 7 do not solve this problem either).
1.4 What did adjustment change?
A change in the estimate before and after adjustment is a rough indication that confounding was present (some papers use the criterion “a change of 10% or more means confounding”). However, confounding is not the only reason an estimate changes.
- Adjusting for an intermediate removes part of the effect (Chapter 2)
- Adjusting for a collider creates an association that did not exist (Chapter 2)
- The odds ratio changes just by adding a variable, even without confounding (non-collapsibility, Chapter 3)
It is dangerous to choose adjustment variables from the results of the data, as in “it changed with adjustment, so it is a confounder” or “it did not change, so no adjustment is needed”. What to adjust for is decided before looking at the data, from the causal structure (the DAG in Chapter 2).
- Confounding: an association is distorted by a third variable related to both the exposure and the outcome
- Smoking and death: unadjusted OR 1.11 → adjusted for age and sex 1.63 (smokers were younger)
- Antihypertensive medication and death: confounding by indication. Adjustment lowers it from 3.82 to 1.40, but unmeasured confounding may remain
- Choose adjustment variables from the causal structure, not from the results