Tutorials › Causal Inference › Serial Correlation and Inference in Comparative Interrupted Series

Synthetic Control and Interrupted Series · Tutorial 676 of 972

Serial Correlation and Inference in Comparative Interrupted Series

Diagnose serial correlation in comparative interrupted time-series residuals and see how correlation-aware methods change uncertainty estimates.

Advanced 12 min read

What You'll Learn

  • Define serial dependence and relate it to the uncertainty of segmented-regression estimates.
  • Calculate and interpret the Durbin–Watson statistic and residual autocorrelations.
  • Distinguish conventional, HAC, and AR(1)-based standard errors.
  • Describe assumptions and practical limits of block-based resampling.
  • Compare uncertainty estimates without confusing them with causal identification.

Why Serial Dependence Matters

In a comparative interrupted time series (CITS), observations close together in time often share influences that are not fully represented by the segmented regression. A period with unusually high residuals may be followed by another high residual, for example. This pattern is serial dependence. It matters because conventional regression standard errors generally treat errors from different time points as uncorrelated. When that assumption fails, the estimated treatment contrast may remain the same while its reported uncertainty is too small or too large.

Here, let \(D_t\) denote the treated-series outcome minus the comparison-series outcome at time \(t\). A simple segmented model for the difference is

$$ D_t=\alpha+\beta t+\tau_0 P_t+\tau_1 R_t+u_t, $$

where \(P_t\) is 0 before the intervention and 1 from the intervention onward, and \(R_t\) is 0 before the intervention and counts elapsed post-intervention time afterward. In this parameterization, \(\tau_0\) represents an immediate change in the treated-versus-comparison difference, and \(\tau_1\) represents a change in its slope. The residual \(u_t\) is the part of the observed difference not explained by the model. If the target is the relative effect \(h\) time units after intervention, its estimated value is \(\hat{\tau}_0+h\hat{\tau}_1\); its uncertainty must account for the covariance between the two estimates as well as the uncertainty in each.

Definition: Residuals have serial dependence when errors at different times are correlated, so that \(Cov(u_t,u_{t-k})\ne 0\) for at least some lag \(k\). Positive first-order dependence means adjacent errors tend to move together; negative first-order dependence means adjacent errors tend to move in opposite directions. Serial dependence is a property of the residual process after the modeled mean structure has been accounted for.

A residual time plot is a useful first check: look for long runs above or below zero, gradual waves, or repeated oscillation. The autocorrelation at lag \(k\) summarizes the association between residuals \(k\) periods apart. A residual autocorrelation plot can show whether dependence is concentrated at lag 1 or persists across several lags. These are diagnostics, not proof that a particular error model is correct. In a CITS, an omitted change in the mean pattern can also create apparent residual structure, so first check that the segmented mean model is plausible.

Worked Example: Reading the Durbin–Watson Statistic

Worked Example: Reading the Durbin–Watson Statistic

Suppose a fitted segmented model produces the five residuals \(-2,-1,0,1,2\), in time order. For a short, transparent diagnostic calculation, use the Durbin–Watson statistic

$$ DW=\frac{\sum_{t=2}^{n}(\hat{u}_t-\hat{u}_{t-1})^2}{\sum_{t=1}^{n}\hat{u}_t^2}. $$

The four adjacent differences are each 1, so the numerator is \(1^2+1^2+1^2+1^2=4\). The denominator is \((-2)^2+(-1)^2+0^2+1^2+2^2=10\). Therefore,

$$ DW=\frac{4}{10}=0.400. $$

This value is below 2 and indicates positive first-order dependence: nearby residuals move gradually in the same direction. The residuals do not alternate in sign. As a contrast, the sequence \(-1,1,-1,1,-1,1\) has five adjacent differences of magnitude 2. Its numerator is \(5(2^2)=20\), and its denominator is \(6(1^2)=6\), giving \(DW=20/6=3.33\), consistent with negative first-order dependence. These sequences illustrate the calculation; in an applied analysis, the statistic should be interpreted alongside the residual plot and model structure.

For many settings, \(DW\) is roughly related to the lag-one residual correlation by \(DW\approx 2(1-\hat{\rho}_1)\). Thus, a value near 2 suggests little first-order correlation, a value below 2 suggests positive correlation, and a value above 2 suggests negative correlation. This is a useful orientation, not a universal testing rule. The usual Durbin–Watson reference procedures have limitations, especially when the regression includes lagged dependent variables; a single statistic also cannot describe all patterns of dependence.

Why the Conventional Standard Error Can Mislead

