Tutorials › Marginal Structural Models › Worked Example of Continuous-Dose G-Estimation

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

Worked Example of Continuous-Dose G-Estimation

Fit and interpret a continuous-dose SNMM by constructing blipped-down outcomes and solving centered-instrument g-estimation equations.

Advanced 11 min read

What You'll Learn

  • Specify a continuous-dose structural nested mean model and its blipped-down outcome.
  • State assumptions that justify the centered-instrument g-estimation moments.
  • Fit a quadratic dose-response model by solving empirical moment equations.
  • Adjust the dose-response fit for a baseline covariate using within-stratum centering.
  • Interpret fitted contrasts and distinguish mean blips from individual treatment effects.
  • Diagnose weak dose variation, treatment-model errors, and blip-model misspecification.

Why Fit a Continuous-Dose SNMM?

When treatment is a dose, the causal question is often not simply whether treatment was given. It is how the mean outcome would change as the dose changes. A structural nested mean model (SNMM) describes that change through a dose-dependent blip function. G-estimation chooses the blip parameters so that, after subtracting the modeled dose contribution from each observed outcome, the resulting blipped-down outcomes satisfy specified moment conditions with treatment.

The key point is that this is a model for a conditional mean contrast, not necessarily a claim that subtracting the blip recovers each person's untreated potential outcome. The moment conditions require assumptions strong enough to link observed treatment to the relevant potential outcomes.

Model, Assumptions, and Estimating Moments

Definition: Let \(A\) be a continuous dose, \(H\) the measured covariates available before treatment, and \(Y(a)\) the potential outcome under dose \(a\). A continuous-dose SNMM specifies $$ E[Y(a)-Y(0)\mid H]=g(a,H;\psi_0), $$ where \(g(0,H;\psi)=0\) and \(\psi_0\) is the true blip parameter. A common working model is \(g(a,H;\psi)=\psi_1a+\psi_2a^2\); covariate interactions can be included when scientifically appropriate. The observed blipped-down outcome at a candidate value \(\psi\) is \(U(\psi)=Y-g(A,H;\psi)\).

For the moment argument below, assume consistency, \(Y=Y(A)\), and conditional exchangeability of treatment with the full collection of potential outcomes: \(A\perp\{Y(a):a\text{ in the dose support}\}\mid H\). Also assume the stated mean-blip model is correct and the expectations used below exist. This exchangeability condition is stronger than requiring \(A\) to be independent only of \(Y(0)\). It rules out treatment being associated, given \(H\), with potential-outcome variation at other doses as well.

Let \(s(a)\) be a vector of dose features, such as \(s(a)=(a,a^2)^\mathsf{T}\), and suppose \(g(a,H;\psi)=\psi^\mathsf{T}s(a)\). Define centered instruments \(Z=s(A)-E[s(A)\mid H]\). In practice, the conditional mean of the dose features is specified or estimated from the treatment distribution given \(H\). This tutorial considers the basic centered-instrument moments; more general instrument choices are available when additional assumptions and design considerations support them.

Theorem: Under consistency, conditional exchangeability as stated above, a correctly specified mean-blip model, and the required finite expectations, the true parameter satisfies $$ E[Z\,U(\psi_0)]=0. $$ If \(g(a,H;\psi)=\psi^\mathsf{T}s(a)\) and the matrix \(\Gamma=E[\operatorname{Cov}(s(A)\mid H)]\) is positive definite, these population moments identify \(\psi_0\) uniquely.

Proof. By consistency, conditional exchangeability, and the mean-blip model, $$ E[Y\mid A,H]=E[Y(A)\mid A,H]=E[Y(A)\mid H]=E[Y(0)\mid H]+g(A,H;\psi_0). $$ The second equality follows from exchangeability for the potential outcome at each dose in the support. Therefore, $$ E[U(\psi_0)\mid A,H] =E[Y-g(A,H;\psi_0)\mid A,H] =E[Y(0)\mid H]. $$ This is a conditional-mean statement; it does not assert \(U(\psi_0)=Y(0)\) for each individual. Since \(E[Z\mid H]=0\), iterated expectation gives $$ E[Z\,U(\psi_0)] =E\{Z\,E[U(\psi_0)\mid A,H]\} =E\{Z\,E[Y(0)\mid H]\} =0. $$ For uniqueness, let \(\psi\) be any candidate. The vector moment is $$ M(\psi)=E[Z\{Y-\psi^\mathsf{T}s(A)\}]. $$ The first part of the proof gives \(M(\psi_0)=0\). Moreover, $$ E[Zs(A)^\mathsf{T}] =E[\operatorname{Cov}(s(A)\mid H)] =\Gamma, $$ so \(M(\psi)=-\Gamma(\psi-\psi_0)\). If \(\Gamma\) is positive definite, it is invertible, and \(M(\psi)=0\) implies \(\psi=\psi_0\). Positive definiteness requires enough conditional dose variation to distinguish the dose features in the model. \(\square\)

