Tutorials › Causal Inference › Contrasting Regime-Specific Means and Effects

The G-Formula and Dynamic Regimes · Tutorial 718 of 972

Contrasting Regime-Specific Means and Effects

Define and calculate absolute, relative, and mean contrasts between longitudinal regimes using each regime’s identified outcome distribution.

Advanced 10 min read

What You'll Learn

  • Define regime-specific counterfactual outcome distributions, risks, and means.
  • State the assumptions that identify each regime-specific distribution from observed longitudinal data.
  • Compute risk differences and risk ratios from separately identified regime risks.
  • Compute mean differences from regime-specific outcome distributions.
  • Distinguish absolute contrasts, relative contrasts, and outcome summaries such as threshold risks.
  • Interpret effect direction, scale, units, and the risk-ratio denominator.

Why Contrast Regimes?

A longitudinal treatment regime specifies what treatment to give as a person’s observed history evolves. A useful causal question is not only what outcome distribution would arise under one regime, but how that distribution differs from the one under a second regime. For a binary outcome, common comparisons are the risk difference and risk ratio. For an outcome measured on a numerical scale, a common comparison is the mean difference.

These contrasts are calculated from two regime-specific counterfactual distributions. Each distribution describes outcomes in the target population under one regime; the contrast then compares corresponding summaries of those distributions. Keeping those steps separate matters: a contrast is not calculated by comparing people who happened to receive different treatments at each time.

Definition: Let \(Y^d\) be the outcome that would be observed under regime \(d\), and let \(F_d(y)=P(Y^d\leq y)\) be its population distribution. For a binary outcome coded 1 when the event occurs, the regime-specific risk is \(\psi_d=P(Y^d=1)\). If \(Y^d\) has a finite expectation, its regime-specific mean is \(\mu_d=E[Y^d]\). For regimes \(d_1\) and \(d_0\), the risk difference is \(\psi_{d_1}-\psi_{d_0}\), the risk ratio is \(\psi_{d_1}/\psi_{d_0}\), and the mean difference is \(\mu_{d_1}-\mu_{d_0}\). The order of the regimes is part of the definition: each contrast is the summary under \(d_1\) minus or divided by the corresponding summary under \(d_0\).

From Regime-Specific Distributions to Causal Contrasts

In a longitudinal setting, let \(L_t\) denote covariates measured before treatment \(A_t\), for times \(t=0,\ldots,K\), and let \(Y\) be the outcome measured after the final treatment. A regime \(d\) assigns \(A_t=d_t(\bar L_t,\bar A_{t-1})\) at each time using the history available then. Here, an overbar denotes the history through the indicated time. The potential outcome \(Y^d\) refers to the outcome that would result if the person followed that regime.

The causal interpretation of a contrast requires identification of the regime-specific distributions from observed data. The relevant assumptions are consistency (observed outcomes under a person’s followed regime equal that regime’s potential outcomes), sequential exchangeability (at each time, treatment assignment is independent of the future counterfactual outcomes of interest conditional on the measured treatment and covariate history), and positivity (each treatment value required by a regime has positive probability at histories occurring under that regime). The interventions must also be well-defined, and interference between individuals is assumed absent. These conditions allow the longitudinal g-formula to identify each regime distribution; without them, the calculations below describe contrasts in identified distributions only if identification is otherwise justified.

For discrete covariate histories and outcome values, the g-formula identifies the distribution under regime \(d\) by summing over the covariate histories. Writing \(\bar d(\bar l)\) for the treatment history generated recursively by applying \(d\) to covariate history \(\bar l\), the formula is:

$$ P(Y^d=y) = \sum_{\bar l_K} P\!\left(Y=y\mid \bar L_K=\bar l_K,\ \bar A_K=\bar d(\bar l_K)\right) \prod_{t=0}^{K} P\!\left(L_t=l_t\mid \bar L_{t-1}=\bar l_{t-1},\ \bar A_{t-1}=\bar d_{t-1}(\bar l_{t-1})\right), $$

For \(t=0\), the factor for \(L_0\) is its baseline distribution. For continuous covariates, the sum is replaced by integration. This formula produces one distribution for each regime. The risk or mean is then computed from that distribution, and the requested contrast compares the two resulting summaries.