In matrix notation, write the fitted regression as \(D=X\beta+u\). The ordinary least squares (OLS) coefficient estimator is \(\hat{\beta}=(X'X)^{-1}X'D\). Conditional on the design matrix \(X\), its variance is

$$ Var(\hat{\beta}\mid X)=(X'X)^{-1}X'\Omega X(X'X)^{-1}, $$

where \(\Omega=Var(u\mid X)\) is the residual covariance matrix. The conventional OLS standard-error formula uses the special case \(\Omega=\sigma^2 I\), which assumes equal error variances and no correlation across time. If errors are serially correlated, the off-diagonal entries of \(\Omega\) are not zero, and that formula generally does not estimate the actual sampling variance.

Justification: Since \(\hat{\beta}-\beta=(X'X)^{-1}X'u\), its conditional variance is \((X'X)^{-1}X'Var(u\mid X)X(X'X)^{-1}\). Substituting \(\Omega=\sigma^2 I\) gives \(\sigma^2(X'X)^{-1}X'X(X'X)^{-1}=\sigma^2(X'X)^{-1}\), the conventional formula. When \(\Omega\ne\sigma^2 I\), that simplification does not apply.

The direction of the error is not guaranteed in every design, but persistent positive dependence commonly makes conventional standard errors too small. That can produce confidence intervals that are too narrow and tests that reject \(H_0\) too often. Changing the standard error addresses uncertainty under a model; it does not repair a misspecified mean pattern, eliminate confounding, or establish that the CITS comparison identifies a causal effect.

Three Ways to Account for Dependence

ApproachWhat it doesKey conditions and cautions
HAC standard errorsKeep the OLS coefficient estimates and estimate their covariance allowing heteroskedasticity and autocorrelation up to a selected range of lags.Requires a suitable bandwidth and enough time points for its large-sample approximation; can be unreliable in short series.
AR(1) generalized least squaresModel errors as a first-order autoregressive process and use the estimated covariance structure when fitting the regression.Relies on the AR(1) structure being adequate and on a stable error process; a wrong structure can mislead.
Block-based resamplingResample consecutive time points together so resampled data retain local dependence, then refit the model repeatedly.Block length and stationarity matter; resampling isolated time points would discard the dependence being addressed.

A heteroskedasticity-robust standard error by itself is not generally serial-correlation robust. A heteroskedasticity-and-autocorrelation-consistent (HAC) estimator, often implemented with Newey–West weights, estimates the coefficient variance using products of residuals at nearby time points as well as same-time residuals. A schematic “meat” component is

$$ \widehat{S}=\sum_t x_t x_t'\hat{u}_t^2+ \sum_{k=1}^{L}w_k\sum_{t=k+1}^{n} \left(x_t\hat{u}_t x_{t-k}'\hat{u}_{t-k} +x_{t-k}\hat{u}_{t-k}x_t'\hat{u}_t\right), $$

where \(x_t\) is the model’s regressor vector at time \(t\), \(L\) is the maximum lag included, and \(w_k\) are lag weights. One common choice is \(w_k=1-k/(L+1)\). The complete sandwich estimate multiplies \(\widehat{S}\) on the left and right by \((X'X)^{-1}\). The lag choice should reflect the sampling interval and plausible persistence, while avoiding an unnecessarily large number of noisy lag terms. HAC inference is usually justified by large-sample conditions for a weakly dependent process; it is not an automatic small-sample correction.

An alternative is to model the covariance explicitly. Under a stationary AR(1) error model,

$$ u_t=\phi u_{t-1}+\eta_t,\qquad |\phi|<1, $$

where the innovations \(\eta_t\) are uncorrelated over time and have constant variance. This implies \(Corr(u_t,u_{t-k})=\phi^k\). Generalized least squares (GLS) uses the covariance matrix implied by the fitted \(\phi\) to estimate the regression and its uncertainty. An AR(1) model is appealing when that pattern is credible, but it should not be selected merely because it yields a preferred p-value. Residual diagnostics should be repeated after fitting, and additional dependence patterns may require a different model.

Worked Example: Comparing Conventional and HAC Inference

Worked Example: Comparing Conventional and HAC Inference

Consider a hypothetical CITS with 120 monthly observations. The estimated immediate change in the treated-versus-comparison difference is \(6.0\) cases per 100,000 people. Suppose the conventional standard error is \(1.5\), while a prespecified HAC calculation gives \(3.0\) cases per 100,000. The residual plot also shows persistent adjacent values, making the independence assumption for the conventional standard error questionable.

Using the large-sample normal reference, the HAC test statistic for \(H_0:\tau_0=0\) is \(z=6.0/3.0=2.00\). The two-sided p-value is approximately \(0.0455\). The 95% confidence interval is

$$ 6.0\pm 1.96(3.0)=6.0\pm5.88=(0.12,\ 11.88) $$

cases per 100,000 people. Under this model and approximation, the data are just beyond the conventional 5% two-sided threshold, and the interval ranges from 0.12 to 11.88 cases per 100,000. It does not mean there is a 95% probability that the fixed parameter lies in this particular interval.

For comparison, the conventional calculation gives \(z=6.0/1.5=4.00\), with a two-sided normal-reference p-value of about \(0.000063\), and a 95% interval \(6.0\pm1.96(1.5)=(3.06,8.94)\) cases per 100,000. The point estimate is unchanged, but the uncertainty differs substantially. These calculations assume that the stated standard errors are valid for their respective procedures; a real analysis should also assess model fit, the number of time points, and whether the chosen reference distribution is reasonable.

Block-Based Resampling

Block methods offer another way to reflect temporal dependence. In a residual moving-block bootstrap, the analyst fits the segmented model, centers its residuals as appropriate, and samples consecutive residual blocks rather than individual residuals. The sampled residual sequence is combined with the fitted mean structure to form a bootstrap outcome series; the model is refitted, and the coefficient or treatment-effect contrast is recorded. Repeating this process yields an empirical distribution for the statistic. Percentile intervals can be formed from the corresponding quantiles, while the standard deviation of bootstrap estimates can estimate a standard error.

The block length is a substantive and statistical choice. Very short blocks may break important dependence; very long blocks leave few distinct blocks to resample. The residual process should be sufficiently stable for the resampling scheme. If residual behavior differs across time or across the intervention boundary, a scheme that treats those periods as exchangeable may be inappropriate. Resampling should preserve the relevant time ordering and the design’s intervention structure, not shuffle dates or erase the interruption.

Worked Example: Calculating a Block-Bootstrap Standard Error

Worked Example: Calculating a Block-Bootstrap Standard Error

Suppose a hypothetical moving-block procedure produces five refitted estimates of the relative treatment effect, in cases per 100,000: \(4.1,4.8,5.0,5.7,6.4\). This very small set is for illustrating the arithmetic only; it is not enough resamples for dependable applied inference.

The mean of the five estimates is \((4.1+4.8+5.0+5.7+6.4)/5=5.2\). Their squared deviations from 5.2 sum to

$$ (4.1-5.2)^2+(4.8-5.2)^2+(5.0-5.2)^2+(5.7-5.2)^2+(6.4-5.2)^2 =1.21+0.16+0.04+0.25+1.44=3.10. $$

The sample standard deviation of the bootstrap estimates is therefore

$$ SE_{\mathrm{boot}}=\sqrt{\frac{3.10}{5-1}}=\sqrt{0.775}=0.880 $$

cases per 100,000. This is the bootstrap standard-error calculation for these five estimates, not a reliable final uncertainty assessment. In practice, many more replications are used, and percentile intervals or other bootstrap intervals may be reported if the method’s assumptions are credible. The choice of block length should be examined for sensitivity.

Common Mistakes and Practical Interpretation

  • Reading the Durbin–Watson direction backward. A value below 2 is associated with positive first-order dependence, not negative dependence; a value above 2 is associated with negative first-order dependence. Check the residual sequence and the statistic’s definition.
  • Using a heteroskedasticity-only correction for autocorrelation. Robustness to unequal variances does not by itself account for correlation between different months. Use a method whose covariance calculation addresses serial dependence.
  • Assuming every correction is interchangeable. HAC inference, AR(1) GLS, and block resampling make different assumptions. Report the method and relevant choices, and assess whether they match the residual process and series length.
  • Treating a larger standard error as a causal fix. A correlation-aware uncertainty estimate does not remove bias from an inappropriate comparison, an incorrect mean model, or other identification failures.

The aim is not to choose whichever method produces the narrowest interval. Inspect the fitted residuals, state the dependence structure or resampling scheme, and compare reasonable uncertainty analyses. If substantive conclusions change across plausible approaches, that sensitivity is important evidence about how much the data support the estimated effect. The estimate and its uncertainty remain conditional on the CITS design and its identifying assumptions.

Check Your Understanding

Answer each question using the definitions and calculations in this tutorial.

  1. What pattern of adjacent residuals is consistent with positive first-order dependence, and what Durbin–Watson values are associated with positive and negative first-order dependence?
  2. Why can serial correlation make the conventional OLS standard error inappropriate even when the OLS coefficient estimate is unchanged?
  3. How does a HAC standard error differ from a heteroskedasticity-only robust standard error?
  4. Name one assumption of an AR(1) error model and one reason that an AR(1) GLS analysis might be unsuitable.
  5. Why must a block bootstrap resample consecutive time points rather than individual residuals independently?
  6. Does using a serial-correlation-robust standard error establish that the CITS effect is causal? Explain.
Clinical Biostats