The sample analogue replaces expectations by averages and conditional dose-feature means by known or estimated values. With two parameters and two instruments, the fitted value solves two equations. With more valid instruments than parameters, extra moments can be used for an overidentification check; with too little variation, the equations may be unstable or fail to identify the parameters.

Worked Fits and Dose Contrasts

Worked Example: Blipping Down at Several Doses

Suppose the fitted blip is \(g(a;\psi)=2a+0.5a^2\). Calculate the fitted mean blip at doses 0, 1, 2, and 3, and blip down an observed outcome of 18 at dose 2.

At dose 0, \(g(0)=2(0)+0.5(0)^2=0\). At dose 1, \(g(1)=2+0.5=2.5\). At dose 2, \(g(2)=4+2=6\). At dose 3, \(g(3)=6+4.5=10.5\).

For the observation with \(A=2\) and \(Y=18\), the blipped-down value is $$ U(\psi)=18-g(2;\psi)=18-6=12. $$ The value 12 is the observed outcome after subtracting the fitted mean contribution of the observed dose. The SNMM and assumptions do not make it an individual's actual untreated potential outcome.

The fitted mean contrast between dose 3 and dose 1 is \(g(3)-g(1)=10.5-2.5=8\). It is a model-implied mean contrast for the covariate conditions represented by this model, not a claim that every person's outcome increases by 8.

Worked Example: Solving the Quadratic G-Estimation Equations

Consider four observations with no varying covariates, doses \(A=(0,1,2,3)\), and outcomes \(Y=(5,7.5,11,15.5)\). Fit \(g(a;\psi)=\psi_1a+\psi_2a^2\) using centered dose features \(Z_1=A-\bar A\) and \(Z_2=A^2-\overline{A^2}\).

The sample means are \(\bar A=1.5\) and \(\overline{A^2}=3.5\). Thus \(Z_1=(-1.5,-0.5,0.5,1.5)\) and \(Z_2=(-3.5,-2.5,0.5,5.5)\). The empirical moments set the sums of \(Z_1U(\psi)\) and \(Z_2U(\psi)\) to zero. The required cross-products are $$ \sum Z_1^2=5,\qquad \sum Z_1Z_2=15,\qquad \sum Z_2^2=49. $$ Because the outcome vector is \(5+2A+0.5A^2\), and each centered instrument sums to zero, $$ \sum Z_1Y=2(5)+0.5(15)=17.5,\qquad \sum Z_2Y=2(15)+0.5(49)=54.5. $$ The two estimating equations are therefore $$ \begin{pmatrix}5&15\\15&49\end{pmatrix} \begin{pmatrix}\psi_1\\\psi_2\end{pmatrix} = \begin{pmatrix}17.5\\54.5\end{pmatrix}. $$ The determinant is \(5(49)-15(15)=20\), so the matrix is invertible. Solving gives $$ \psi_1=\frac{17.5(49)-15(54.5)}{20} =\frac{857.5-817.5}{20}=2, $$ $$ \psi_2=\frac{5(54.5)-15(17.5)}{20} =\frac{272.5-262.5}{20}=0.5. $$ The fitted blipped-down outcomes are \(Y-2A-0.5A^2=(5,5,5,5)\). This exactly recovers the parameters because the displayed outcomes follow the model without residual variation; real sample estimates need not produce constant blipped-down values.

Worked Example: Adjusting for a Baseline Covariate

Suppose \(H\) has two levels and the data are as follows. Fit the linear blip \(g(a;\psi)=\psi A\) using dose deviations centered within levels of \(H\).