Risk Differences and Risk Ratios

For a binary outcome, \(\psi_d=P(Y^d=1)\) is the probability of the event in the target population under regime \(d\). The risk difference compares event probabilities on an absolute scale. It is expressed in probability units, often reported as a percentage-point difference. The risk ratio compares them on a relative scale and is dimensionless.

$$ \mathrm{RD}_{d_1,d_0}=\psi_{d_1}-\psi_{d_0}, \qquad \mathrm{RR}_{d_1,d_0}=\frac{\psi_{d_1}}{\psi_{d_0}}. $$

A negative risk difference means the event risk is lower under \(d_1\) than under \(d_0\); a risk ratio below 1 gives the same direction when the denominator is positive. The risk ratio is undefined if \(\psi_{d_0}=0\). Even when defined, it can be unstable if the comparator risk is very small, so it is important to report the underlying risks as well as the ratio.

Worked Example: Comparing Risks Across Two Regimes

Consider a hypothetical target population divided into two baseline risk groups: 40% are in group 1 and 60% in group 2. Suppose the separately identified risks of an adverse event by the end of follow-up are as follows. Regime \(d_1\) is a hypothetical adaptive treatment policy; regime \(d_0\) is a hypothetical alternative policy. The conditional risks in this example are g-formula quantities under the stated regimes, not crude risks among observed treatment groups.

Baseline groupPopulation proportionRisk under \(d_1\)Risk under \(d_0\)
10.400.100.18
20.600.140.22

Standardize each regime’s risks over the same target population. Under \(d_1\), the event risk is

$$ \psi_{d_1}=(0.40)(0.10)+(0.60)(0.14)=0.040+0.084=0.124. $$

Under \(d_0\), it is

$$ \psi_{d_0}=(0.40)(0.18)+(0.60)(0.22)=0.072+0.132=0.204. $$

The risk difference, in the stated order, is \(0.124-0.204=-0.080\), or 8.0 percentage points lower under \(d_1\). The risk ratio is

$$ \mathrm{RR}_{d_1,d_0}=\frac{0.124}{0.204}=0.6078. $$

Thus the hypothetical event risk under \(d_1\) is about 0.608 times the risk under \(d_0\), or about 39.2% lower on a relative scale because \(1-0.6078=0.3922\). Both calculations use the same separately identified marginal risks. The strata are weighted using the same target-population proportions under each regime, as required for this comparison.

Mean Differences

When the outcome is quantitative, the mean difference compares the expected outcome under each regime. Its units are the units of \(Y\), such as days, millimeters of mercury, or dollars. It is not a ratio and should not be interpreted as a percentage change unless an additional, explicitly defined calculation supports that interpretation.

$$ \mathrm{MD}_{d_1,d_0} = E[Y^{d_1}]-E[Y^{d_0}] = \int y\,dF_{d_1}(y)-\int y\,dF_{d_0}(y). $$

For a discrete outcome, each expectation is the sum of outcome values multiplied by their probabilities. For a continuous outcome, the expectation is the corresponding integral. The two distributions need not have the same shape; the mean difference compares their averages, not every feature of their distributions.

Worked Example: Mean Difference in Follow-Up Days

Suppose a hypothetical analysis identifies the following distributions for the number of hospital days under two regimes. Each distribution sums to 1, so it describes the outcome for the full target population under that regime.

Hospital days \(y\)\(P(Y^{d_1}=y)\)\(P(Y^{d_0}=y)\)
00.200.10
50.500.40
100.300.50

The mean number of hospital days under \(d_1\) is

$$ \mu_{d_1}=(0)(0.20)+(5)(0.50)+(10)(0.30)=0+2.5+3=5.5\text{ days}. $$

Under \(d_0\), the mean is

$$ \mu_{d_0}=(0)(0.10)+(5)(0.40)+(10)(0.50)=0+2+5=7.0\text{ days}. $$

Therefore,

$$ \mathrm{MD}_{d_1,d_0}=5.5-7.0=-1.5\text{ days}. $$

Under these hypothetical identified distributions, the average number of hospital days is 1.5 days lower under \(d_1\) than under \(d_0\). This mean contrast does not imply that every individual would have 1.5 fewer hospital days under \(d_1\); it is a difference between population averages.

