Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Week 6: Effect Modification and CATE

Date: 2 Apr 2026

Required Reading

  • Hernan and Robins (2024) What If, Chapters 4--5. link

Optional Reading

  • VanderWeele (2007) "Four types of effect modification." link
  • VanderWeele (2009) "On the distinction between interaction and effect modification." link

Key Concepts for Assessment

  • Causal Estimand: The specific causal question we want to answer (e.g., the average effect in the whole population).
  • Statistical Estimand: The calculation we perform on our data to try and answer the causal question.
  • Interaction: The combined effect of two or more interventions.
  • Effect Modification: When the effect of one intervention changes depending on a person's characteristics.
  • Heterogeneous Treatment Effects (HTE): The general idea that treatment effects vary across people.
  • Conditional Average Treatment Effect (CATE) : The average treatment effect for a specific subgroup defined by characteristics .
  • Estimated Conditional Average Treatment Effect : Our estimate (from data) of the average treatment effect for a subgroup with characteristics .

What this lecture covers

This lecture covers four related concepts: (1) the distinction between interaction and effect modification, (2) the conditional average treatment effect (CATE), (3) why treatment effects vary across individuals, and (4) how to move from "does it work on average?" to "for whom does it work best?". The appendices contain formal derivations; the main text focuses on intuition.

If you learn nothing else from this course...

To answer psychological questions properly, we first need to state them very clearly. Causal inference gives us the tools to do this.

Causal inference asks: "What if?"

The core idea is to compare what actually happened with what could have happened under different conditions (these "what ifs" are called counterfactuals).