HAY
004
016
028
1112
1214
1316

Within each level, the mean dose is 1 or 2, respectively. The centered doses are \((-1,0,1)\) in both groups; the within-group centered outcomes are \((-2,0,2)\) in both groups. The slope equation has numerator \(\sum (A-\bar A_H)(Y-\bar Y_H)=4+4=8\) and denominator \(\sum(A-\bar A_H)^2=2+2=4\). Hence \(\hat\psi=8/4=2\). Blipping down gives outcomes \((4,4,4,10,10,10)\), constant within each \(H\) level.

Ignoring \(H\) would give a different slope: \(\bar A=1.5\), \(\bar Y=10\), \(\sum(A-\bar A)(Y-\bar Y)=20\), and \(\sum(A-\bar A)^2=5.5\), so the crude slope is \(20/5.5\approx3.64\). The difference illustrates how a baseline factor associated with both dose and outcome can distort an unadjusted dose contrast. The within-level calculation is justified only if the relevant exchangeability and model assumptions hold conditional on \(H\).

Diagnostics, Alternatives, and Limits

A fitted parameter is meaningful only if the model and its identifying conditions are plausible. Useful checks include:

  • Dose support and rank: examine dose variation across covariate strata. If doses vary little, or \(A\) and \(A^2\) are nearly linearly related over the observed support, the moment matrix may be singular or poorly conditioned.
  • Treatment-model centering: check whether the fitted conditional means of the dose features describe their relationship with \(H\). Incorrect centering can leave instruments associated with \(H\), undermining the moment argument.
  • Blip specification: inspect whether candidate blipped-down outcomes remain systematically associated with centered dose features, and assess whether a linear, quadratic, or effect-modified blip is scientifically credible. A failed diagnostic can indicate misspecification, but passing a sample check does not establish the assumptions.
  • Influence and extrapolation: unusually high doses can dominate quadratic terms. Avoid interpreting contrasts beyond doses with adequate support; fitted polynomial shapes can behave implausibly outside the data range.

An outcome-regression approach models \(E[Y\mid A,H]\) directly; an inverse-probability-weighted marginal structural model instead uses treatment-density weights to target regime means or contrasts. Those methods have different estimating equations and sensitivities. G-estimation is attractive when the structural nested mean model and centered-instrument moments are appropriate, but it is not automatically protected against unmeasured confounding or a misspecified treatment model.

A central pitfall is to reason that \(U(\psi_0)\) equals \(Y(0)\) person by person. That equality would require an individual-level blip assumption, not merely a conditional mean SNMM. The correction is to derive the needed conditional mean: under consistency, full conditional exchangeability, and the mean-blip restriction, \(E[U(\psi_0)\mid A,H]=E[Y(0)\mid H]\), which is enough for the centered-instrument moment. If exchangeability is stated only for \(Y(0)\), that derivation does not follow for a mean blip involving \(Y(A)\).

Key takeaway: Continuous-dose g-estimation fits the parameters that make blipped-down outcomes satisfy valid treatment-centered moments. Its interpretation depends on the mean-blip model, conditional exchangeability, correct treatment-feature centering, and adequate dose variation; it does not turn a mean model into an individual-level causal equation.

Check Your Understanding

Answer each question, then compare with the short solutions below.

  1. For \(g(a)=1.5a+0.2a^2\), calculate the fitted contrast between doses 2 and 0.
  2. Why does \(E[Z\mid H]=0\) make the centered-instrument moment vanish at the true parameter?
  3. What does positive definiteness of \(E[\operatorname{Cov}(s(A)\mid H)]\) contribute to the quadratic fit?
  4. Why is blipping down not generally an individual-level reconstruction of \(Y(0)\)?

Solutions. (1) \(g(2)-g(0)=1.5(2)+0.2(4)=3.8\). (2) At the true parameter, the conditional mean of the blipped-down outcome given \(A,H\) is \(E[Y(0)\mid H]\); multiplying by \(Z\), taking expectations, and using \(E[Z\mid H]=0\) gives zero. (3) It ensures the dose-feature directions are distinguishable in the population moment equations, so the parameter vector is unique. (4) A mean-blip SNMM restricts conditional mean contrasts, not each person's treatment effect; the derivation establishes a conditional expectation, not pointwise equality.

Clinical Biostats