Tutorials › Response-Adaptive Randomization › Sensitivity Analysis for Unmodeled Calendar-Time Drift

Time Trends and Drift · Tutorial 412 of 501

Sensitivity Analysis for Unmodeled Calendar-Time Drift

Build transparent sensitivity analyses that show how alternative calendar-time drift assumptions would shift an adjusted treatment contrast.

Advanced 12 min read

What You'll Learn

  • Define a sensitivity-adjusted treatment contrast for a specified unmodeled drift pattern
  • Derive the pattern’s omitted-variable contribution and distinguish it from realized regression differences
  • Calculate sensitivity shifts for linear, curved, and abrupt timing patterns
  • Interpret sensitivity grids in outcome units and assess how conclusions change
  • Diagnose weak overlap and other conditions that make drift sensitivity results unstable
  • Distinguish sensitivity analysis from fitting a different primary outcome model

Why Examine Drift That Was Not Modeled?

An adjusted treatment contrast can still depend on how calendar time is represented. A linear term, spline, or seasonal component may capture the pattern anticipated in the analysis plan, but actual outcomes can follow a different trajectory. If treatment allocation also changes over enrollment, a time pattern left out of the model can contribute to the estimated treatment contrast. Sensitivity analysis makes that dependence visible by specifying plausible patterns and magnitudes rather than treating one trend specification as certainly correct.

The aim is not to discover an unknown trend by trying enough models until a preferred answer appears. It is to ask a transparent question: if an omitted calendar-time component had a specified shape and size, how much could it shift the adjusted contrast under the observed allocation pattern? The earlier material on calendar-time adjustment and temporal overlap provides the modeling and design context; here the focus is quantifying departures from the chosen model.

Define the Sensitivity Calculation

Definition: Let \(Y\) be the outcome, \(A\) the treatment indicator (1 for the treatment of interest and 0 otherwise), and \(X\) the covariates included in the primary outcome regression, including an intercept. Let \(\hat{\tau}_{\text{omit}}\) be the fitted coefficient of \(A\) from that regression. For a specified calendar-time pattern \(q\), define \(k=A'M_Xq/(A'M_XA)\), where \(M_X=I-X(X'X)^{-1}X'\), provided the relevant regressions are identifiable. If \(\gamma\) is the assumed outcome change per one unit of \(q\), the sensitivity-adjusted contrast is \(\hat{\tau}_{\text{sens}}(\gamma,q)=\hat{\tau}_{\text{omit}}-\gamma k\). The units of \(\gamma k\) are the outcome units.

The entries of \(q\) assign a value of the proposed drift pattern to each participant’s enrollment time. For example, \(q\) might be an indicator for enrollment after a prespecified date, a scaled linear time score, or a curvature pattern. Its scale must be stated: if \(q\) ranges from 0 to 1, then \(\gamma\) is the assumed outcome difference between the pattern’s minimum and maximum. The quantity \(k\) measures how strongly that pattern aligns with treatment assignment after removing the part explained by \(X\). It depends on the observed allocation and the included covariates, not on outcomes.

The formula has a specific interpretation. Consider the working model \(Y=\tau A+X\beta+\gamma q+\varepsilon\), with a common additive treatment effect, a specified additive drift pattern, and \(E(\varepsilon\mid A,X,q)=0\). If the regression omits \(q\), its treatment coefficient has conditional expectation \(\tau+\gamma k\). Thus subtracting \(\gamma k\) removes the pattern’s expected omitted-variable contribution under those assumptions. It does not assert that the corrected contrast is the coefficient that a regression including \(q\) would have produced in the realized data.

Why the Correction Is an Expected Contribution

The distinction between an expected contribution and an exact equality matters. Residualizing \(Y\) and \(A\) against \(X\), the omitted regression coefficient is \(\hat{\tau}_{\text{omit}}=A'M_XY/(A'M_XA)\). Substitution of the working model gives:

$$ \hat{\tau}_{\text{omit}} = \tau+\gamma\frac{A'M_Xq}{A'M_XA} +\frac{A'M_X\varepsilon}{A'M_XA} = \tau+\gamma k+\frac{A'M_X\varepsilon}{A'M_XA}. $$

Since \(E(\varepsilon\mid A,X,q)=0\), the last term has conditional expectation zero. This proves that \(\gamma k\) is the conditional expected omitted-pattern contribution. If \(q\) is also included in the regression, the treatment coefficient has a different residualized denominator and a different projection of \(\varepsilon\). The realized coefficients therefore need not differ by exactly \(\gamma k\). The sensitivity-adjusted contrast is a transparent adjustment of the omitted-model estimate under a stated scenario, not an algebraic identity between two realized fits.

This calculation assumes the chosen pattern and magnitude are meaningful, the additive working model is a reasonable description for the sensitivity question, and treatment and \(q\) are not perfectly collinear after adjustment for \(X\). It also does not establish that the treatment contrast is causal; causal interpretation still depends on the trial design, outcome definition, and analysis assumptions. If treatment effects vary over time, an additive common-effect calculation may not summarize the target contrast adequately.

