Tutorials › Marginal Structural Models › G-Estimation With Known and Estimated Propensities

Structural Nested Models and g-Estimation · Tutorial 336 of 501

G-Estimation With Known and Estimated Propensities

Learn how known and estimated treatment probabilities enter g-estimating equations, when plugging in fitted probabilities is justified, and what to check in practice.

Advanced 12 min read

What You'll Learn

  • Write a treatment-residual g-estimating equation for a single treatment decision.
  • Explain why the moment condition holds at the true blip parameter.
  • Distinguish known treatment probabilities from probabilities estimated using treatment-history models.
  • Work through g-estimation calculations with known, saturated, and externally fitted propensities.
  • State conditions under which plugging in estimated probabilities preserves consistency.
  • Identify practical checks and common errors in treatment-model implementation.

Why the treatment probability enters g-estimation

In g-estimation, the outcome is transformed at a candidate blip parameter to remove the treatment effect represented by the structural nested mean model. At the true parameter, the resulting blipped-down outcome should no longer carry an association with treatment after conditioning on the treatment history. A treatment residual, formed by subtracting the conditional treatment probability from the observed treatment, provides an instrument for expressing that condition as a moment equation.

This tutorial focuses on the role of that probability in implementation. It may be known from the treatment-assignment mechanism, as in a randomized study, or estimated from a model for treatment given its observed history. Estimating it does not change the target moment, but it introduces a treatment-model assumption and makes the fitted probabilities part of the estimating procedure.

Set-up and moment condition

First consider one treatment decision. Let \(H\) denote the observed history measured before treatment \(A\), with \(A\) binary, and let \(Y\) be the outcome. Write \(p_0(H)=P(A=1\mid H)\) for the true treatment probability. For a candidate scalar blip parameter \(\psi\), write \(U(\psi)\) for the outcome blipped down under that candidate. For example, under the additive model \(E[Y\mid A,H]=m(H)+\psi A\), the blipped-down outcome is \(U(\psi)=Y-\psi A\).

Definition: Given a history function \(q(H)\), a treatment-residual g-estimating equation is the sample analogue of $$ E\left[(A-p_0(H))q(H)U(\psi)\right]=0. $$ The function \(q(H)\) is determined before treatment and is chosen to provide information about \(\psi\). For a vector of functions, this is a vector of moment conditions.

The treatment-residual moment is different from an inverse-probability weighted estimating equation: its basic instrument is \(A-p_0(H)\), not a weight such as \(1/p_0(H)\). The earlier material on Treatment-Residual Instruments for G-Estimation develops the instrument idea; here the key question is whether \(p_0\) is known or estimated.

Assumptions for the moment condition: Assume consistency, no interference, and conditional exchangeability for the blipped-down outcome at the true parameter \(\psi_0\): \(A\) is conditionally independent of \(U(\psi_0)\) given \(H\). Assume \(p_0(H)=P(A=1\mid H)\), and that \(q(H)U(\psi_0)\) is integrable. Then the population moment is zero. For causal identification and useful estimation, treatment overlap and sufficient variation in the resulting moments are also needed; a zero moment alone does not ensure that \(\psi_0\) is uniquely identified.

For longitudinal treatment, the same construction is used at decision time \(t\). Let \(H_t\) be the history available just before \(A_t\), \(p_t(H_t)=P(A_t=1\mid H_t)\), and \(U_{t+1}(\psi)\) the outcome blipped down through the relevant treatment decisions. Under the corresponding sequential exchangeability condition at the true parameter, a decision-specific moment is

$$ E\left[\{A_t-p_t(H_t)\}q_t(H_t)U_{t+1}(\psi_0)\right]=0. $$

The history used to model treatment must be measured before that treatment decision. It can include past treatment and time-varying covariates observed before \(A_t\), but not later covariates or outcomes.

Known probabilities: the direct calculation

If the assignment probability is known by design, use that probability directly in the residual. For a single moment with \(q(H)=1\) and \(U(\psi)=Y-\psi A\), the empirical equation is

$$ \sum_{i=1}^n \{A_i-p_0(H_i)\}(Y_i-\psi A_i)=0. $$

Provided the denominator is nonzero, solving gives

$$ \hat\psi= \frac{\sum_{i=1}^n\{A_i-p_0(H_i)\}Y_i} {\sum_{i=1}^n\{A_i-p_0(H_i)\}A_i}. $$

Worked Example: A Known Randomization Probability

Suppose four participants have the following histories, known treatment probabilities, assignments, and outcomes. Use the additive blip \(U(\psi)=Y-\psi A\) and \(q(H)=1\).

Participant\(H\)\(p_0(H)\)\(A\)\(Y\)
100.2518
200.2502
310.75111
410.7504

