Most outcomes are not caused by or associated with a single predictor variable in isolation. Instead, these relationships involve many other variables (ie, third variables).1  Statistical models can help make sense of these complex relationships. A statistical interaction is a type of third variable effect that assesses whether the relationship between a predictor and outcome is modified by a third variable. For example, you can use an interaction to evaluate whether the effect of treatment on patient outcomes differs by a child’s comorbidity to determine if treatment is more effective in certain subpopulations. However, terminology and interpretation of interactions can be confusing, hindering the use of this method and understanding of these studies. Our objectives were to:

  1. define interaction and how it differs from other third variable approaches (eg, confounder, mediator);

  2. identify benefits and limitations of ways to evaluate potential interactions (eg, interaction term versus stratified analysis); and

  3. review interpretations of interaction effects.

This article highlights interactions between 2 categorical variables because this is the simplest and most common application of interactions in medicine. However, the principles discussed here can be applied to interactions with continuous variables, higher order interactions (ie, between 3 or more variables), or models with multiple interactions.

Three common methods to account for third variable effects include incorporating interactions, mediation, and confounders into models. Understanding the distinction between these is important to properly set up the model (Table 1). To illustrate this distinction, we will examine a study that evaluated the effect of limited English proficiency (LEP) on readmissions for hospitalized children. They used several third variables including income and race/ethnicity. Note, the term third variable is used for simplicity; in reality, complex relationships involve >3 variables.

TABLE 1

Third Variable Types

Third VariableDefinitionStatistical AnalysisExample
Interaction/effect modifier Evaluates whether the effect of exposure on outcome differs by the value of the third variable or the combined effects of the exposure and third variable 1. Regression model that includes exposure, third variable, and interaction term; or
2. stratified analysis of exposure on outcome at each level of the third variable 
Association between LEP and readmissions is modified by family income (ie, association differs by the level of family income) 
Mediator Third variable is intermediate step on causal pathway Regression-based methods for testing indirect/mediated effects or potential outcomes framework6,7  Association between LEP and readmission is mediated by knowledge of outpatient care (ie, LEP patients may have reduced knowledge of outpatient care, leading to greater ED visits and increased readmissions) 
Confounder Third variable is associated with the exposure and outcome but not an intermediate step in the causal pathway Include a confounder as a term in a multivariable regression model to provide an estimate of the exposure adjusted for the confounder Association between LEP and readmissions is confounded by race/ethnicity (ie, race/ethnicity differs between LEP and non-LEP and may influence readmission) 
Third VariableDefinitionStatistical AnalysisExample
Interaction/effect modifier Evaluates whether the effect of exposure on outcome differs by the value of the third variable or the combined effects of the exposure and third variable 1. Regression model that includes exposure, third variable, and interaction term; or
2. stratified analysis of exposure on outcome at each level of the third variable 
Association between LEP and readmissions is modified by family income (ie, association differs by the level of family income) 
Mediator Third variable is intermediate step on causal pathway Regression-based methods for testing indirect/mediated effects or potential outcomes framework6,7  Association between LEP and readmission is mediated by knowledge of outpatient care (ie, LEP patients may have reduced knowledge of outpatient care, leading to greater ED visits and increased readmissions) 
Confounder Third variable is associated with the exposure and outcome but not an intermediate step in the causal pathway Include a confounder as a term in a multivariable regression model to provide an estimate of the exposure adjusted for the confounder Association between LEP and readmissions is confounded by race/ethnicity (ie, race/ethnicity differs between LEP and non-LEP and may influence readmission) 

ED, emergency department.

An interaction evaluates whether and how the relationship between an exposure and outcome is modified by the value of a third variable.2  In medicine, interactions commonly assess how the effect of an exposure, treatment, or intervention may differentially impact outcomes in different subgroups of people or settings.1  Additionally, interactions can evaluate the combined effect of 2 treatments or interventions on outcomes or behaviors. To address interactions, models can include an interaction term, which is the multiplication of 2 variables (exposure × third variable). “Interaction” and “effect modification” are often used interchangeably, although there are differences that are beyond the scope of this article.2  For simplicity, we will refer to both as interaction.

In the example, the effect of LEP (exposure) on readmissions (outcome) was hypothesized to differ by family income (third variable), so they included an interaction between LEP and income.3  They found a significant interaction (P = .03), meaning the association between LEP and readmissions was modified by income. Among families in the lowest income quintile, LEP patients had higher odds of readmission compared with English-proficient patients (odds ratio [OR] 1.77 [1.03–3.05]) (Table 2). Among those in the highest income quintiles, there was no association. This suggests that LEP status affects readmissions among the poorest patients, thereby identifying a vulnerable subpopulation.

TABLE 2

Interaction Example from the Literature

Income QuintileAdjusted Odds of Readmission (OR [95% CI])
First/second quintile  
 English proficiency Reference 
 LEP 1.77 (1.03–3.05) 