One Distribution, Different Contrasts

A regime-specific distribution can answer several distinct questions. For example, a numerical outcome’s mean describes its average value, while the risk of exceeding a threshold describes the probability of a particular event. These summaries use the same distribution but target different features of it. Selecting a contrast should therefore follow the substantive question and the outcome’s scale.

Worked Example: Mean and Threshold Risk for Symptom Days

Suppose a hypothetical outcome is the number of symptom days during a fixed follow-up, which can be 0, 1, 2, or 3. The separately identified regime-specific distributions are:

Symptom days \(y\)\(P(Y^{d_1}=y)\)\(P(Y^{d_0}=y)\)
00.200.10
10.400.30
20.300.35
30.100.25

The regime-specific means are

$$ \mu_{d_1}=(0)(0.20)+(1)(0.40)+(2)(0.30)+(3)(0.10)=1.30\text{ days}, $$

and

$$ \mu_{d_0}=(0)(0.10)+(1)(0.30)+(2)(0.35)+(3)(0.25)=1.75\text{ days}. $$

The mean difference is \(1.30-1.75=-0.45\) symptom days. Now define a binary event as having at least 2 symptom days. Its risk under \(d_1\) is \(0.30+0.10=0.40\), and its risk under \(d_0\) is \(0.35+0.25=0.60\). Thus the threshold risk difference is \(0.40-0.60=-0.20\), or 20 percentage points lower, and the threshold risk ratio is \(0.40/0.60=0.667\). The mean difference and threshold-risk contrasts are both valid summaries, but they are not interchangeable: one compares average symptom days and the others compare the probability of reaching a particular threshold.

A Useful Identity for Binary Outcomes

If \(Y\) is coded as 1 for an event and 0 otherwise, then for each regime \(d\), \(Y^d\) is also an indicator. An indicator’s expectation equals its probability of being 1:

$$ E[Y^d] = (1)P(Y^d=1)+(0)P(Y^d=0) = P(Y^d=1) = \psi_d. $$

Consequently, for a binary outcome the mean difference is exactly the risk difference:

$$ E[Y^{d_1}]-E[Y^{d_0}] = \psi_{d_1}-\psi_{d_0} = \mathrm{RD}_{d_1,d_0}. $$

The risk ratio remains a different contrast, since it divides the risks rather than subtracting them. This identity also explains why coding an event as 1 and no event as 0 makes its mean equal to its event risk.

Common Pitfall: Mixing Up Absolute and Relative Comparisons

A risk ratio of 0.60 does not mean the risk is 60 percentage points lower. It means the risk under the numerator regime is 60% of the risk under the denominator regime, or 40% lower relative to that denominator risk. The absolute change depends on the risks themselves: a ratio of 0.60 corresponds to a risk difference of \(-0.02\) if the comparator risk is 0.05, but \(-0.20\) if it is 0.50.

A related mistake is to compare observed outcomes among people who received each treatment and call that comparison a regime effect. Those people may have different histories and may not represent the same target population. First identify each regime-specific outcome distribution under the relevant longitudinal assumptions; then calculate the selected contrast from those two distributions. Finally, keep the contrast’s ordering, scale, and units explicit.

Key takeaway: Identify the outcome distribution under each regime separately, summarize each distribution on the scale relevant to the question, and only then contrast the summaries. Risk differences are absolute changes in event probability, risk ratios are relative comparisons, and mean differences are changes in expected outcome units.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. If the risks under \(d_1\) and \(d_0\) are 0.15 and 0.25, respectively, calculate the risk difference and risk ratio in the stated order and interpret both.
  2. Why must the risk ratio’s denominator be stated, and what happens to the ratio if the denominator risk is zero?
  3. For a discrete outcome with values 0 and 4 days and probabilities 0.75 and 0.25 under one regime, calculate the regime-specific mean.
  4. Explain why a mean difference of \(-2\) days does not imply that each person has two fewer days under the first regime.
  5. For a binary outcome coded 0 or 1, show why the regime-specific mean equals the regime-specific risk. Which contrast does the mean difference then equal?
  6. Describe why calculating a contrast from separately identified regime distributions differs from comparing observed outcomes among people who received different treatments.
Clinical Biostats