Why Center Treatment on Its History?
In g-estimation, the goal is to find blip parameters that remove the modeled causal effect of treatment from the observed outcome. If the blip is correctly specified, the resulting blipped-down outcome has a conditional mean that does not depend on the treatment actually received, once pre-treatment history is held fixed. Treatment residuals provide a direct way to express that restriction as an estimating equation.
The centering is conditional, not merely a subtraction of the overall treatment average. Let \(H\) denote the measured history available just before a treatment decision, and let \(A\) denote the treatment assigned at that decision. A treatment residual compares the observed assignment with its conditional mean given \(H\). For binary treatment, this is a scalar residual. For a treatment with several categories, a vector of indicator residuals represents the distinct treatment contrasts.
From a Blipped-Down Outcome to a Moment Equation
For one treatment decision, let \(Y\) be the observed outcome and \(Y(a)\) the potential outcome under treatment level \(a\). A structural nested mean model specifies the conditional mean treatment effect, or blip, as a function \(\gamma(a,H;\psi)\) with parameter \(\psi\). The corresponding blipped-down outcome is \(U(\psi)=Y-\gamma(A,H;\psi)\). It removes the modeled effect of the treatment actually received.
For a binary additive blip, \(\gamma(A,H;\psi)=\psi A\), so \(U(\psi)=Y-\psi A\). The parameter \(\psi\) is an additive treatment effect in outcome units when the model holds. The key moment restriction follows if the blip model is correct and treatment assignment is conditionally exchangeable given \(H\): the conditional mean of \(U(\psi)\) does not vary with \(A\) after conditioning on \(H\). Consistency connects the observed outcome to the potential outcome under the received treatment; conditional exchangeability makes the relevant potential-outcome means comparable across treatment assignments within history.
The implication uses only the definition of \(p(H)\): when the conditional mean of \(U(\psi)\) is the same for either treatment, multiplying it by \(A-p(H)\) and taking the conditional expectation gives zero, because \(E[A-p(H)\mid H]=0\). Thus the binary g-estimation equation is
The conditional equation \(E[(A-p(H))\{Y-\psi A\}\mid H]=0\) is stronger in form than a single unconditional equation. In estimation, it can be represented by multiplying the residual moment by chosen functions of \(H\) and setting the resulting sample averages to zero. Including an intercept gives the unconditional moment above; additional functions can represent further history-specific restrictions. The treatment mean \(p(H)\) must be correctly specified or otherwise consistently estimated for the residual to be conditionally centered.
Binary Treatment: Formula and Identification
For binary \(A\), the residual \(R=A-p(H)\) has conditional variance \(p(H)\{1-p(H)\}\). Since \(A^2=A\),
Substituting \(Y=U(\psi)+\psi A\) into the moment shows why the equation can identify \(\psi\). At the true parameter, \(E[R U(\psi)\mid H]=0\); the remaining term is \(\psi E[RA\mid H]\). Identification therefore requires treatment variation within histories that occur in the target population. In particular, histories with \(p(H)=0\) or \(p(H)=1\) contribute no information about the binary treatment contrast. This is the relevant positivity requirement for this moment.
With a single unconditional sample moment and a correctly estimated \(p(H_i)\), the sample equation is \(\sum_i R_i(Y_i-\psi A_i)=0\). When its denominator is nonzero, solving it gives
Worked Example: A Binary Treatment Residual Equation
Suppose a hypothetical study records four people, their pre-treatment histories \(H\), the estimated conditional treatment probability \(p(H)\), binary treatment \(A\), and an outcome \(Y\) measured in points. Assume for this illustration that the binary additive blip \(Y-\psi A\) is appropriate, the treatment probabilities are correctly specified, and the identification and exchangeability assumptions described above hold.
| Person | \(p(H)\) | \(A\) | \(Y\) (points) | \(R=A-p(H)\) | \(RY\) | \(RA\) |
|---|---|---|---|---|---|---|
| 1 | 0.50 | 1 | 9 | 0.50 | 4.50 | 0.50 |
| 2 | 0.50 | 0 | 5 | -0.50 | -2.50 | 0 |
| 3 | 0.75 | 1 | 12 | 0.25 | 3.00 | 0.25 |
| 4 | 0.75 | 0 | 6 | -0.75 | -4.50 | 0 |
The sample moment sets the sum of \(R_i(Y_i-\psi A_i)\) to zero. Summing the two product columns gives \(\sum_iR_iY_i=4.50-2.50+3.00-4.50=0.50\) points and \(\sum_iR_iA_i=0.50+0+0.25+0=0.75\). Therefore,
This is the solution to the specified sample moment, not proof that the model or assumptions are true. Under the stated hypothetical assumptions, it estimates an additive effect of about 0.667 outcome points for treatment versus no treatment. The small example also illustrates why the residual values are not simply \(A\) minus the overall treated proportion: each is centered at the conditional probability for that person's history.
Multilevel Treatment: Residuals for Each Contrast
Suppose treatment has categories \(0,1,\ldots,K\), with category 0 as the reference. Define \(D_k=I(A=k)\) and \(\pi_k(H)=P(A=k\mid H)\). The residual \(R_k=D_k-\pi_k(H)\) is centered conditionally for each nonreference category. Because the category indicators sum to one, their residuals also sum to zero when the reference category is included. It is therefore usual to use \(K\) nonreference contrasts rather than a redundant set of all \(K+1\) indicators.
For category-specific additive blips, write \(\gamma(A,H;\boldsymbol{\psi})=\sum_{k=1}^{K}\psi_kD_k\), where \(\boldsymbol{\psi}=(\psi_1,\ldots,\psi_K)\). If the blipped-down outcome \(U(\boldsymbol{\psi})=Y-\sum_k\psi_kD_k\) has conditional mean independent of treatment given \(H\), each residual supplies a moment:
These equations must identify all \(K\) parameters. In particular, the treatment categories must have adequate conditional probabilities, and the residual contrasts must provide enough independent variation. If two treatment categories never vary separately over the histories in the data, their distinct blip parameters cannot be recovered from these moments. A single scalar residual formed by assigning numerical scores to categories generally does not replace the vector: it imposes only one contrast and may discard or distort the category-specific comparisons.
Worked Example: Solving Two Multilevel Treatment Moments
Consider hypothetical data from one history stratum with six people and three treatment categories. Each category is assigned to two people, so the conditional probabilities are \(\pi_0=\pi_1=\pi_2=1/3\). Outcomes are in points: category 0 has outcomes 4 and 6, category 1 has 7 and 9, and category 2 has 8 and 10. Assume the two-blip model \(U=Y-\psi_1D_1-\psi_2D_2\), with reference category 0, and the required exchangeability and model conditions hold.
For category 1, the residual is \(R_1=D_1-1/3\). The observed outcome sum in category 1 is \(16\), and the total outcome sum is \(44\). Thus \(\sum_i R_{1i}Y_i=16-(1/3)(44)=4/3\). For category 2, the corresponding calculation is \(\sum_iR_{2i}Y_i=18-(1/3)(44)=10/3\).
The cross-products with treatment indicators are \(\sum_iR_{1i}D_{1i}=2-2/3=4/3\), \(\sum_iR_{1i}D_{2i}=0-2/3=-2/3\), \(\sum_iR_{2i}D_{1i}=-2/3\), and \(\sum_iR_{2i}D_{2i}=4/3\). Setting both residual moments to zero therefore gives
Multiplying each equation by \(3/2\) and rearranging yields \(2\psi_1-\psi_2=2\) and \(-\psi_1+2\psi_2=5\). The first gives \(\psi_2=2\psi_1-2\); substitution into the second gives \(-\psi_1+4\psi_1-4=5\), so \(\psi_1=3\) and \(\psi_2=4\). These match the observed category mean contrasts: \(8-5=3\) points for category 1 versus category 0, and \(9-5=4\) points for category 2 versus category 0. In this balanced single-stratum example, the residual equations reduce to those contrasts.
Why Pooled Centering Can Fail
A residual must be centered on the conditional treatment mean given the relevant history. Subtracting the overall treatment prevalence can leave systematic residual differences across histories. If the outcome's treatment-free mean also varies across those histories, the incorrectly centered residual can correlate with that outcome and make the g-estimation moment nonzero even at the true blip.
Worked Example: A Pooled Mean Leaves Confounding in the Moment
Suppose two hypothetical history strata are equally common. In stratum \(H=0\), \(p(H)=0.20\) and the mean treatment-free outcome is 0 points. In stratum \(H=1\), \(p(H)=0.80\) and the mean treatment-free outcome is 10 points. Treatment is randomized within each stratum, and the true additive effect is \(\psi=2\) points. The pooled treatment probability is \(0.50\).
Using the correct residual \(A-p(H)\), the conditional mean residual is zero in both strata, so its product with the treatment-free outcome has expectation zero. In contrast, the pooled residual \(A-0.50\) has conditional means \(0.20-0.50=-0.30\) in stratum 0 and \(0.80-0.50=0.30\) in stratum 1. Its average product with the treatment-free outcome is
Also, because \(A\) is binary, \(E[(A-0.50)A]=\frac12(0.20)(0.50)+\frac12(0.80)(0.50)=0.25\). The pooled-residual equation would consequently yield a population ratio of \(\{1.50+2(0.25)\}/0.25=8\) points, rather than the true 2 points. The failure is not repaired by having a large sample: the residual is not conditionally centered.
Conditions and Common Pitfalls
The residual moment is useful only when its interpretation and requirements are respected. Consistency, conditional exchangeability given the measured pre-treatment history, and a correctly specified blip model justify the claim that the blipped-down outcome has no remaining conditional mean association with treatment. Positivity supplies treatment variation within histories, while correct specification of \(p(H)\) supplies the centering. These are substantive and modeling requirements; an algebraically solvable sample equation does not establish them.
- Centering on the wrong mean. The overall treatment proportion is not generally \(P(A=1\mid H)\). Use the conditional mean relevant to the treatment decision.
- Treating residualization as automatic confounding control. A residual moment is not valid merely because it uses \(A-p(H)\); the exchangeability and blip-model conditions are still needed.
- Using one residual for several unrelated contrasts. A multilevel treatment with \(K\) category-specific blips needs enough independent moments to identify those \(K\) parameters.
- Ignoring absent treatment variation. If a category has conditional probability zero or one in a history stratum, that stratum cannot identify its contrast through treatment residual variation.
- Reading a sample solution as a causal conclusion by itself. The computed parameter has a causal interpretation only under the assumptions that justify the structural nested model and its moments.
Check Your Understanding
Use the definitions and equations above to answer the following questions.
- For binary treatment, why does \(E[A-p(H)\mid H]=0\) hold?
- Under what conditional mean restriction does the binary residual moment \(E[(A-p(H))\{Y-\psi A\}\mid H]=0\) follow?
- What treatment-variation condition makes \(E[(A-p(H))A\mid H]\) positive?
- For treatment categories \(0,1,2\), how many nonreference residual moments are used for category-specific additive blips, and why is the reference category omitted?
- Explain why subtracting the pooled treatment prevalence can produce a nonzero moment when both treatment probability and treatment-free outcome mean vary by history.