Interaction: At What Reference Level, on What Scale?

On this page
อ่านฉบับภาษาไทย (Thai version)
Abstract
Interaction means that the effect of one variable depends on the level of another, and two ideas decide how it is read. First, once a model contains an interaction term, each main effect becomes conditional: in a treatment-by-time model with baseline as the reference, the treatment coefficient is the treatment-control difference at baseline, not the average effect across visits, and the interaction coefficient is a difference-in-differences. Changing the reference category, or centering age at 60, changes what a main effect means without changing the fitted model. Second, interaction is scale-dependent. In a 2×2 factorial trial with risks of 10%, 20%, 20% and 40%, the joint risk ratio of 4 equals 2 × 2, so there is no multiplicative interaction, yet the observed joint risk of 40% exceeds the additive expectation of 30%, so additive interaction is present. Interaction is heterogeneity of effect, not the distortion that confounding causes. This article builds the habit of naming both the reference category and the effect scale before reading any interaction.
Two reports that skip a question
A randomised trial measures its outcome at baseline and at follow-up, and the analysis model contains a treatment-by-time interaction. The report reads the treatment coefficient as "the treatment effect". A second study, a 2×2 factorial trial of two treatments, A and B, produces two summaries: one analyst writes "no interaction", another writes "the treatments interact".
Each report skips a question. The first never says at which reference level its main effect is read. The second never says on which scale interaction was assessed. Those two questions organise everything below.
What is interaction?
Suppose a study looks at two variables: a treatment $T$ and another variable $Z$. Without interaction, a regression model might be
$$Y = \beta_0 + \beta_1 T + \beta_2 Z$$This model assumes that the effect of treatment is the same regardless of $Z$. In other words, the treatment effect is $\beta_1$ at every value of $Z$.
To let the treatment effect depend on $Z$, add an interaction term:
$$Y = \beta_0 + \beta_1 T + \beta_2 Z + \beta_3 (T \times Z)$$Now the effect of treatment is
$$\boxed{\text{Treatment effect} = \beta_1 + \beta_3 Z}$$so the treatment effect is no longer necessarily constant. That is the core meaning of interaction:
$$\boxed{\text{The effect of one variable depends on another variable}}$$Why main effects change meaning when interaction is present
Consider a repeated-measures regression:
$$Y_{ij} = \beta_0 + \beta_1 (\text{Treatment}) + \beta_2 (\text{Time}) + \beta_3 (\text{Treatment} \times \text{Time})$$Suppose control is coded 0, treatment is coded 1, and baseline is the reference time. At baseline, the time-related terms are zero. Read the model one cell at a time.
-
Control group at baseline
\[ Y_{\text{control, baseline}} = \beta_0 \]
Treatment is 0 and the time terms are zero, so only the intercept is left.
-
Treatment group at baseline
\[ Y_{\text{treatment, baseline}} = \beta_0 + \beta_1 \]
Treatment is 1, which adds $\beta_1$; the time terms are still zero.
-
Treatment versus control at baseline
\[ \boxed{\beta_1 = \text{treatment vs control difference at baseline}} \]
Subtracting the control cell from the treatment cell leaves $\beta_1$.
Result: With baseline as the reference time, $\beta_1$ is the treatment effect at baseline. It is not automatically the average treatment effect across all visits.
What does the interaction coefficient mean?
In
$$Y = \beta_0 + \beta_1 T + \beta_2 \text{Time} + \beta_3 (T \times \text{Time})$$the interaction coefficient $\beta_3$ tells how much the treatment effect changes as time changes. With two time points:
$$\text{Treatment effect at baseline} = \beta_1$$$$\text{Treatment effect at follow-up} = \beta_1 + \beta_3$$Therefore
$$\boxed{\beta_3 = \text{difference in treatment effect between follow-up and baseline}}$$Equivalently, with a simple baseline and follow-up design,
$$\beta_3 = (\text{change in treatment group}) - (\text{change in control group})$$This is why a treatment-by-time interaction is closely related to a difference-in-differences contrast. Trials with several visits are taken further in Treatment-by-Time Interaction: Which Coefficient Is the Treatment Effect?
What happens if there is no interaction?
Remove the interaction term:
$$Y = \beta_0 + \beta_1 T + \beta_2 \text{Time}$$Now consider baseline and follow-up. At baseline, treatment minus control is $\beta_1$. At follow-up, treatment minus control is again $\beta_1$. Thus
$$\boxed{\beta_1 = \text{common treatment effect across time}}$$The model assumes that the treatment-control difference stays constant. So the distinction is:
Without and with interaction
| Without interaction | With interaction | |
|---|---|---|
| Model | $Y = \beta_0 + \beta_1 T + \beta_2 Z$ | $Y = \beta_0 + \beta_1 T + \beta_2 Z + \beta_3 TZ$ |
| $\beta_1$ | Common effect of treatment | Effect of treatment when $Z$ is at its reference value |
| $\beta_3$ | Not in the model: the treatment effect is assumed constant | How the treatment effect changes across $Z$ |
Interaction is symmetric
An interaction can be read from either direction. For
$$Y = \beta_0 + \beta_1 T + \beta_2 Z + \beta_3 TZ$$we can say:
The effect of treatment depends on $Z$.
But we can equally say:
The effect of $Z$ depends on treatment.
Mathematically these are the same interaction. So interaction is not intrinsically "the effect of treatment on $Z$" or "the effect of $Z$ on treatment". It describes effect dependence.
Interaction is scale-dependent
This is the deeper concept. Suppose two treatments, A and B, are studied in a 2×2 factorial trial, and the risk of the outcome in each of the four groups is as in the table below. The same four risks can be examined on different effect scales [1], and a factorial trial requires asking whether the effect of each treatment depends on whether the other one is given.
Risk in each group of the factorial trial
| Treatment A | Treatment B | Risk |
|---|---|---|
| No | No | 10% |
| Yes | No | 20% |
| No | Yes | 20% |
| Yes | Yes | 40% |
Multiplicative interaction
First consider risk ratios.
-
Effect of A when B is absent
\[ \mathrm{RR}_A = \frac{0.20}{0.10} = 2 \]
Risk with A only over risk with neither treatment.
-
Effect of B when A is absent
\[ \mathrm{RR}_B = \frac{0.20}{0.10} = 2 \]
Risk with B only over risk with neither treatment.
-
Expected joint risk ratio
\[ 2 \times 2 = 4 \]
If the two effects combine multiplicatively, the joint risk ratio should be the product.
-
Observed joint risk ratio
\[ \mathrm{RR}_{AB} = \frac{0.40}{0.10} = 4 \]
Risk with both treatments over risk with neither.
-
Compare
\[ \boxed{\mathrm{RR}_{AB} = \mathrm{RR}_A \times \mathrm{RR}_B} \]
There is no departure from multiplicativity.
Result: No multiplicative interaction.
Additive interaction
Now examine risk differences.
-
Effect of A
\[ \mathrm{RD}_A = 0.20 - 0.10 = 0.10 \]
In percentages, 20% − 10% = 10%.
-
Effect of B
\[ \mathrm{RD}_B = 0.20 - 0.10 = 0.10 \]
Again 20% − 10% = 10%.
-
Expected excess risk if the effects were purely additive
\[ 0.10 + 0.10 = 0.20 \]
The expected excess risk from both treatments is 10% + 10% = 20%.
-
Expected joint risk
\[ 0.10 + 0.20 = 0.30 \]
Starting from a baseline risk of 10%, the expected joint risk is 10% + 20% = 30%.
-
Observed joint risk
\[ 0.40 \]
The observed joint risk is 40%, so the observed joint effect exceeds the additive expectation.
-
Additive interaction contrast
\[ 0.40 - 0.20 - 0.20 + 0.10 = 0.10 \]
The contrast is above zero.
Result: Additive interaction is present.
How can additive interaction exist without multiplicative interaction?
There is no contradiction. The two analyses ask different questions.
Two scales, two questions
| Scale | The question | Observed joint effect compared with |
|---|---|---|
| Additive | Do the two exposures together produce more absolute effect than expected by adding their individual absolute effects? | The sum of the individual absolute effects |
| Multiplicative | Is the joint relative effect different from what would be expected by multiplying the individual relative effects? | $\mathrm{RR}_A \times \mathrm{RR}_B$ |
Interaction depends on the effect measure
Suppose we ask:
"Does A interact with B?"
That question is incomplete. A better question is:
"Does A interact with B on which scale?"
Possible scales include:
- risk difference
- risk ratio
- odds ratio
- hazard ratio (the ratio of event rates over follow-up in a survival analysis)
- mean difference
The effect measure should be the one that corresponds to the scientific question; the measures are not interchangeable [1]. Thus
$$\boxed{\text{Interaction is not an absolute property detached from scale}}$$Regression models often encode a particular interaction scale
The model you choose often determines which type of interaction is being tested. A logistic regression containing $X_1 \times X_2$ tests interaction on the model's log-odds scale, which corresponds to multiplicative interaction in odds ratios. Similarly, models with a log link, which model the log of the risk, express effects on a multiplicative scale.
So simply saying
"The interaction term was not significant."
is incomplete unless the model and the effect scale are clear. The more precise statement is
"There was no evidence of interaction on the scale represented by this model."
Interaction versus confounding
Interaction and confounding are different concepts.
Confounding concerns distortion of an exposure-outcome relationship by another variable. Its question is roughly:
"Is the observed effect estimate distorted because the groups are not comparable?"
Confounding is something to control, based on the causal structure [2].
Interaction asks:
"Does the effect genuinely differ across levels of another variable?"
So
$$\boxed{\text{Confounding = distortion}}$$whereas
$$\boxed{\text{Interaction = heterogeneity of effect}}$$A variable can be a confounder, an effect modifier, both under different analytical roles, or neither. These roles should be defined from the research question and the causal structure, not selected only from P values [2].
Interaction versus main effects
A common mistake is to see a significant interaction and conclude:
"The main effects should be ignored."
That is too simplistic. The correct interpretation is that main effects become conditional. For
$$Y = \beta_0 + \beta_1 X + \beta_2 Z + \beta_3 XZ$$$\beta_1$ is the effect of $X$ when $Z = 0$, or more generally when $Z$ is at its reference level. Likewise, $\beta_2$ is the effect of $Z$ when $X = 0$, or at the reference value of $X$.
The interaction term tells how those conditional effects change.
Reference coding matters
Suppose baseline is the reference time. Then
$$\beta_1 = \text{treatment effect at baseline}$$But if the final visit is made the reference time, the treatment main effect changes interpretation:
$$\beta_1 = \text{treatment effect at the final visit}$$The underlying fitted model can represent the same data while the interpretation of each coefficient changes, because the parameterization changed.
Interaction with a continuous variable
Interaction is not limited to categorical variables. Suppose
$$Y = \beta_0 + \beta_1 T + \beta_2 \text{Age} + \beta_3 (T \times \text{Age})$$Then the treatment effect at age $a$ is
$$\boxed{\text{Treatment effect at age } a = \beta_1 + \beta_3 a}$$so the treatment effect changes continuously with age.
But there is an important interpretation issue. If age is entered in years without centering, $\beta_1$ is the treatment effect when age is 0, which may be clinically meaningless. One useful parameterization is therefore to center age around a meaningful value, for example
$$\text{Age}_c = \text{Age} - 60$$Then $\text{Age}_c = 0$ means age 60, and $\beta_1$ becomes the treatment effect at age 60.
Interaction in a 2×2 factorial trial
A factorial design studies two interventions at the same time. The four groups are:
- neither A nor B
- A only
- B only
- A + B
The efficiency of this design depends partly on whether the interventions act independently or whether their effects interact. A conceptual model is
$$Y = \beta_0 + \beta_1 A + \beta_2 B + \beta_3 (A \times B)$$If there is no interaction on the model's scale, $\beta_3 = 0$. If the effect of A changes depending on B, $\beta_3 \neq 0$. But again, that statement must be understood on the scale represented by the chosen model.
The most common traps
-
"Main effect means average effect."
Not necessarily. With an interaction term, the main effect is the effect at the other variable's reference level: in a treatment-by-time model with baseline as the reference, $\beta_1$ is the treatment effect at baseline.
Fix: Read each main effect at the reference level of the variable it interacts with, and name that level when you report it.
-
"No significant interaction means the effects are identical."
A failure to detect interaction is not automatically proof that the effects are exactly identical. It means the analysis did not provide sufficient evidence of departure from the specified interaction structure on that scale.
Fix: Write "no evidence of interaction on the scale represented by this model", never "the effects are the same".
-
"Interaction must appear on every scale."
False. Interaction is scale-dependent: additive interaction can exist without multiplicative interaction, as in the factorial example.
Fix: State the scale with every interaction finding, for example "no multiplicative interaction on the risk-ratio scale".
-
"Choose the scale with the smaller P value."
Wrong. The scale should follow the scientific estimand, the quantity the study sets out to estimate, and the research question [1]. Choosing a scale merely because it produces a smaller P value is not principled analysis.
Fix: Choose the scale from the research question before looking at any result.
-
"A significant interaction makes all main effects meaningless."
Wrong. The main effects remain interpretable, but their interpretation is conditional on the reference level.
Fix: Keep the main effects and read each one as the effect at the reference level of the other variable.
A fast interpretation algorithm
Whenever you see an interaction term, use this sequence.
-
Step 1. Identify the interacting variables
\[ \text{Treatment} \times \text{Time} \]
Name the two variables in the product term, for example treatment and time.
-
Step 2. Identify the reference categories
For example, control is the reference treatment and baseline is the reference time.
-
Step 3. Interpret the main effects conditionally
\[ \beta_{\text{Treatment}} = \text{treatment effect at baseline} \]
Likewise, $\beta_{\text{Time}}$ is the time effect in the control group.
-
Step 4. Interpret the interaction
Ask how much the effect of one variable changes across levels of the other.
-
Step 5. Identify the effect scale
Ask whether interaction is being evaluated with differences, ratios, odds, hazards or another effect measure.
Result: Only then can the interaction be interpreted correctly.
Final takeaway
Interaction is fundamentally about effect heterogeneity:
$$\boxed{\text{Does the effect of } X \text{ change according to } Z\text{?}}$$But two further questions must always follow:
$$\boxed{\text{At what reference level?}}$$$$\boxed{\text{On what effect scale?}}$$For regression coefficients, reference coding determines how the main effects are interpreted. For clinical and epidemiologic effects, the chosen scale determines what kind of interaction is being assessed.
Glossary
- interaction (ปฏิกิริยาสัมพันธ์ (interaction))
- The effect of one variable depends on the level of another variable; every statement of it holds on a stated scale.
- main effect
- The coefficient of one variable in a model that also contains its interaction term; it is the effect at the reference level of the other variable, not an average effect.
- reference category
- The level coded 0, such as control or baseline, at which the other coefficients of an interaction model are read.
- treatment-by-time interaction (ปฏิกิริยาสัมพันธ์ระหว่างการรักษากับเวลา)
- The model term that lets the treatment-control difference change across visits.
- difference-in-differences contrast
- The change in the treatment group minus the change in the control group; with baseline and one follow-up it equals the treatment-by-time coefficient.
- effect modifier (ตัวปรับผล (effect modifier) หรือสิ่งสัมผัสตัวที่สอง)
- A variable across whose levels the effect of an exposure genuinely differs, on a stated scale.
- multiplicative scale
- A scale on which effects are ratios and combine by multiplying, such as risk ratios or odds ratios.
- additive scale
- A scale on which effects are differences and combine by adding, such as risk differences.
- factorial trial
- A trial that studies two interventions at once in four groups: neither, A only, B only, and both.
- centering
- Subtracting a meaningful value from a continuous variable, such as age minus 60, so that a main effect is read at that value.
References
- VanderWeele TJ, Knol MJ. A tutorial on interaction. Epidemiol Methods. 2014;3(1):33-72. doi:10.1515/em-2013-0005 https://doi.org/10.1515/em-2013-0005
- Hernán MA, Robins JM. Causal inference: what if [Internet]. Boca Raton: Chapman & Hall/CRC; 2020. https://miguelhernan.org/whatifbook
Key takeaways
- With an interaction term, a main effect is conditional: it is the effect at the reference level of the variable it interacts with, not an average effect.
- In a treatment-by-time model with baseline as the reference, the treatment coefficient is the effect at baseline and the interaction coefficient is a difference-in-differences.
- Interaction is scale-dependent: risks of 10%, 20%, 20% and 40% show no multiplicative interaction (4 = 2 × 2) but additive interaction (40% observed against 30% expected).
- Confounding is distortion; interaction is heterogeneity of effect.
- Never interpret an interaction until you identify both the reference category and the effect scale.
Related in the wiki: [[causal-interaction-in-clinical-epidemiology-additive-interaction-reri-ap-and-synergy-index]]