Third quintile  
 English proficiency Reference 
 LEP 0.99 (0.82–1.20) 
Fourth quintile  
 English proficiency Reference 
 LEP 0.92 (0.79–1.08) 
Fifth quintile  
 English proficiency Reference 
 LEP 1.06 (0.79–1.41) 
Income QuintileAdjusted Odds of Readmission (OR [95% CI])
First/second quintile  
 English proficiency Reference 
 LEP 1.77 (1.03–3.05) 
Third quintile  
 English proficiency Reference 
 LEP 0.99 (0.82–1.20) 
Fourth quintile  
 English proficiency Reference 
 LEP 0.92 (0.79–1.08) 
Fifth quintile  
 English proficiency Reference 
 LEP 1.06 (0.79–1.41) 

This study evaluated the association between LEP and risk of readmission with an interaction between LEP and family income quintile.3  The interaction term was significant (P = .03), meaning that the association between LEP and readmission was modified by family income. This adapted table displays the stratified odds of readmission for patients with LEP versus English-proficient patients among each level of the third variable (income quintiles). Only the OR in the first/second quintile was significant, meaning that, among the poorest patients, LEP was associated with increased odds of a readmission. This relationship was not true for other income quintiles. Of note, one cannot compare the ORs across income strata because they each have a different reference group. Instead, an interaction term is needed to statistically evaluate if the groups have different effects (ie, the above-mentioned P = .03, which is not included in a stratified analysis). CI, confidence interval.

Mediation assesses whether a third variable is on the causal pathway between exposure and outcome and is evaluated by analyzing mediated effects.4  A possible mediated effect in the above example is that LEP may influence knowledge of outpatient care, leading to greater emergency department visits, which may influence readmissions.

Confounding exists when exposure groups differ with respect to the third variable, and that variable influences outcomes but is not on the causal pathway.5  Confounders distort the true association between exposures and outcomes and can be adjusted for in models.1,5  Although interaction terms and mediation assist with describing the relationship between variables by considering clinically relevant third variables, confounding is about accounting for unanticipated effects of third variables.1  In the unadjusted analysis of the above study, there was a significant association between LEP and readmission rates, but after adjusting for confounders (eg, race/ethnicity), it was no longer significant. Thus, our results would have been misleading had we not adjusted for race/ethnicity as a confounder.

Not including an interaction or improperly including it as a confounder may also lead to inaccurate conclusions.6  In the above example, the adjusted analysis included income as a confounder instead of an interaction and found no association between LEP and readmissions. If they had not secondarily evaluated income as an interaction, they would have missed identifying a vulnerable subpopulation.

Interactions can be accounted for by including a statistical interaction term, or performing stratified analysis, which tests the association between exposure and outcome by separating the group by the value of the third variable. Although stratified analyses may be easier to interpret, they have significant limitations compared with models with interaction terms:

  1. a stratified analysis has reduced statistical power, which is particularly important in small sample sizes7 ;

  2. unlike interaction terms, stratified analyses cannot be performed if investigators want to include a continuous third variable. Continuous variables can be categorized for stratified analyses, but the interpretation of these categories should be clinically relevant. If not, it can be beneficial to keep variables continuous and use interaction terms; and8 

  3. a stratified analysis splits data according to the third variable and conducts separate analyses within groups; therefore, there is no common reference group and no way to statistically compare the groups.

This comparison can be done with an interaction term. To further explain this point, both a stratified analysis and interaction term model will provide effect estimates (eg, ORs, confidence intervals) for the relationship between exposure and outcome for each value of the third variable. A model with an interaction term will additionally evaluate whether the interaction was statistically significant (ie, whether the association between exposure and outcome is different on the basis of the value of the third variable). This comparison cannot be done in a stratified analysis. This is important because sometimes the scientific question relies on the ability to compare subgroups, such as whether the effect of an intervention is different in different populations. Thus, a stratified analysis can be used as a quick way to see if there are potential differences, but an interaction term is the most informative and accurate approach.

To illustrate this last point, we will compare the findings of a stratified analysis and interaction term using an example in primary care. This study found that an intervention involving prompts to clinicians to discuss asthma control (exposure) was associated with an increased likelihood of guideline-concordant asthma treatment (outcome).9  They performed a stratified analysis of patients who were and were not using preventative asthma medications (third variable). The odds of guideline-concordant treatment associated with the intervention was 2.01 (95% confidence interval: 1.19–3.38) among children using preventative medication and 6.25 (3.39–11.54) for children not on preventative medication. Although the ORs look different, we cannot statistically compare them because the reference groups are different (children in the control group using preventative medications versus children in the control group not using preventative medications, respectively). Thus, we cannot assess for statistical differences between them. This would leave us guessing whether the relationship differs significantly between groups. Fortunately, they additionally included an interaction term and found that it was significant, allowing them to conclude that the intervention effect was larger in one subgroup. The knowledge that children not on preventative medication may benefit most from the intervention can inform future targeted dissemination.

