Why Model Specification Matters in an HIV Cohort
In an HIV treatment cohort, regimen decisions may depend on measured clinical history, such as CD4 count, viral load, prior treatment, and disease severity. Those same variables can predict subsequent survival. A marginal structural analysis uses treatment and censoring weights to address measured time-varying confounding and informative loss to follow-up. Its estimates can nevertheless be sensitive to how the probabilities used to construct those weights are modeled.
This tutorial examines that sensitivity for regime-specific survival. The numbers below are illustrative, constructed values rather than results from a particular cohort. The goal is to see which modeling choices matter, how to compare them fairly, and what the comparison can and cannot establish.
For a transparent discrete-time calculation, assume the event outcome for interval \(k\) is ascertained before a censoring decision at the end of that interval. Thus a person censored after the interval-\(k\) outcome can contribute that outcome. Censoring at the end of interval \(k-1\), by contrast, prevents observation of the interval-\(k\) outcome. If censoring can occur before the interval outcome is determined, the risk set and weights below are not appropriate without a finer time scale or another valid censoring-adjusted estimator.
Estimand, Weights, and the Observed Risk Set
Suppose the analysis follows people who adhere to the specified regime \(g\). Let \(H^A_j\) denote the measured history used to model treatment at \(j\), and let \(H^C_j\) denote the history used to model whether a person remains observed after the outcome at \(j\). Define \(p^A_j=P(A_j=g_j\mid H^A_j)\) and \(p^C_j=P(C_j=0\mid H^C_j,A_j=g_j,C_{j-1}=0)\), where \(C_j=1\) means censoring after the interval-\(j\) outcome. The unstabilized weight for an observed, adherent person contributing to interval \(k\) is
The censoring product ends at \(k-1\), not \(k\): end-of-interval-\(k\) censoring occurs after \(Y_k\) has been observed and therefore does not determine whether that outcome is available. Let \(R_{k-1}=1\) indicate that the person was uncensored through the end of interval \(k-1\), and let \(S^{\mathrm{obs}}_{k-1}=1\) indicate observed event-free status through that interval. A weighted interval hazard estimate is
The indicators restrict the calculation to people adherent through \(k\), observed through the previous interval, and at risk at the start of \(k\). The outcome \(Y_{ik}\) is observed for these people under the stated timing convention. The product-limit estimate is \(\widehat S_k^g=\prod_{j=1}^{k}(1-\widehat h_j^g)\).
What the Weighting Calculation Justifies
The key justification is a change of distribution: under the assumptions above, weighting observed adherent and uncensored histories by inverse conditional probabilities removes the selection induced by treatment and censoring. In a finite discrete-time setting, the argument follows by factoring the observed-data probabilities.
Here the left-hand expectation is over the observed data, and \(q^g\) is the same function evaluated on the history that would be observed under regime \(g\), with the event outcome at \(k\) ascertained before end-of-interval censoring.
To verify the identity, factor the probability of an observed history selected for the calculation into its regime-history probability and the conditional probabilities of treatment adherence and remaining uncensored through \(k-1\). The selection factors are \(\prod_{j=1}^k p^A_j\) and \(\prod_{j=1}^{k-1}p^C_j\). Multiplication by \(W_k(g)\) cancels both factors. Sequential exchangeability and consistency make the remaining history distribution the distribution under regime \(g\); summing over its possible histories gives \(E[q^g]\). Positivity ensures the inverse factors are defined. This proves the identity.
Apply the identity to the event numerator and the at-risk denominator. Their population ratio is the conditional event probability under \(g\) among people who would have survived through \(k-1\), namely the regime-specific interval hazard \(h_k^g\). For independent, identically distributed participants, a fixed finite number of intervals, finite relevant weight expectations, and positive weighted risk-set denominators, the law of large numbers gives convergence of the sample numerator and denominator to their expectations. The ratio therefore converges to \(h_k^g\). The chain rule gives
For a finite horizon, continuity of multiplication then gives consistency of the product of the estimated hazards when each estimated hazard is consistent. This argument does not make a misspecified fitted probability model correct; it describes why the intended calculation works under its assumptions.
Worked Example: Computing a Two-Interval Weight
Consider one illustrative participant following a two-interval regime. Suppose the fitted probabilities of receiving the regime treatment are \(0.60\) in interval 1 and \(0.50\) in interval 2. Suppose the probability of remaining uncensored after the interval-1 outcome is \(0.80\). The participant is uncensored through interval 1, so their interval-2 outcome is observed.
For interval 1, there is no earlier end-of-interval censoring probability in the weight: \(W_1=1/0.60=1.667\), to three decimal places.
For interval 2, the treatment probabilities through interval 2 and the probability of remaining observed after interval 1 enter: \(W_2=1/(0.60\times0.50\times0.80)=1/0.24=4.167\). The interval-2 censoring probability is not included: under the timing convention, censoring after the interval-2 outcome does not determine whether that outcome is observed. If the participant had been censored after interval 1, they would not enter the interval-2 observed risk set at all.
Comparing Alternative Models in the Cohort
A useful sensitivity analysis changes treatment and censoring specifications separately and together. For example, a simpler treatment model might include baseline covariates and linear terms for recent CD4 count and viral load; a richer alternative might add nonlinear terms and selected interactions. A simpler censoring model might use current covariates and prior treatment, while a richer alternative adds their recent histories. These are candidate models, not guaranteed improvements. Each must be fitted using information available at the corresponding decision time.
The following constructed values illustrate interval hazards and two-interval survival for one fixed regime \(g\). T0 and T1 denote the simpler and richer treatment models; C0 and C1 denote the simpler and richer censoring models. The weighted event totals and weighted risk totals shown are illustrative.
| Model pair | Interval 1: events / risk | Interval 2: events / risk | Two-interval survival |
|---|---|---|---|
| T0, C0 | 12 / 120 = 0.100 | 9 / 90 = 0.100 | \(0.90 \times 0.90 = 0.8100\) |
| T1, C0 | 12 / 120 = 0.100 | 12 / 90 = 0.1333 | \(0.90 \times 0.8667 = 0.7800\) |
| T0, C1 | 15 / 120 = 0.125 | 9 / 90 = 0.100 | \(0.875 \times 0.90 = 0.7875\) |
| T1, C1 | 15 / 120 = 0.125 | 12 / 90 = 0.1333 | \(0.875 \times 0.8667 \approx 0.7583\) |
For example, with T1 and C1 the interval hazards are \(15/120=0.125\) and \(12/90=0.1333\), so estimated survival is \((1-0.125)(1-0.1333)=0.875\times0.8667\approx0.7583\). Holding C0 fixed, changing T0 to T1 changes survival from \(0.8100\) to \(0.7800\), a difference of \(-0.0300\). Holding T0 fixed, changing C0 to C1 changes it from \(0.8100\) to \(0.7875\), a difference of \(-0.0225\). Changing both gives \(0.7583\), a difference of about \(-0.0517\) from the T0/C0 estimate. These comparisons identify which fitted components accompany the change in this analysis; they do not prove that either specification is correctly specified.
Worked Example: Comparing Regime-Specific Survival Contrasts
Suppose, in the same illustrative analysis, the corresponding survival estimates for a second regimen are \(0.8400\), \(0.8250\), \(0.8300\), and \(0.8000\) under T0/C0, T1/C0, T0/C1, and T1/C1, respectively. Define the two-interval survival difference as survival under the first regimen minus survival under the second.
Under T0/C0 the difference is \(0.8100-0.8400=-0.0300\). Under T1/C0 it is \(0.7800-0.8250=-0.0450\). Under T0/C1 it is \(0.7875-0.8300=-0.0425\). Under T1/C1 it is approximately \(0.7583-0.8000=-0.0417\).
The treatment-model change under C0 moves the estimated difference by \(-0.0150\), from \(-0.0300\) to \(-0.0450\). The censoring-model change under T0 moves it by \(-0.0125\), from \(-0.0300\) to \(-0.0425\). When both models change, the estimate is about \(-0.0417\), not the sum of the two separate changes. The joint result reflects how both sets of weights act on the same observed risk sets and outcomes. It would be misleading to assign the entire joint change to just one model.
Diagnostics, Failure Modes, and Interpretation
Model sensitivity is informative only alongside diagnostics. Check treatment probabilities and censoring probabilities over the histories that matter, and examine the resulting weights by interval and regime. Very small fitted probabilities produce large inverse weights; a small number of participants can then dominate weighted event totals. Report weight quantiles, maxima, and effective sample size, commonly summarized for weights \(W_i\) as \((\sum_i W_i)^2/\sum_i W_i^2\). Also examine whether measured covariates are balanced after weighting, using the relevant histories and time points. Balance is a diagnostic, not proof of exchangeability or correct model specification.
A model comparison is more credible when alternatives are scientifically motivated and their results are reported with the same target population, regime, follow-up horizon, and outcome definition. If a richer model changes the estimate while also producing a few extreme weights or a much smaller effective sample size, that change may reflect instability rather than a more trustworthy correction. Conversely, similar estimates across plausible models are reassuring about measured-data specification sensitivity, but do not establish that all confounders were measured or that positivity holds.
- Do not interpret agreement as identification. Different misspecified models can produce similar estimates; unmeasured confounding and structural positivity failures remain possible.
- Do not choose a model only because its estimate is preferred. Specify plausible alternatives based on treatment and follow-up processes, then compare their consequences.
- Do not silently truncate extreme weights. Truncation changes the estimator and may introduce bias; report it as a separate analysis and compare it with the untruncated result.
- Do not include outcomes that were not observed. Under the timing used here, interval \(k\) outcomes are available before censoring at the end of \(k\). If that timing is false, redefine observation and use a method appropriate to censoring before outcome ascertainment.
The main alternatives are outcome-regression standardization, g-computation, and doubly robust approaches. They rely on different modeling strategies and can be useful complementary analyses, but they do not remove the need for adequate measured history, positivity, and a clearly defined estimand. The present comparison is narrower: it asks how weighted marginal survival estimates change across plausible treatment and censoring models. Its conclusion should be stated as sensitivity to measured-data model choices, not as a correction for every possible bias.
Worked Example: Diagnosing an Unstable Alternative
Suppose a richer treatment model produces 100 interval-specific weights with total weight \(100\), but two participants each have weight \(20\) and the other 98 each have weight \(60/98\approx0.6122\). The effective sample size is \((\sum W_i)^2/\sum W_i^2\). The squared-weight total is \(2(20^2)+98(0.6122^2)\approx800+36.73=836.73\), so the effective sample size is approximately \(10000/836.73=11.95\), rather than 100.
This calculation shows that the nominal 100 observations contribute information more like 12 equally weighted observations under this summary. If this alternative also shifts survival substantially, inspect which histories generated the two large weights, whether fitted probabilities are near zero, and whether covariate balance improves. The result is a warning to investigate; it is not, by itself, evidence that the richer model is wrong or that the simpler estimate is correct.
Check Your Understanding
Answer the questions, then compare your reasoning with the solutions.
- Under the stated timing convention, why does the interval-\(k\) censoring probability not enter the weight for the interval-\(k\) outcome?
- If a model pair gives interval hazards \(0.08\) and \(0.15\), what is the estimated survival through two intervals?
- In a sensitivity analysis, the richer treatment model changes survival while the censoring model is held fixed. What does that comparison establish, and what does it not establish?
- Why can similar estimates from several alternative models not rule out unmeasured confounding?
- What change in the analysis is needed if censoring can occur before the interval outcome is determined?
Solutions. (1) The outcome is ascertained before end-of-interval censoring, so censoring after that outcome does not select whether it is observed; the censoring product includes only retention through interval \(k-1\). (2) Survival is \((1-0.08)(1-0.15)=0.92\times0.85=0.782\). (3) It measures the estimate’s sensitivity to that treatment-model change conditional on the fixed censoring model; it does not show which model is correct or verify the causal assumptions. (4) All candidate models may omit the same confounder, and agreement among them cannot test whether that confounder was measured. (5) The risk set and observation probabilities must reflect whether the outcome was actually observed; use a finer time scale or another valid censoring-adjusted estimator rather than including people with unobserved interval outcomes.