Worked Example: A Late-Enrollment Shift

Suppose a hypothetical trial enrolls 12 participants in two periods, with six assigned to treatment and six to control. There are two early treated participants and four late treated participants; among controls, four are early and two are late. Let \(q=1\) for late enrollment and \(q=0\) for early enrollment, and let \(X\) contain only an intercept. The outcome is measured in points.

Assume the hypothetical cell means are 10 points for early treated participants, 13 for late treated participants, 8 for early controls, and 11 for late controls. These means follow an additive pattern with a treatment contrast of 2 points and a late-versus-early drift of 3 points. The crude adjusted-for-intercept treatment contrast is the difference in group means: \((2(10)+4(13))/6-(4(8)+2(11))/6=12-9=3\) points.

For an intercept-only adjustment, \(k\) is the difference between the late-enrollment proportions in the treatment groups: \(k=4/6-2/6=1/3\approx0.333\). If the assumed drift is \(\gamma=3\) points from early to late enrollment, the pattern’s contribution is \(\gamma k=3(1/3)=1\) point. The sensitivity-adjusted contrast is \(3-1=2\) points. This recovers the treatment contrast in the constructed additive example; in real data, the calculation is a sensitivity scenario, not proof that the assumed drift is the true one.

Vary Shape and Timing, Not Just Magnitude

A useful analysis varies more than the size of a single linear trend. A sudden change, a gradual trend, and a temporary mid-enrollment disturbance can have different alignments with treatment assignment. For each proposed pattern \(q\), calculate its own \(k\), then evaluate a prespecified range of plausible \(\gamma\) values. If the pattern is coded on a 0-to-1 scale, positive \(\gamma\) means higher outcomes where \(q\) is higher; reversing the coding reverses both the sign of \(k\) and the corresponding interpretation.

Worked Example: Curvature After Adjusting for Linear Time

Consider four hypothetical enrollment times \(t=(-1,0,1,2)\), one treated participant at \(t=2\), and three controls at the other times. The primary model includes an intercept and linear time. To assess curvature beyond that linear adjustment, choose \(q=t^2=(1,0,1,4)\). The residual of \(q\) after projecting on the intercept and \(t\) is \(M_Xq=(1,-1,-1,1)\).

For the treatment vector \(A=(0,0,0,1)\), its residual after projection on the intercept and \(t\) is \(M_XA=(0.2,-0.1,-0.4,0.3)\). Therefore:

$$ A'M_Xq=(M_XA)'(M_Xq)=0.2+0.1+0.4+0.3=1, \qquad A'M_XA=(M_XA)'(M_XA)=0.04+0.01+0.16+0.09=0.30, \qquad k=\frac{1}{0.30}=\frac{10}{3}. $$

Here \(q=t^2\) uses squared time units, so \(k=10/3\) has squared-time units. Suppose the omitted-model treatment coefficient is 2.167 points and the sensitivity scenario assumes \(\gamma=0.20\) points per squared-time unit. Then \(\gamma k=0.20(10/3)=0.667\) points, and \(\hat{\tau}_{\text{sens}}=2.167-0.667=1.500\) points. This is a deliberately sparse allocation: a single treated participant at the end of enrollment makes the contrast highly dependent on extrapolation from the fitted linear trend. The large \(k\) is a warning about sensitivity, not evidence that the curvature assumption is correct.

Worked Example: Comparing Drift Timing Scenarios

In a hypothetical 12-person trial, suppose six participants receive treatment and six receive control, with period counts as follows: in the early period, one treated and three controls; in the middle period, three treated and one control; in the late period, two treated and two controls. Let \(X\) contain an intercept, so the treatment contrast is a difference in group means. Suppose \(\hat{\tau}_{\text{omit}}=2.4\) outcome points.

For an early-only pattern \(q=(1,0,0)\) across the three periods, the treated and control means of \(q\) are \(1/6\) and \(3/6\), so \(k=-1/3\). For a middle-only pattern \(q=(0,1,0)\), \(k=3/6-1/6=1/3\). For a late-only pattern \(q=(0,0,1)\), \(k=2/6-2/6=0\). These values follow directly from the group proportions because \(X\) contains only an intercept.

If each scenario assumes a 3-point outcome increase at the period where its \(q\) equals 1, the adjusted contrasts are respectively \(2.4-3(-1/3)=3.4\), \(2.4-3(1/3)=1.4\), and \(2.4-3(0)=2.4\) points. The assumed increase in the early period raises the corrected contrast because early enrollment is less common in the treatment arm; the middle-period increase lowers it because middle enrollment is more common in the treatment arm. A late-only shift does not alter this contrast in this allocation. The calculation shows why timing assumptions should be reported alongside magnitude assumptions.