Imagine an outcome we care about, like student test scores (). We might compare the score if everyone got a new teaching method (let's call this condition ) versus if everyone got the old method (condition ).

The difference in the potential outcome () under these two scenarios is the causal effect for one person: .

Since we can't see both scenarios for the same person, we often look at the average effect across a group. The Average Treatment Effect (ATE) is the average difference in potential outcomes across the whole population:

This asks: "On average, how much would scores change if we switched everyone from the old method () to the new method ()?".

A big challenge is dealing with confounders, other factors that mix up the relationship between the treatment () and the outcome (), potentially misleading us about the true causal effect. We need to account for these.

What do 'Interaction' and 'Effect Modification' mean in Causal Inference?

Words like 'moderation' and 'interaction' are often used loosely. Causal inference needs precise terms.

We'll focus on two specific ideas:

  1. Interaction: About the effect of combining interventions.
  2. Effect Modification: About how the effect of one intervention changes for different types of people.

Interaction: The Effect of Teamwork (or Lack Thereof)

Interaction in causal inference is about joint interventions. We look at what happens when we apply two or more different treatments at the same time.

Let's say we have two treatments, and , and an outcome .

  • is the potential outcome if we set treatment to level .
  • is the potential outcome if we set treatment to level .
  • is the potential outcome if we set to and to simultaneously.

To figure out these effects from observational data, we usually need assumptions like:

  • Consistency: The outcome we see for someone who got treatment is the same as their potential outcome .
  • Conditional Exchangeability (No Unmeasured Confounding): We can make the groups receiving different treatments comparable by adjusting for measured confounders ( for , and for ). The sets and might overlap.
  • Positivity: The exposures to be compared occur in all subgroups.

To study the interaction between and , we need to be able to estimate the effect of and the effect of , which means we need to adjust for all confounders in both and (i.e., their union ).

Defining Interaction: Does 1 + 1 = 2?

Let's use an education example:

  • : New teaching method (1=New, 0=Old)
  • : Extra tutoring (1=Yes, 0=No)
  • : Test score

Is the boost in scores from getting both the new method and tutoring simply the sum of the boost from only the new method and the boost from only tutoring?

We define causal interaction on the additive scale (looking at differences) by comparing the effect of the joint intervention to the sum of the individual effects (all compared to getting neither):

Interaction exists if these are not equal. This simplifies to checking if the following is non-zero (see Appendix A):

  • If this is positive: Synergy (the combination is better than expected).
  • If this is negative: Antagonism (the combination is worse than expected).

(We could also look at interaction on other scales, like ratios, which might give different answers. Always state the scale you're using; we'll come back to this in later lectures.)

Finding Causal Interaction in Data

To estimate this interaction, we need valid estimates for all four average potential outcomes:

This means we must control for confounders of both the link and the link.

The following figure shows this. are confounders for , and are confounders for . We need to block the backdoor paths (red arrows).

Diagram illustrating causal interaction. Assessing the joint effect of two interventions, A (e.g., teaching method) and B (e.g., tutoring), on outcome Y (e.g., test score). L_A represents confounders of the A-Y relationship, and L_B represents confounders of the B-Y relationship. Red arrows indicate biasing backdoor paths requiring adjustment.

The next figure shows we need to condition on (adjust for) both and .

Identification of causal interaction requires adjusting for all confounders of A-Y (L_A) and B-Y (L_B). Boxes around L_A and L_B indicate conditioning, closing backdoor paths.

In our education example:

  • (Confounders for Teaching Method Score): Prior achievement, motivation, family background (SES), school quality, teacher differences (if not randomly assigned).
  • (Confounders for Tutoring Score): Prior achievement, motivation, family background (SES, paying for tutoring), student availability, specific learning needs.

Notice that prior achievement and motivation are in both and . We need to measure and adjust for all important factors in and to get a reliable estimate for interaction.

Effect Modification: Different Effects for Different People

Unlike interaction (about combining treatments), effect modification is about whether the causal effect of a single intervention () on an outcome () is different for different subgroups in the population. These subgroups are defined by baseline characteristics (like age, sex, prior history; let's call these or ).

Effect modification helps us understand who benefits most (or least) from an intervention. We explore this using ideas like Heterogeneous Treatment Effects (HTE) and Conditional Average Treatment Effects (CATE).

Heterogeneous Treatment Effects (HTE): The Idea of Variation

Heterogeneous Treatment Effects (HTE) just means that the effect of a treatment ( on ) isn't the same for everyone. The effect varies. This variation is effect modification.

Why does it vary?

  • Differences in things we can measure (like age, sex, baseline health, our variables).
  • Differences in things we can't easily measure (like genetics, unmeasured background factors).

HTE is the reality; treatments rarely work identically for all.

Conditional Average Treatment Effect (CATE): Measuring Variation with Data

To study HTE using data, we focus on the Conditional Average Treatment Effect (CATE). CATE is a specific causal question (estimand): What is the average treatment effect for the subgroup of people who share specific measured characteristics ?

Here, is the potential outcome with treatment, without. tells us the average effect specifically for people with characteristics . By looking at how changes for different , we quantify effect modification by the characteristics we measured in X.

Comparing Effects Across Defined Groups

A simple way to check for effect modification by a category (like comparing males vs females, or different locations) is to estimate the Average Treatment Effect (ATE) separately within each group. This is like comparing CATEs where is just the group variable .

Let's say is the treatment (0=control, 1=treated) and is the potential modifier (e.g., female, male).

We compare:

  1. The average effect for females ():
  2. The average effect for males ():

Effect modification by exists if these are different: .

If our estimate is far from zero, it suggests the treatment effect differs between males and females.

Finding Effect Modification in Data

To estimate these group-specific effects () and their difference () correctly, we need to control for confounders () of the relationship within each group defined by . Note that we are not estimating the causal effect of . As such, we do not need to control for things that cause itself, unless they also confound the relationship (i.e., are also in ).

Look at the following figure. To estimate the effect within levels of , we need to adjust for the confounders . However, this will partially block the effect-modification of on because is a mediator for that path. Moreover, if we were identifying the causal effect of on , after conditioning on , we would find that a backdoor path opens from because is a collider. does not have a causal interpretation in this model. However we would be wrong to think that is not an effect modifier of the effect of on . (See Appendix C.)

How shall we investigate effect modification of A on Y by G? Can you see the problem?

Thus it is essential to understand that when we control for confounding along the path, we do not identify the causal effects of effect-modifiers.

To clarify:

  1. If the statistical model correctly identifies causal effect modification (by appropriately handling confounders and avoiding collider bias), then it has prognostic value regarding the differential outcomes expected under intervention vs depending on .

  2. If the statistical model contains interaction terms that are artefacts of bias (like conditioning on a collider) or reflect a different target (like conditioning on a mediator when the total effect was intended), its causal prognostic value is compromised or needs careful interpretation. It might still predict well given , , and in an observational setting, but it wouldn't accurately predict the results of intervening on A differently for different groups. (See Appendix B.)

The choice of variables fundamentally determines which causal question (if any) the statistical model is estimating. As with the average treatment effect, we interpret evidence for effect modification in the context of our assumptions about the causal relationships that obtain in the world. This is because the statistical interaction we observe is highly sensitive to model choices. Any interpretation as causal effect modification, and therefore any reliable prognostic value for intervention effects within different segments of the population, depends entirely on whether and how our statistical model accounts for the causal structure.

Estimating How Effects Vary: Getting from Data

We defined the Conditional Average Treatment Effect (CATE), , as the true average effect for a subgroup with specific features :

Now, we want to estimate this from our actual data. We call our estimate . For any person in our study with features , the value is our data-based prediction of the average treatment effect for people like person i.

"Personalised" Effects vs. True Individual Effects

Wait: didn't we say we can't know the true effect for one specific person, ? Yes, that's still true.

So what does mean?

  • Individual Causal Effect (Unknowable): . This is the true effect for person . We can't observe both and .
  • Estimated CATE () (What we calculate): This is our estimate of the average effect, , for the subgroup of people who share the same measured characteristics as person .

When people talk about "personalised" or "individualised" treatment effects in this context, they usually mean . It's "personalised" because the prediction uses person 's specific characteristics . But remember, it's an estimated average effect for a group, not the unique effect for that single individual.

People Have Many Characteristics

People aren't just in one group; they have many features at once. A student might be:

  • Female
  • 21 years old
  • From a low-income family
  • Did well on previous tests
  • Goes to a rural school
  • Highly motivated

All these factors () together might influence how they respond to a new teaching method.

Trying to figure this out with traditional regression by manually adding interaction terms (like A*gender*age*income*...) becomes impossible very quickly:

  • Too many combinations, not enough data in each specific combo.
  • High risk of finding "effects" just by chance (false positives).
  • Hard to know which interactions to even include.
  • Can't easily discover unexpected patterns.

Thus, while simple linear regression with interaction terms (lm(Y ~ A * X1 + A * X2)) can estimate CATEs if the model is simple and correct, it often fails when things get complex (many variables, non-linear effects).

Causal forests (using the grf package in R; Athey, Tibshirani, and Wager, 2024) are a powerful, flexible alternative designed for this task. They build decision trees that specifically aim to find groups with different treatment effects.

Demo: Why Functional Form Matters (Even Without Confounding)

The following simulation makes this concrete. Treatment is randomised, so there is no confounding at all. The only question is whether each method can recover the true effect surface , which is deliberately non-linear (it includes sinusoidal, threshold, and interaction components that regression cannot capture).

# install once
# remotes::install_github("go-bayes/causalworkshop@v0.2.1")
library(causalworkshop)

# simulate data with non-linear heterogeneous effects
d <- simulate_nonlinear_data(n = 2000, seed = 2026)

# compare four estimation methods
results <- compare_ate_methods(d)

# summary table: ATE and individual-level RMSE
results$summary

# plot: predicted vs true treatment effects
results$plot_comparison

# plot: estimated effect as a function of x1
results$plot_by_x1

All four methods recover the correct ATE (because treatment is randomised, a simple difference in means suffices). The RMSE column tells a different story: it measures how well each method recovers the true effect for each individual. OLS with linear interactions compresses heterogeneity to a flat plane. Polynomial regression adds curvature but remains constrained by its parametric form. The GAM and causal forest learn the effect surface non-parametrically and achieve substantially lower RMSE.

The lesson: when treatment effects vary non-linearly across individuals, the functional form you assume determines whether you can detect that variation, even in a randomised experiment. Regression does not fail because of confounding here; it fails because it assumes a shape that the data do not follow.

We'll learn how to use grf after the mid-term break. It will allow us to get the predictions and then think about how to use them, for instance, to prioritise who gets a treatment if resources are limited.

Summary

Let's revisit the core concepts.

Interaction:

  • Think: Teamwork effect.
  • What: Effect of two or more different interventions ( and ) applied together.
  • Question: Is the joint effect different from the sum of individual effects?
  • Needs: Control confounders for all interventions involved ().

Effect Modification / HTE / CATE:

  • Think: Different effects for different groups.
  • What: Effect of a single intervention () varies depending on people's baseline characteristics ( or ).
  • Question (HTE): Does the effect vary? (The phenomenon.)
  • Question (CATE ): What is the average effect for a specific subgroup with features ? (The measure.)
  • Needs: Control confounders for the single intervention () within subgroups.

Estimated "Individualised" Treatment Effects ():

  • Think: Personal profile prediction.
  • What: Our estimate of the average treatment effect for the subgroup of people sharing characteristics .
  • How: Calculated using models (like causal forests) that use the person's full profile .
  • Important: This is not the true effect for that single person (which is unknowable). It's an average for people like them.
  • Use: Explore HTE, identify subgroups, potentially inform targeted treatment strategies.

Keeping these concepts distinct helps us ask clear research questions and choose the right methods.

Course Review So Far: A Quick Recap

Let's quickly review the main ideas of causal inference we've covered.

The Big Question: Does A cause Y?

Causal inference helps us answer if something (like a teaching method, ) causes a change in something else (like test scores, ).

Core Idea: "What If?" (Counterfactuals)

We compare what actually happened to what would have happened in a different scenario.

  • : Score if the student had received the new method.
  • : Score if the student had received the old method.

The Average Treatment Effect (ATE) = is the average difference across the whole group.

This Lecture Clarified Concepts of Interaction vs. Effect Modification vs. Individual Predictions

Interaction (Think: Teamwork Effects)

  • About: Combining two different interventions (A and B).
  • Question: Does using both A and B together give a result different from just adding up their separate effects? (e.g., new teaching method + tutoring).
  • Needs: Analyse effects of A alone, B alone, and A+B together. Control confounders for both A and B.

Effect Modification (Think: Different Effects for Different Groups)

  • About: How the effect of one intervention (A) changes based on people's characteristics (X, like prior grades).
  • Question: Does the teaching method (A) work better for high-achieving students (X=high) than low-achieving students (X=low)?
    • HTE: The idea that effects differ.
    • CATE : The average effect for the specific group with characteristics .
  • Needs: Analyse effect of A within different groups (levels of X). Control confounders for A.

Estimated Individualised Effects () (Think: Personal Profile Prediction)

  • About: Using a person's whole profile of characteristics (, age, gender, background, etc.) to predict their probable response to treatment A.
  • How: Modern methods (like causal forests) take all of and estimate .
  • Result: this is not the true unknowable effect for person . It is the estimated average effect for people similar to person i (sharing characteristics ).
  • Use: helps explore if tailoring treatment based on these profiles () could be beneficial.

Simple Summary

  • Interaction: Do A and B work together well/badly?
  • Effect Modification: Does A's effect depend on who you are (based on X)?
  • : Can we predict A's average effect for someone based on their specific profile ?

Understanding these differences is key to doing good causal research.


Lab materials: Lab 6: CATE and Effect Modification


Supplementary material

The appendices below contain formal derivations. They are included for completeness but are not required for the test. Focus on the main text above.

Appendix A: Simplification of Additive Interaction Formula

We start with the definition of additive interaction based on comparing the joint effect relative to baseline versus the sum of individual effects relative to baseline:

First, distribute the negative sign across the terms within the square brackets:

Now remove the parentheses, flipping the signs inside them where preceded by a minus sign:

Next, combine the terms:

  • We have
  • Then (these two cancel each other out)
  • And another remains.

The expression simplifies to:

This is the standard definition of additive interaction, often called the interaction contrast. If this expression equals zero, there is no additive interaction; a non-zero value indicates an interaction effect.

This shows clearly that interaction is the deviation of the joint effect from the sum of the separate effects, adjusted for the baseline.

Appendix B: Evidence for Effect-Modification is Relative to Inclusion of Other Variables in the Model

The 'sharp-null hypothesis' states there is no effect of the exposure on the outcome for any unit in the target population. Unless the sharp-null hypothesis is false, there may be effect-modification. For any study worth conducting, we cannot evaluate whether the sharp-null hypothesis is false. If we could, the experiment would be otiose. Therefore, we must assume the possibility of effect-modification. Whether a variable is an effect-modifier also depends on which other variables are included in the model. That is, just as for the concept of a 'confounder', where a variable is an 'effect-modifier' cannot be stated without reference to an assumed causal order and an explicit statement about which other variables will be included in the model (VanderWeele, 2012).

As illustrated in the following figure, the marginal association between and is unbiased. Here, exposure is unconditionally associated with . We use the convention that a solid blue box (e.g., ) denotes effect-modification with conditioning and a dashed blue circle (e.g., Z in a dashed circle) indicates effect-modification without conditioning.

Consider a randomised experiment. There is no confounding. The marginal association between A and Y provides an unbiased estimate for the causal effect of A on Y. G modifies A's effect on Y by proxy, in virtue of G's relationship to Z, which is a direct effect modifier for the effect of A on Y.

The next figure presents the same randomised experiment as in the previous causal diagram. We again assume that there is no confounding of the marginal association between the exposure, , and the outcome, . However, suppose we were to adjust for and ask: does the conditional association of on vary within levels of , after adjusting for ? That is, does remain an effect-modifier of the exposure on the outcome? VanderWeele (2007) proved that for effect-modification to occur, at least one other arrow besides the treatment must enter into the outcome. According to the diagram, the only arrow into other than arrives from . Because is independent of conditional on , we may infer that is no longer an effect modifier for the effect of on . Viewed another way, no longer co-varies with conditional on and so cannot act as an effect-modifier.

Conditioning on Z renders G independent of Y. G is no longer an effect modifier after conditioning on Z because G is independent of Y. Although Z is an unconditional effect modifier, G is not.

The following figure presents the same randomised experiment as in the previous graph. We assume a true effect of . If we do not condition on , then will not modify the effect of because will not be associated with . However, if we were to condition on , then both (an effect modifier by proxy) and may become effect-modifiers for the causal effect of on . In this setting, both and are conditional effect-modifiers.

Note that causal graphs help us to evaluate classifications of conditional and unconditional effect modifiers. They may also help to clarify conditions in which conditioning on unconditional effect-modifiers may remove conditional effect-modification. However, we cannot tell from a causal diagram whether the ancestors of an unconditional effect-modifier will be conditional effect-modifiers for the effect of the exposure on the outcome; see VanderWeele (2007), also Suzuki et al. (2013). Causal diagrams express non-parametric relations. I have adopted an off-label colouring convention to denote instances of effect-modification to highlight possible pathways for effect-modification, which may be relative to other variables in a model.

Blue path denotes effect-modification for G by conditioning on B. Both B and G are conditional effect modifiers.

The next figure reveals the relativity of effect-modification. If investigators do not condition on , then cannot be a conditional effect-modifier because would then be independent of because is a collider. However, as we observed in the previous figure, conditioning on (a collider) may open a path for effect-modification of by . Both and are conditional effect modifiers.

Blue path denotes effect-modification. Here G is not an effect modifier because B, a common effect (collider) of G and Z, is not conditioned on. Any conditional effect modification for G would require conditioning on B, and not conditioning on G. Otherwise G will be d-separated from Y.

The final figure considers the implications of conditioning on , which is the only unconditional effect-modifier on the graph. If is measured, conditioning on will remove effect-modification for and because . This example again reveals the context dependency of effect-modification. Here, causal diagrams are useful for clarifying features of dependent and independent effect modification. For further discussion, see Suzuki et al. (2013) and VanderWeele (2009).

Blue path denotes effect-modification. Neither G nor B are unconditional effect-modifiers for the effect of A on Y after Z is conditioned upon. If investigators condition on Z, the causal diagram implies they will not find evidence for effect-modification by B or G, which are conditionally independent of Y once Z is conditioned upon.

Appendix C: Further Clarification on Effect Modification Without Statistical Evidence for It

Again, look at the effect modification DAG from the seminar. Suppose the investigator models the effect of on . Suppose is not associated with conditional on . The DAG provides structural clarification for why concluding there is no effect modification by is incorrect.

To clarify:

  • We have a DAG structure: ; ,
  • We're interested in the conditional average treatment effect (CATE):
  • To identify the effect of on , we must condition on
  • is (partially or fully) d-separated from conditional on

Even though is d-separated from given , this doesn't mean can't modify the effect of on . The CATE for a specific value of can be expressed as:

Since is d-separated from given :

This means is a weighted average of the L-specific treatment effects, where the weights are determined by the distribution of L given .

If two conditions are met:

  1. The effect of on varies across levels of
  2. The distribution of varies with (which it does, since )

Then will vary with , indicating effect modification by .

The investigators would be wrong to equate d-separation with absence of effect modification. Although doesn't directly affect after conditioning on , can still modify the effect of on through its influence on the distribution of .