Medical education Key research skills
Volume 213 - Issue 5

Deconfounding confounding part 3: controlling for confounding in statistical analyses

Authors:  Alice M Richardson and Grace Joshy

Med J Aust 2020; 213 (5): 209-212.e1. || doi: 10.5694/mja2.50737
Published online: 7 September 2020
A confounder is a variable that is associated with both the exposure and outcome of interest without being an intermediate on the causal pathway between them

The traditional concept of confounding was previously introduced in this Key Research Skills series — a confounder is a variable that is associated with both the exposure and outcome of interest without being an intermediate on the causal pathway between them.1 Although the earlier article also outlined how a randomised controlled trial (RCT) can be used as a solution to handle confounding at the study design phase, it is not always feasible to use an RCT. For example, consider a study looking at the association between smoking (exposure) and cardiovascular disease (CVD; outcome). It is not ethical to randomly assign people to smoke! The alternative is to conduct an observational study in which confounders are carefully identified, measured without too much error, and adjusted for in the statistical analysis.

Why is confounding important and what can be done about it?

Confounding is one of the most important issues in establishing causality in medical research, and probably the most important cause of spurious associations in observational epidemiology.2 Health consequences of flawed research findings can be serious, as evidenced by the case of hormone replacement therapy, which looked so promising in multiple studies that did not control for confounding by socio‐economic status, but was completely reversed in the Women's Health Initiative trial, which controlled for socio‐economic status.3,4 Unless controlled for, confounding distorts the estimate of the exposure–outcome association and makes it difficult to measure the true association.

A common way to quantify the magnitude of confounding is based on a rule of thumb,5 namely that if a parameter estimate changes by more than 10% when an additional variable is added to a model, then this variable is considered to be a potentially strong confounder; the place of this variable in the causal pathway needs separate consideration. A wider range of approaches to quantifying confounding has been explored,6 and causal pathways appear in earlier articles in this series.7,8

Methods to control for confounding in the study design phase include randomisation (to ensure participants have an equal chance of being in any arm of the RCT, so that the distribution of confounders in arms are similar), matching (eg, age, sex, smoking status in case–control studies, especially when the outcome is rare) and restriction (restricting the study to a particular level of the confounder variable). However, controlling for confounding in the study design phase is not always feasible. For example, some research questions do not permit random assignment of participants. Similarly, when there are multiple confounders to be controlled for, a matched study can become unwieldy. Restriction of a study to individuals with the same levels of the confounding factors may affect sample size and generalisability, and limit the scope of the study.

This article focuses on controlling for confounders in the analysis phase. Stratification, statistical adjustment (including but not restricted to methods such as ANCOVA [analysis of covariance]) and standardisation are fundamental methods that can be used to control for measured confounding variables.

Controlling for confounding using stratification

Stratification involves splitting the study sample into subsamples based on categories of the confounding variable and looking at the exposure–outcome relationship separately within categories. Attia and colleagues1 use the example of the smoking (exposure) and dementia (outcome) relationship where alcohol consumption is postulated to be a confounder. While the risk of developing dementia was 67% higher among smokers versus non‐smokers in the whole sample (crude relative risk [RR], 1.67), stratification by alcohol consumption showed that the effect of smoking was completely confounded by alcohol consumption (Box 1); elevated smoking–dementia risks were not observed in drinkers or non‐drinkers (RR, 1 in both groups).

Stratification can be used to evaluate potential confounders.9 If stratum‐specific estimates are similar (as in this case, an RR of 1 in both drinkers and non‐drinkers) but are different to the crude estimate (RR, 1.67), the interest lies in combining the stratum‐specific estimates rather than reporting them separately. Stratum‐specific estimates can be combined using the Cochran–Mantel–Haenszel method, which weights the association between two binary variables at different levels of a confounding variable by the number of observations at each level.9 The test statistic can be thought of a pooled statistic over all the strata (levels of confounder variable), weighted by the number of observations in each stratum. In this case, the RRcmh is 1. If stratum‐specific estimates are different, then the relationship between exposure and outcome is different in each stratum, indicating effect modification; instead of combining stratum‐specific estimates, they need to be reported separately. Stratification may involve splitting data into more than two categories (eg, 0, 1–14 and > 14 alcoholic drinks per week).

While stratification is intuitive and easy to use, it cannot be used to control for multiple confounding variables at the same time. Further, it cannot be used to control for continuous variables such as age, which is usually a strong confounder for many exposure–outcome relationships in epidemiology. Residual confounding can also occur whenever a continuous variable has artificial thresholds imposed, such as categorising age or dichotomising a response at the median.

Controlling for confounding using standardisation

A second approach to controlling for confounding is through the presentation of standardised estimates or rates. These allow the researcher to compare patterns across subgroups in the population. A reference group is chosen and the distribution of key characteristics such as age and sex is weighted in the other groups to match the reference group. Death rates and disease incidence are usually strongly related to age and often differ for the two sexes. It is important to allow for the age–sex distribution of the population, particularly when comparing rates over periods of time where the population distribution has changed. This can be done by either direct or indirect standardisation.

For example, to age‐standardise using the direct method, a reference population is chosen and rates of the disease in the standard population are calculated applying age‐specific rates from each population of interest. An age‐standardised rate is a weighted average of the rates in the different age groups. Indirect age‐standardisation can be used if we do not have age‐specific rates for the population of interest, but do have the age structure of the populations of interest and age‐specific rates in a standard population. Rates in the standard population are applied to the populations of interest to determine the number of expected events. Box 2 demonstrates the workflows for the standardisation methods. In the study presented in Box 3,10 the rates of acute myocardial infarction (AMI) per 1000 person‐years have been included, age‐standardised and sex‐standardised (where applicable) to the 2006 New South Wales population, in 5‐year age groups, using the direct method. Although the age and sex distributions may differ by smoking categories and crude rates may not be meaningful for comparison, the age‐ and sex‐adjusted rates can be compared. There is a nearly threefold increase in the age‐ and sex‐standardised rate of AMI in current smokers compared with never smokers (6.20 per 1000 person‐years v 2.84 per 1000 person‐years).