How to Read a Sensitivity Analysis

A compact presentation reports the observed adjusted contrast, the definition and scale of each \(q\), the assumed values of \(\gamma\), the corresponding \(k\), and the resulting \(\hat{\tau}_{\text{sens}}\). A table or plot can show the range of corrected contrasts without implying that one scenario is known to be true. If the contrast changes sign or crosses a clinically meaningful threshold within a defensible range, the substantive conclusion is sensitive to unmodeled drift. If it remains similar across a broad and credible set of scenarios, that is evidence of robustness to those scenarios only.

Uncertainty needs careful description. The sensitivity formula shifts the point estimate for a specified \((q,\gamma)\); it does not automatically incorporate uncertainty about the true drift magnitude or shape. A confidence interval calculated under the primary model does not by itself become a confidence interval covering all sensitivity scenarios. Report the model-based interval and the sensitivity range separately, or use an explicitly justified procedure that propagates both sources of uncertainty. Do not interpret the range over analyst-chosen scenarios as a probability distribution for the treatment effect.

Diagnostics help determine whether the calculations are informative. Inspect treatment allocation over enrollment time, the number of participants in each arm and time region, and whether the proposed pattern is nearly explained by included covariates or nearly collinear with treatment. A small \(A'M_XA\) signals little residual treatment variation after adjustment; \(k\) can then be large and unstable. The overlap diagnostics from earlier material are relevant here: sensitivity calculations cannot manufacture information where one arm is scarcely represented at relevant times. Also check whether conclusions depend on one unusually narrow timing window or on an implausibly large \(\gamma\).

Alternatives, Limitations, and a Common Pitfall

A primary outcome model can instead include a prespecified linear trend, spline, seasonal term, or calendar-time blocks. Those approaches estimate temporal patterns from the observed outcomes and can be more efficient if correctly specified, but their conclusions depend on the chosen model and on adequate overlap. Weighting for changing allocation probabilities targets temporal balance through a different modeling strategy and can become unstable when allocation probabilities are extreme. Sensitivity analysis complements these approaches: it asks what specified departures from the primary model would do, rather than claiming to identify the true drift.

The calculation is limited by the plausibility of the pattern and magnitude range, the additive specification, and the observed treatment-time allocation. A \(q\) chosen after inspecting which pattern most changes the result can make the analysis misleading. Multiple patterns are useful when selected for scientific or operational reasons and presented transparently, not as a search for a preferred answer. Sensitivity analysis also cannot repair outcome measurement changes, unrecorded enrollment-time errors, or a lack of temporal overlap.

Common mistake: “The coefficient from the regression omitting \(q\) minus the coefficient from the regression including \(q\) must equal \(\gamma k\) in this data set.” That is generally false for realized estimates: the two regressions have different residualized error contributions. The correct statement is that \(\gamma k\) is the omitted-pattern contribution to the omitted coefficient, or the conditional expected difference under the stated zero-mean error model. Define \(\hat{\tau}_{\text{omit}}-\gamma k\) as the sensitivity-adjusted contrast, and do not claim it must equal the realized coefficient from a refitted regression.
1
Specify scenarios before interpreting results.
State each time pattern, its scale, the assumed drift magnitudes, and why those choices are plausible.
2
Calculate the allocation alignment.
For each pattern, calculate \(k=A'M_Xq/(A'M_XA)\) using the observed treatment assignments and primary-model covariates.
3
Report the shifts and limitations.
Compute \(\hat{\tau}_{\text{omit}}-\gamma k\) in outcome units, show which scenarios alter interpretation, and describe overlap and uncertainty limitations.

Check Your Understanding

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

  1. If \(k=0.25\) and the assumed drift is \(\gamma=4\) outcome points, what is the sensitivity shift in the adjusted contrast?
  2. Why is \(\gamma k\) not generally the exact difference between two realized regression coefficients?
  3. For an early-only pattern, the late-enrollment pattern is coded 0 and early enrollment 1. If early enrollment is more common among controls, what sign would \(k\) have in an intercept-only model?
  4. What does a very large absolute value of \(k\) suggest, and what does it not establish?

Solutions. 1. The shift is \(\gamma k=4(0.25)=1\) point, so the sensitivity-adjusted contrast is one point below \(\hat{\tau}_{\text{omit}}\). 2. The regression including the pattern and the regression omitting it project the realized errors differently; \(\gamma k\) is the omitted-pattern contribution, or the conditional expected difference under the specified zero-mean error assumption. 3. \(k\) is treated-group mean \(q\) minus control-group mean \(q\). Since early enrollment has \(q=1\) and is more common among controls, \(k<0\). 4. A large absolute \(k\) means the specified pattern aligns strongly with treatment after adjustment, so even moderate \(\gamma\) may shift the contrast substantially. It does not show that the drift exists, that its magnitude is plausible, or that a causal effect is present.

Clinical Biostats