The four treatment residuals \(A-p_0(H)\) are \(0.75,-0.25,0.25,-0.75\). The numerator of the solution is \(0.75(8)-0.25(2)+0.25(11)-0.75(4)=6-0.5+2.75-3=5.25\). The denominator is \(0.75(1)-0.25(0)+0.25(1)-0.75(0)=1\). Thus the empirical root is \(\hat\psi=5.25/1=5.25\). This is the root of this sample equation, not by itself evidence that the causal assumptions or blip model hold.

Estimated probabilities: fitting and plugging in

When assignment probabilities are not known, specify a treatment-history model \(p_\alpha(H)=P(A=1\mid H;\alpha)\) and estimate its parameter \(\alpha\), for example by maximum likelihood. The plug-in estimating equation replaces each known probability by its fitted value:

$$ \sum_{i=1}^n \{A_i-\hat p(H_i)\}q(H_i)U_i(\psi)=0, \qquad \hat p(H_i)=p_{\hat\alpha}(H_i). $$

The procedure has two distinct requirements. The treatment model must adequately represent the conditional probability of treatment given the chosen history, and the blip-down moment must be valid under the causal assumptions. Fitting a treatment model does not establish exchangeability, and a well-fitting propensity model cannot repair an incorrect blip function.

Worked Example: Estimated Probabilities From a Saturated History Model

Suppose a binary history \(H\) defines two strata. Estimate the treatment probability in each stratum by its observed treatment proportion. For \(H=0\), there are two treated outcomes, 8 and 10, and two untreated outcomes, 2 and 4. Thus \(\hat p(0)=2/4=0.5\). For \(H=1\), the three treated outcomes are 10, 12, and 14, and the one untreated outcome is 5. Thus \(\hat p(1)=3/4=0.75\). Use \(q(H)=1\) and \(U(\psi)=Y-\psi A\).

For \(H=0\), the treated residuals are \(1-0.5=0.5\), and the untreated residuals are \(0-0.5=-0.5\). The numerator contribution is \(0.5(8+10)-0.5(2+4)=9-3=6\); the denominator contribution is \(0.5(1+1)=1\). For \(H=1\), the corresponding contributions are \(0.25(10+12+14)-0.75(5)=9-3.75=5.25\) and \(0.25(1+1+1)=0.75\). The combined equation therefore has numerator \(6+5.25=11.25\), denominator \(1+0.75=1.75\), and root \(\hat\psi=11.25/1.75\approx6.43\).

The estimated probabilities are part of this calculation: the equation is not the one that would result from substituting externally known probabilities. With sparse histories, saturated stratum estimates may be 0 or 1, leaving no within-stratum treatment contrast.

Worked Example: Plugging In a Fitted Logistic Model

Suppose a treatment-history logistic model has been fitted using an appropriate training sample and returns \(\hat\alpha=0\) and \(\hat\beta=\log(3)\) in \(\operatorname{logit}\{p_\alpha(x)\}=\alpha+\beta x\). In a sample used for the g-estimating equation, three participants have \(x=-1,0,1\), assignments \(A=1,0,1\), and outcomes \(Y=6,2,10\). Their fitted probabilities are \(1/4,1/2,3/4\), since the fitted odds are \(1/3,1,3\), respectively.

For \(q=1\), the residuals are \(3/4,-1/2,1/4\). The numerator is \((3/4)(6)-(1/2)(2)+(1/4)(10)=4.5-1+2.5=6\). The denominator is \((3/4)(1)-(1/2)(0)+(1/4)(1)=1\), giving \(\hat\psi=6\). In an ordinary same-sample analysis, the logistic coefficients would be estimated from that analysis sample rather than supplied from a training sample; the fitted values must still be calculated from a model using only pre-treatment history.

Why plug-in estimation can work

Theorem: Let \(\Psi\) be a compact parameter space containing \(\psi_0\). Suppose the observations are independent and identically distributed; \(p_\alpha(H)\) is correctly specified with true parameter \(\alpha_0\); and \(\hat\alpha\xrightarrow{p}\alpha_0\). Suppose the moment function \(m(O;\psi,\alpha)=\{A-p_\alpha(H)\}q(H)U(\psi)\) is continuous in \((\psi,\alpha)\), has an integrable envelope, and satisfies the uniform law of large numbers on \(\Psi\) in a neighborhood of \(\alpha_0\). If \(E[m(O;\psi,\alpha_0)]=0\) only at \(\psi_0\) in \(\Psi\), then any consistent-root selection \(\hat\psi\) solving the sample plug-in equation satisfies \(\hat\psi\xrightarrow{p}\psi_0\).