Controlling for confounding using statistical adjustment

Statistical adjustment involves including confounding variables in the regression model when modelling the exposure–outcome relationship. For instance, consider the study results presented in Box 3,10 which look at the risk of developing AMI in relation to smoking. Confounders identified a priori include age, sex, region of residence, alcohol consumption, income and education. Multiple confounders are adjusted for simultaneously in Cox regression models. Compared with never smokers, current smokers are 2.45 times more likely to develop AMI after controlling for confounders (ie, holding them fixed at their reference level). Note that the focus here is not on the effect of confounding but on controlling for it. Sex is associated with both smoking and AMI, but is not on the causal pathway in the smoking–AMI relationship (ie, it meets the criteria for a confounder) and the overall analysis is adjusted for sex. However, estimates are also presented separately for men and women (stratified by sex) since the smoking and CVD relationship was different in men and women, as indicated by the significant interaction by sex. Compared with never smokers, smokers are 2.26 times more likely to develop AMI among men; the corresponding risk among women is 2.87 times. Note that the focus here is on the effect of confounding; that is, stratum‐specific estimates. Body mass index (BMI) was considered likely to contribute, at least partially, to the causal pathway between smoking and CVD and does not fully meet the criteria for a confounder. Instead of adjusting for BMI, hazard ratios derived from Cox models were estimated within subgroups of BMI. A further refinement that is possible with adjusted models is that effect modification can also be examined using interaction terms, which are product variables in the regression model that represent an interaction between two predictor variables.

A regression model estimates the effect of the exposure of interest on the outcome, adjusting for confounders. An interaction term allows quantification of change to this effect estimate when it occurs in combination with a third variable or confounder. The interpretation of interaction terms is dependent upon whether they appear in an additive model, such as a linear regression, or a multiplicative model, such as a logistic regression model on the logit scale. For example, in a linear regression model of age, sex and BMI on physical activity outcomes for patients with kidney disease,11 the interaction between age and haemodialysis is expressly listed as an effect in the linear regression model. For every extra year of age, the predicted level of physical activity drops by an extra 1675.8 units for haemodialysis patients compared with control subjects. In the CVD study discussed above,10 there is significant interaction by age group in the relationship between smoking and CVD. The interpretation is handled by reporting the P value for the interaction term, and then reporting parameter estimates (hazard ratios) separately for age groups. This means that the specific parameter estimates for the interaction terms are not presented. For more information, a broad ranging tutorial on interactions in non‐linear models is available.12

Conclusion

Introductory textbooks9 commonly refer to stratification as a useful method to control for confounding, which it is, but it is not commonly used in practice owing to its limitations. Similarly, standardisation is often proposed as a helpful method of presenting results, but it also has limitations in terms of the number of variables that can be controlled for. Although control for confounding using statistical adjustment is relatively easier during the analysis phase, one needs to think carefully about causal pathways and potential confounders during the study design phase itself. Clinical knowledge is needed to identify potential confounders which are not on the causal pathway between the exposure and the outcome — no statistical test can verify this assumption. Further, we can control for confounding in the analysis phase only if we have measured the confounder. Depending on the research question and the intended readership of the research, one may choose to control for confounding or describe modification of effect estimates.

Box 1 – Stratification by alcohol consumption


RR = relative risk.

Box 2 – Workflows for the direct and indirect standardisation methods


Box 3 – Fatal and non‐fatal acute myocardial infarction in relation to smoking status10

Analysis

Events

Standard rate*

HR (95% CI)


Overall

 Never smoker

2318

2.84

1.00

 Past smoker

1687

3.22

1.21 (1.13–1.29)

 Current smoker

543

6.20

2.45 (2.22–2.70)

By sex

Men

 Never smoker

1231

3.87

1.00

 Past smoker

1244

4.30

1.15 (1.06–1.25)

 Current smoker

365

7.98

2.26 (2.00–2.55)

Women

 Never smoker

1087

1.96

1.00

 Past smoker

443

2.29

1.31 (1.16–1.46)

 Current smoker

178

4.61

2.87 (2.43–3.39)

By BMI

15–19.9 kg/m2

 Never smoker

110

2.84

1.00

 Current smoker

31

5.88

1.97 (1.22–3.16)

20–24.9 kg/m2

 Never smoker

702

2.37

1.00

 Current smoker

165

6.02

2.55 (2.11–3.07)

25–29.9 kg/m2

 Never smoker

850

2.81

1.00

 Current smoker

182

5.8

2.47 (2.08–2.94)

30–50 kg/m2

 Never smoker

440

3.48

1.00

 Current smoker

120

6.71

2.53 (2.04–3.14)


BMI = body mass index; HR = hazard ratio. * Rates are per 1000 person‐years, age‐standardised and sex‐standardised (where applicable) to the 2006 New South Wales population, in 5‐year age groups, using the direct method. Overall rates are age‐ and sex‐standardised. Sex‐specific rates are standardised for age. † HRs adjusted for age (in years as the underlying time variable), sex, region of residence, alcohol consumption, annual household income and education attainment. ‡ HRs adjusted for age (in years as the underlying time variable), region of residence, alcohol consumption, annual household income and education attainment.


Authors


Competing interests


References


Provenance: Commissioned; externally peer reviewed.