Tutorials › Causal Inference › Threshold-Based Dynamic Treatment Rules

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

Threshold-Based Dynamic Treatment Rules

Translate a covariate threshold into treatment paths, then calculate the mean outcome that would result under the rule.

Advanced 10 min read

What You'll Learn

  • Define a dynamic treatment rule using a measured covariate threshold.
  • Trace the treatment path specified by a rule for different histories.
  • Distinguish a history-dependent rule from a fixed treatment sequence.
  • Calculate a regime-specific counterfactual mean using the longitudinal g-formula.
  • Integrate a continuous covariate distribution across a treatment threshold.
  • Identify the assumptions needed to interpret the calculation causally.

From a Threshold to a Treatment Path

A dynamic treatment rule makes treatment depend on information observed as follow-up proceeds. For example, a policy might assign treatment at a visit when a laboratory measurement is at least a specified threshold, and withhold it otherwise. The rule is not one fixed sequence of treatments for everyone: different measured histories can lead to different paths, and treatment at an earlier visit can affect the covariates that determine later assignments.

Consider two treatment times. Let \(L_1\) be a covariate measured before treatment \(A_1\), and let \(L_2\) be measured after \(A_1\) but before treatment \(A_2\). A history available at the first decision includes \(L_1\); the second decision can use \(L_1,A_1,L_2\). A threshold rule can use only the current covariate, or it can also depend on other recorded parts of the history.

Definition: A dynamic treatment rule is a set of functions \(d=(d_1,d_2,\ldots,d_K)\) that assign treatment at each decision time from the history available just before that decision. For a binary treatment, \(d_t(H_t)\) takes values 0 or 1, where \(H_t\) denotes that pre-treatment history. A threshold rule using a measured covariate \(L_t\) has the form \(d_t(H_t)=I(L_t\geq c_t)\), where \(c_t\) is the specified threshold and \(I(\cdot)\) equals 1 when its condition is true and 0 otherwise.

For instance, if \(c_1=c_2=5\), the rule assigns \(A_1=1\) when \(L_1\geq5\), and assigns \(A_2=1\) when \(L_2\geq5\). The second assignment uses a covariate measured after the first treatment. Thus, although the same threshold is used at each time, the rule is adaptive: the distribution of \(L_2\), and consequently the second treatment, can depend on \(A_1\).

Worked Example: Tracing Paths Under a Threshold Rule

Suppose treatment is binary and the hypothetical rule is \(A_t=1\) if the measured covariate at visit \(t\) is at least 5, and \(A_t=0\) otherwise. For a two-visit sequence, identify the treatment path for each listed history.

\(L_1\)\(L_2\)Rule assignment \(A_1\)Rule assignment \(A_2\)Path \((A_1,A_2)\)
3.24.100(0, 0)
3.25.801(0, 1)
6.44.110(1, 0)
6.45.811(1, 1)

For the first history, \(L_1=3.2<5\), so the first assignment is 0; \(L_2=4.1<5\), so the second assignment is also 0. For the second, the first assignment remains 0 but \(L_2=5.8\geq5\), making the path \((0,1)\). The same reasoning gives \((1,0)\) and \((1,1)\) for the final two histories. These are rule-specified paths for the stated histories, not claims that every path has equal probability under the rule.

The table also shows why this is not equivalent to prescribing treatment 1 at both visits or treatment 0 at both visits. The rule selects a treatment separately at each decision, using the covariate available then.

The Counterfactual Mean Under the Rule

Let \(Y^d\) denote the outcome that would be observed if each person followed rule \(d\) throughout follow-up. The quantity of interest in this tutorial is the rule-specific counterfactual mean \(E[Y^d]\). To calculate it, average the outcome over the histories that would arise under the rule, rather than over histories generated under an unrelated treatment pattern.

For two treatment times, write the observed-data distributions as \(f(L_1)\), \(f(L_2\mid L_1,A_1)\), and the conditional outcome mean \(E(Y\mid L_1,A_1,L_2,A_2)\). When the conditions for the longitudinal g-formula hold, the rule-specific mean is obtained by setting each treatment in these conditional distributions to the value prescribed by the rule:

$$ E[Y^d] = \int E\!\left[Y\mid L_1,d_1(L_1),L_2,d_2(L_1,d_1(L_1),L_2)\right]\, f\!\left(L_2\mid L_1,d_1(L_1)\right) f(L_1)\,dL_2\,dL_1. $$