Proof. Define \(M(\psi,\alpha)=E[m(O;\psi,\alpha)]\) and \(M_n(\psi,\alpha)=n^{-1}\sum_{i=1}^n m(O_i;\psi,\alpha)\). The uniform law of large numbers and consistency of \(\hat\alpha\) imply \(\sup_{\psi\in\Psi}|M_n(\psi,\hat\alpha)-M(\psi,\alpha_0)|\xrightarrow{p}0\). For any fixed neighborhood of \(\psi_0\), compactness and continuity, together with the unique-zero condition, make \(|M(\psi,\alpha_0)|\) bounded away from zero on the part of \(\Psi\) outside that neighborhood. With probability tending to one, the uniform sample-moment error is smaller than half that bound. A root of \(M_n(\psi,\hat\alpha)=0\) therefore cannot lie outside the neighborhood. Since this holds for every neighborhood of \(\psi_0\), \(\hat\psi\xrightarrow{p}\psi_0\). \(\square\)

This consistency result does not say that estimating the probability has no effect on uncertainty. The fitted treatment model contributes sampling variation, and its estimation can affect the large-sample variance. That variance calculation is a separate task. The result also depends on identification: if different values of \(\psi\) yield the same population moments, consistency for a unique parameter does not follow.

Result: At the true parameter, if \(A\) is conditionally independent of \(U(\psi_0)\) given \(H\), then $$ E\left[\{A-p_0(H)\}q(H)U(\psi_0)\right]=0 $$ whenever the product is integrable.

Proof. Conditional on \(H\), \(p_0(H)\) and \(q(H)\) are fixed. Conditional independence gives \(E[A U(\psi_0)\mid H]=E[A\mid H]E[U(\psi_0)\mid H]=p_0(H)E[U(\psi_0)\mid H]\). Consequently, \(E[(A-p_0(H))U(\psi_0)\mid H]=0\). Multiplication by \(q(H)\), followed by iterated expectation, yields the stated moment. \(\square\)

Implementation checks, alternatives, and limitations

Known probabilities are preferable when they genuinely are known, such as probabilities fixed by randomization. They avoid estimating a treatment model. In observational data, a fitted treatment-history model can make adjustment for measured confounding explicit, but its validity depends on correct specification and on having measured the relevant confounders. Neither option addresses unmeasured confounding by itself.

Before solving the equation, check that every variable in the treatment model was measured before the corresponding treatment, that probabilities are finite and plausible across histories, and that treatment variation remains where the moment uses it. Inspect the treatment model's calibration and the distribution of fitted probabilities. Extreme fitted probabilities or strata with only treated or only untreated participants signal weak overlap and can make the estimating equation unstable or uninformative. Also check that the numerical solver finds a root of the stated equation and that the root is in the allowed parameter space.

  • Using the wrong probability. The residual is \(A-p(H)\) for the conditional probability at that treatment decision. A marginal treatment proportion generally does not replace it when treatment depends on history.
  • Using post-treatment variables. Including a variable measured after \(A_t\) in \(p_t(H_t)\) changes the conditioning set and does not represent the pre-treatment assignment mechanism.
  • Assuming fitted means known means. Replacing \(p_0\) with \(\hat p\) changes the finite-sample equation and can affect uncertainty even when the model is consistent.
  • Confusing model fit with causal identification. A treatment model can fit observed assignments well while exchangeability fails or the blip model is misspecified.

A saturated treatment-history model may reproduce treatment proportions exactly in its strata, but can be unstable with many histories or sparse data. A lower-dimensional parametric model shares information across histories, at the cost of functional-form assumptions. Flexible models are another possibility, but their use requires appropriate control of estimation error; simply substituting predictions does not guarantee valid inference. Finally, a moment equation can have little information when residualized treatment has little variation. A computed numerical root in that setting should not be mistaken for reliable identification.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions below.

  1. State the conditional independence condition that makes the treatment-residual moment zero at \(\psi_0\).
  2. In a single-decision additive model, suppose the treatment residuals are \(0.5,-0.5\), the outcomes are 7 and 3, and the assignments are 1 and 0, respectively. Find the root for \(q=1\).
  3. Why is a fitted treatment probability not interchangeable with the marginal treatment proportion when treatment depends on history?
  4. Name two reasons a saturated estimated propensity model may cause problems.

Solutions. (1) Conditional on the pre-treatment history \(H\), \(A\) must be independent of the blipped-down outcome \(U(\psi_0)\), with the treatment residual formed using \(p_0(H)=P(A=1\mid H)\). (2) The numerator is \(0.5(7)-0.5(3)=2\). The denominator is \(0.5(1)-0.5(0)=0.5\), so \(\hat\psi=2/0.5=4\). (3) The marginal proportion does not account for history-dependent assignment; the required residual centers \(A\) at its conditional probability given \(H\). (4) Sparse histories can yield estimated probabilities of 0 or 1, and many strata can produce unstable estimates; either problem can remove or weaken treatment variation needed by the moment.

Clinical Biostats