Interaction analyses can yield multiple effect estimates, which can make interpretation challenging. Typically, there is an effect estimate by each level of the third variable which answers the question, “For a certain level of the third variable, is the exposure significantly associated with the outcome?” There is also a P value or effect estimate for the interaction term which answers the question, “Is the association between exposure and outcome statistically different for the different levels of the third variable?” If the interaction term is significant, the effect of the exposure on the outcome depends on the third variable. If not, then the association does not differ by the third variable. In the asthma example, the interaction term was significant, meaning that the effect of the intervention differed depending on whether patients were using preventative medications. How to perform and report interactions is beyond the scope of this article but can be found in existing resources.2,10 

Examples below highlight the interpretation of interactions:

  1. An interaction can influence the magnitude of the effect. The asthma study highlights an example of a significant interaction (OR 0.31 [0.15–0.68]) with 2 positive, significant ORs for the groups (OR 2.01 [1.19–3.38] and OR 6.25 [3.39–11.54]).9  Thus, the intervention was associated with guideline-concordant treatment in both groups. The significant interaction (OR 0.31 [0.15–0.68]), not a comparison of the 2 ORs (because they have different reference groups), demonstrates that the effect was significantly larger for children not on preventative medications.

  2. An interaction can impact the significance of the effect. A study found that feeding type (exposure, bottle versus breast) was associated with an increased risk of pyloric stenosis (outcome) in infants (OR 2.31 [2.78–7.03]).11  However, there was a significant interaction term with maternal age (P < .001, third variable), meaning that this relationship was modified by maternal age. Young mothers had no association between feeding type and pyloric stenosis (OR 0.98 [0.51–1.88]), but older mothers had a significant association (OR 6.07 [2.23–5.24]). Thus, further studies can explore this relationship, specifically focusing on older mothers.

  3. An interaction can impact the direction of the effect. In an analysis of randomized controlled trials evaluating the impact of corticosteroids (exposure) on death or cerebral palsy in preterm infants (outcome), there was no association (risk difference 0.03 [−0.01 to 0.08]).12  When adding an interaction on the basis of the risk of chronic lung disease (third variable), the interaction was significant (P = .002); thus, the impact of treatment differed on the basis of the risk of chronic lung disease. Authors found that, when the risk was low, steroids increased the likelihood of poor outcomes, but when the risk was high, steroids reduced them. This highlights the importance of including interactions; the initial analysis without interactions found no association and would have missed these key findings.

  4. Interactions can highlight how the effect of a combination of exposures can differently impact the outcome versus the effect of individual exposures. A study found that children with a combination of prenatal tobacco exposure and high lead concentrations had a higher risk of attention-deficit/hyperactivity disorder (OR 8.1 [3.5–18.7]) compared with children with individual exposures alone (lead: OR 2.3 [1.5–3.8], tobacco: OR 2.4 [1.5–3.7]) on the basis of a significant interaction term between lead and tobacco (P < .001).13  Thus, children with both exposures may be a valuable target for future interventions.

  5. An interaction may not be significant. Our study among children hospitalized with suspected pneumonia found no association between antibiotic use and length of stay (effect estimate 0.98 [0.88–1.10]).14  Because we hypothesized that the effect of antibiotics may differentially impact children on the basis of their risk of bacterial disease, we evaluated whether this relationship was modified by radiographic pneumonia (a surrogate marker of bacterial risk). We found that the interaction was not significant (P > .05); thus, the association between antibiotic use (exposure) and outcomes did not differ on the basis of radiographic pneumonia (third variable). This is important because, in a heterogenous population such as pneumonia, it is valuable to determine whether results differ between subgroups.

A big limitation is that interactions can be complicated to interpret. This can be reduced by including tables in the article that follow recommended guidelines, tables that clearly define the comparisons being made, and discussions that properly interpret the findings and their clinical relevance.2,10  The more interactions included, the more difficult it is to interpret. Thus, interactions should be limited to those that are clinically meaningful.

In summary, if investigators are interested in assessing whether the association between an exposure and outcome differs on the basis of the value of a third variable, an interaction term can be included in the model. Interactions can answer clinically relevant questions that other analyses cannot (Table 3).

TABLE 3

Key Points About Interactions