For discrete covariates, the integrals are replaced by sums. The rule is applied inside the expression: it determines the first treatment, which determines the treatment-conditioned distribution used for the next covariate, and then determines the second treatment. With a continuous \(L_2\), histories on both sides of its threshold contribute to the mean, weighted by their probabilities under the distribution induced by the first rule assignment.

Conditions for a causal interpretation: Consistency means that an individual's observed outcome agrees with the counterfactual outcome for the treatment path that individual actually follows. Sequential exchangeability requires that, conditional on the measured pre-treatment history at each decision, treatment assignment is independent of the relevant future counterfactual outcomes. Positivity requires a positive probability of receiving the rule-prescribed treatment at histories that can arise under the rule. These conditions, together with appropriate handling of censoring and no interference between individuals, allow the observed conditional distributions in the g-formula to identify \(E[Y^d]\). They do not guarantee that a chosen statistical model for those distributions is correctly specified.

Calculating a Mean With Discrete Histories

Worked Example: A Two-Visit Threshold Rule

Suppose a hypothetical study has a low or high covariate at each of two pre-treatment visits. At visit 1, the rule assigns \(A_1=1\) for a high \(L_1\) and \(A_1=0\) for a low \(L_1\). At visit 2 it assigns \(A_2=1\) for a high \(L_2\) and \(A_2=0\) for a low \(L_2\). Assume \(P(L_1=\text{low})=0.60\) and \(P(L_1=\text{high})=0.40\). Under the rule's first-stage assignments, suppose the probability that \(L_2\) is high is 0.25 for the low-\(L_1\) group and 0.60 for the high-\(L_1\) group.

Assume the following hypothetical conditional mean outcomes, measured in symptom-score points. The means apply to the histories and treatments specified by the rule.

\(L_1\)\(A_1\)\(L_2\)\(A_2\)Conditional mean outcome
Low0Low010 points
Low0High116 points
High1Low018 points
High1High124 points

First average over \(L_2\) within each \(L_1\) group, using the group-specific probability of high \(L_2\). In the low-\(L_1\) group, the high-\(L_2\) probability is 0.25, so the low-\(L_2\) probability is \(1-0.25=0.75\). The group's rule-specific mean is

$$ (0.75)(10)+(0.25)(16)=7.50+4.00=11.50\text{ points}. $$

In the high-\(L_1\) group, the high-\(L_2\) probability is 0.60 and the low-\(L_2\) probability is \(1-0.60=0.40\). Its rule-specific mean is

$$ (0.40)(18)+(0.60)(24)=7.20+14.40=21.60\text{ points}. $$

Finally, average these two conditional means over the baseline distribution of \(L_1\):

$$ E[Y^d]=(0.60)(11.50)+(0.40)(21.60) =6.90+8.64=15.54\text{ points}. $$

Under the stated assumptions and distributions, the estimated rule-specific mean is 15.54 symptom-score points. The calculation weights each later history by its probability under the rule's earlier treatment, then weights the resulting means by the baseline covariate distribution.

Integrating Across a Continuous Threshold

When the covariate is continuous, a threshold divides its distribution into regions assigned different treatments. The probability in each region matters: the rule-specific mean averages over all possible covariate values, not just values equal to the threshold. For a normally distributed covariate, a threshold probability can be calculated from the standard normal cumulative distribution function \(\Phi\).

Worked Example: A Continuous Covariate at the Second Decision

Consider a hypothetical two-visit setting. At the first visit, \(L_1\) is low for 60% of the population and high for 40%; the threshold rule therefore sets \(A_1=0\) in the low group and \(A_1=1\) in the high group. Conditional on these rule-assigned first treatments, suppose \(L_2\) follows the distributions below. At the second visit, the rule sets \(A_2=1\) when \(L_2\geq0.5\), and \(A_2=0\) otherwise. Assume the conditional mean outcome is \(10+2A_1+3A_2+0.5L_2\) points.

\(L_1\) groupProbability of groupRule-set \(A_1\)Distribution of \(L_2\)
Low0.600\(N(0,1)\)
High0.401\(N(1,1)\)

Here the second argument of \(N(\mu,\sigma^2)\) is the variance, so both distributions have standard deviation 1. For \(L_2\sim N(0,1)\), the standardized threshold is \(z=(0.5-0)/1=0.5\). Thus,

$$ P(L_2\geq0.5\mid L_1=\text{low},A_1=0) =1-\Phi(0.5)=1-0.6915=0.3085. $$

For the high-\(L_1\) group, \(L_2\sim N(1,1)\), so the standardized threshold is \(z=(0.5-1)/1=-0.5\). By symmetry of the standard normal distribution, \(1-\Phi(-0.5)=\Phi(0.5)=0.6915\). The rule therefore assigns the second treatment more often in the high group, according to these stipulated distributions.

Within the low group, \(E[L_2]=0\), \(A_1=0\), and the probability that \(A_2=1\) is 0.3085. Averaging the conditional outcome mean gives

$$ 10+2(0)+3(0.3085)+0.5(0) =10+0.9255=10.9255\text{ points}. $$

Within the high group, \(E[L_2]=1\), \(A_1=1\), and the probability that \(A_2=1\) is 0.6915. Its mean is

$$ 10+2(1)+3(0.6915)+0.5(1) =12+2.0745+0.5=14.5745\text{ points}. $$

Averaging across the two \(L_1\) groups gives

$$ E[Y^d]=(0.60)(10.9255)+(0.40)(14.5745) =6.5553+5.8298=12.3851\text{ points}. $$

The counterfactual mean under this rule is approximately 12.39 points. The calculation integrates over the continuous \(L_2\) distribution by using the probability above the threshold for the \(A_2\) term and the distributional mean for the \(L_2\) term. It does not replace all covariate values by a single representative value.

A Short Justification of the Substitution

The g-formula for a dynamic rule follows by averaging over the covariate histories that would occur while following that rule. For two decision times, first condition the counterfactual outcome on \(L_1\) and \(L_2\). Under the rule, the first treatment is \(d_1(L_1)\), and the second treatment is the value prescribed for the resulting history. Iterated expectation then averages the conditional outcome mean over the rule-induced distribution of \(L_2\), and over the distribution of \(L_1\):

$$ E[Y^d] = \int E[Y^d\mid L_1,L_2] f^d(L_2\mid L_1) f(L_1)\,dL_2\,dL_1. $$

Consistency and sequential exchangeability identify the conditional outcome mean for each rule-compatible history with the corresponding observed conditional mean. Sequential exchangeability also permits the covariate distribution after the first rule assignment to be represented by the observed distribution conditional on that assignment. Therefore,

$$ f^d(L_2\mid L_1)=f(L_2\mid L_1,A_1=d_1(L_1)), $$

and the conditional outcome mean is evaluated at \(A_1=d_1(L_1)\) and \(A_2=d_2(L_1,d_1(L_1),L_2)\). Substituting these terms yields the displayed longitudinal g-formula. Positivity is needed so the observed data include support for the rule-prescribed treatment at histories contributing to this average. The formula is an identification result; with estimated distributions, the numerical answer also depends on the adequacy of the estimation procedure.

Common Pitfall: Treating the Threshold as a Fixed Regimen

A common error is to translate “treat when the covariate is above 5” into a single fixed path, such as \((1,1)\), and then average outcomes for people observed to have received that path. That reasoning ignores both people whose covariate falls below the threshold and the fact that the second covariate may be affected by the first treatment. It also conditions on observed treatment histories rather than reconstructing the histories that would arise under the rule.

The correction is to apply the rule at each decision in sequence. First set \(A_1=d_1(L_1)\); then use the covariate distribution conditional on that assigned first treatment; next set \(A_2=d_2(H_2)\); and finally average the outcome mean over all rule-generated histories. This is why a threshold-based rule is evaluated with the g-formula rather than by selecting one observed treatment sequence.

Key takeaway: A threshold rule specifies an assignment at each treatment time for every eligible history. Its counterfactual mean averages outcome predictions over the covariate histories induced by those assignments, with each history weighted by its probability under the rule.

Check Your Understanding

Use the definitions and calculations above to answer the following questions.

  1. Under the rule \(A_t=I(L_t\geq4)\), what is the two-visit treatment path when \(L_1=3.5\) and \(L_2=4.2\)?
  2. Why can the distribution of \(L_2\) under a dynamic rule depend on the rule's first treatment assignment?
  3. In the discrete worked example, what probability was used for the low-\(L_2\) history in the high-\(L_1\) group, and how was it obtained?
  4. For \(L_2\sim N(2,1)\) with a treatment threshold of 3, express the probability of second-stage treatment using \(\Phi\).
  5. Name two assumptions needed to interpret the g-formula mean as the counterfactual mean under the rule, and state briefly what each requires.
Clinical Biostats