What is it? Third variable that modifies the association between exposure and outcome 
When to use it? • Assess how the effect of an exposure may differentially impact subgroups of people, settings, or situations. 
• Evaluate the combined effect of 2 treatments or interventions. 
Benefits? • Both an interaction term and stratified analysis can account for interaction. 
• Model with an interaction term has benefits over a stratified analysis: 
1. More power; 
2. can include a continuous third variable; and 
3. can statistically compare stratified groups to one another. 
Limitations? Challenging to interpret 
How to interpret it? • Effect estimates for stratified groups: 
For a given level of the third variable, what is the association between exposure and outcome? 
• Effect estimate/P value for interaction term: 
Does the association between exposure and outcome differ by the level of the third variable? 
What is it? Third variable that modifies the association between exposure and outcome 
When to use it? • Assess how the effect of an exposure may differentially impact subgroups of people, settings, or situations. 
• Evaluate the combined effect of 2 treatments or interventions. 
Benefits? • Both an interaction term and stratified analysis can account for interaction. 
• Model with an interaction term has benefits over a stratified analysis: 
1. More power; 
2. can include a continuous third variable; and 
3. can statistically compare stratified groups to one another. 
Limitations? Challenging to interpret 
How to interpret it? • Effect estimates for stratified groups: 
For a given level of the third variable, what is the association between exposure and outcome? 
• Effect estimate/P value for interaction term: 
Does the association between exposure and outcome differ by the level of the third variable? 

Dr Cotter conceptualized the idea and drafted the initial manuscript; Drs Schmiege and Ambroggio, and Ms Moss assisted with conceptualizing the article; and all authors reviewed and revised the manuscript, approved the final manuscript as submitted, and agree to be accountable for all aspects of the work.

FUNDING: No external funding.

CONFLICT OF INTEREST DISCLOSURES: The authors have indicated they have no conflicts of interest relevant to this article to disclose.

1
Bours
MJL
.
Tutorial: a nontechnical explanation of the counterfactual definition of effect modification and interaction
.
J Clin Epidemiol
.
2021
;
134
:
113
124
2
Knol
MJ
,
VanderWeele
TJ
.
Recommendations for presenting analyses of effect modification and interaction
.
Int J Epidemiol
.
2012
;
41
(
2
):
514
520
3
Ju
M
,
Luna
N
,
Park
KT
.
The effect of limited English proficiency on pediatric hospital readmissions
.
Hosp Pediatr
.
2017
;
7
(
1
):
1
8
4
VanderWeele
TJ
.
Mediation analysis: a practitioner’s guide
.
Annu Rev Public Health
.
2016
;
37
(
1
):
17
32
5
Pourhoseingholi
MA
,
Baghestani
AR
,
Vahedi
M
.
How to control confounding effects by statistical analysis
.
Gastroenterol Hepatol Bed Bench
.
2012
;
5
(
2
):
79
83
6
Jupiter
DC
.
Effect modification and interaction terms: it takes two to tango
.
J Foot Ankle Surg
.
2016
;
55
(
4
):
899
902
10.1053/j.jfas.2016.05.008
7
Szklo
M
,
Nieto
J
.
Epidemiology: Beyond the Basics
, 4th Ed.
Jones & Bartlett Learning
;
2007
8
Royston
P
,
Altman
DG
,
Sauerbrei
W
.
Dichotomizing continuous predictors in multiple regression: a bad idea
.
Stat Med
.
2006
;
25
(
1
):
127
141
9
Goldstein
NPN
,
Frey
SM
,
Fagnano
M
,
Okelo
SO
,
Halterman
JS
.
Identifying which urban children with asthma benefit most from clinician prompting: subgroup analyses from the Prompting Asthma Intervention in Rochester-Uniting Parents and Providers (PAIR-UP) trial
.
Acad Pediatr
.
2018
;
18
(
3
):
305
309
10
Vandenbroucke
JP
,
von Elm
E
,
Altman
DG
, et al
.
STROBE Initiative
.
Strengthening the Reporting of Observational Studies in Epidemiology (STROBE): explanation and elaboration
.
Int J Surg
.
2014
;
12
(
12
):
1500
1524
11
McAteer
JP
,
Ledbetter
DJ
,
Goldin
AB
.
Role of bottle feeding in the etiology of hypertrophic pyloric stenosis
.
JAMA Pediatr
.
2013
;
167
(
12
):
1143
1149
12
Doyle
LW
,
Halliday
HL
,
Ehrenkranz
RA
,
Davis
PG
,
Sinclair
JC
.
Impact of postnatal systemic corticosteroids on mortality and cerebral palsy in preterm infants: effect modification by risk for chronic lung disease
.
Pediatrics
.
2005
;
115
(
3
):
655
661
13
Froehlich
TE
,
Lanphear
BP
,
Auinger
P
, et al
.
Association of tobacco and lead exposures with attention-deficit/hyperactivity disorder
.
Pediatrics
.
2009
;
124
(
6
):
e1054
e1063
14
Cotter
JM
,
Florin
TA
,
Moss
A
, et al
.
Antibiotic use and outcomes among children hospitalized with suspected pneumonia
.
J Hosp Med
.
2022
;
17
(
12
):
975
983