AdvancedIndependently reviewed, not yet spot-checked by a human

Interrupted time series and difference-in-differences

A policy goes live in a particular month and the indicator moves — how much of that belongs to the policy? This page puts two answers on one dataset: ITS extends the pre-intervention trend to build a counterfactual, DiD borrows one from a control series the policy could not touch. It also covers level versus slope, what an unsubtracted seasonal cycle does to the estimate, why a pre-trend check can refute parallel trends but never establish them, and how a panel of negative controls with known null effects measures residual bias directly.

A policy went live. Now what?

Three settings in Taiwan produce this question shape more often than any other: National Health Insurance moving a drug or a test from out-of-pocket to reimbursed, a hospital rolling out an infection-control bundle, and the wholesale displacement of care-seeking during COVID. All three look the same on paper — one time point, one intervention, one monthly indicator, and then somebody asks how much it fell.

The cheapest answer is a before-after comparison: the mean before, the mean after, divided. On this dataset that is 873 against 571 casualties a month, a ratio of 0.654 (95% CI 0.642–0.665), and it looks tidy.

Its problem is not precision. It charges the whole of an already-moving trend to the policy. If the indicator was falling anyway, a before-after comparison books that fall as the policy’s achievement; if the indicator has a seasonal cycle and the intervention lands on the boundary between a high season and a low one, a before-after comparison can get the direction wrong.

The two methods on this page differ in exactly one thing: where the counterfactual comes from.

  • Interrupted time series (ITS) extends the pre-intervention trend and treats it as where the indicator would have gone had the policy never arrived. The counterfactual is extrapolated.
  • Difference-in-differences (DiD) finds a control series the policy cannot reach and uses its change over the same period as the counterfactual. The counterfactual is borrowed.

Neither conjures a control group from nothing. ITS bets that a trend continues; DiD bets that two series would have kept moving in parallel. This page places both bets on one dataset so you can see what the extra control series buys and what it costs.

The data on this page

datasets::Seatbelts ships with base R — data(Seatbelts) is the whole acquisition step. It holds 192 months of UK road-casualty data from 1969-01 to 1984-12, and it happens to carry both an intervention series and a natural control series:

  • front — front-seat casualties. The 1983 compulsory seat belt law covered front seats.
  • rear — rear-seat casualties. Same cars, same roads, same economy, but the law did not reach the back seat.

One more thing has to be handled first. Distance driven rose from 14463 to 18890 per month across the transition, an increase of 30.6%. Leave it out of the model and more driving, therefore more collisions gets folded into the effect of the law. Every model on this page therefore carries offset(log(kms)), which turns the outcome from casualties per month into casualties per unit distance — the offset described on the Poisson regression page.

The empirical-calibration section at the end of this page uses simulated data rather than Seatbelts; that section says so again at its start.

Interrupted time series: extending the pre-intervention trend

An ITS is a regression with two extra terms. Written as a Poisson model:

logE[Yt]  =  β0  +  β1t  +  β2lawt  +  β3tslt  +  β4Xt  +  log(kmt)\log \mathbb{E}[Y_t] \;=\; \beta_0 \;+\; \beta_1 t \;+\; \beta_2 \,\mathrm{law}_t \;+\; \beta_3 \,\mathrm{tsl}_t \;+\; \beta_4 X_t \;+\; \log(\mathrm{km}_t)
  • tt is the month index and β1\beta_1 is the pre-intervention secular trend — the term a before-after comparison lacks.
  • lawt\mathrm{law}_t is an indicator that switches on at the intervention, and β2\beta_2 is the level change: the step at the moment of the intervention.
  • tslt\mathrm{tsl}_t counts months elapsed since the intervention and is 0 before it, so β3\beta_3 is the slope change: how much further the indicator moves each month relative to the old trend. In the code on this page tsl is already 1 in the intervention month itself, so exp(β2)\exp(\beta_2) is the step read at tsl=0\mathrm{tsl} = 0 while the ratio actually observed in the first post-intervention month is exp(β2+β3)\exp(\beta_2 + \beta_3). Reporting exp(β2)\exp(\beta_2) as the level change is the usual convention, but the coding moves a small amount between the step and the slope, so the Methods have to say which one was used.
  • XtX_t is a time-varying covariate; here it is petrol price.

Level and slope answer two different clinical questions. A level change asks what changed the moment this happened — regulations, reimbursement rules and other switch-like interventions usually look like this. A slope change asks what this did to the trajectory afterwards — education, training and anything that diffuses gradually usually looks like that. One intervention can produce either, or both.

An interrupted time series of UK front-seat casualties. The horizontal axis is the calendar year, labelled every three years from 1969 to 1984; the vertical axis is front-seat casualties per month, standardised to the mean distance driven. Pale red dots are the monthly observations: before the intervention they scatter between roughly seven hundred and twelve hundred with a visible seasonal swing, higher in winter and lower in summer, and after it they drop to around five hundred. A dark dashed vertical line marks the month the law came into force, labelled law in force 1983-02. The dark red solid line is the fitted segmented regression: the segment to the left of the dashed line drifts slowly downward, drops a step at the line, and the segment to its right starts from a much lower position and then drifts slowly upward. A grey-brown dashed line continues the left-hand segment across to the end of the series — that is the counterfactual, where the pre-intervention trend would have gone had the law never arrived, and every post-intervention observation and fitted value sits well below it. A three-row legend at bottom left identifies the dots as observations standardised to mean distance driven, the solid line as the fitted segmented regression, and the dashed line as the pre-intervention trend carried forward. Two lines of text above the plot state that this is a Poisson ITS on datasets::Seatbelts with a log(kms) offset and petrol price held at its mean, and report a level RR of 0.680 (0.654–0.707) with a monthly slope RR of 1.0123.
The counterfactual in an ITS is the grey-brown dashed line: the pre-intervention trend carried forward unchanged. The level RR of 0.680 (95% CI 0.654–0.707) measures the gap between the solid line and the dashed one at the moment of the intervention.Plotting script figures/scripts/B6-10-its-did.R

The fitted level change is RR 0.680 (95% CI 0.654–0.707, p < 0.0001) — at the moment the law took effect, front-seat casualties fell about 32.0% relative to the counterfactual. The slope change is RR 1.0123 per month (95% CI 1.010–1.015), which is above 1: the monthly trajectory after the law tilts upward relative to the one before it.

A before-after comparison is not an interrupted time series

Put the model beside the before-after ratio from the top of this page:

ApproachEstimate95% CIWhat it can separate
Before-after ratio, no time term0.6540.642–0.665Nothing. One number is all it has
ITS: trend + level + slope0.6800.654–0.707Secular trend, level change and slope change, one coefficient each

The two numbers are not far apart, which is luck rather than reassurance — the pre-intervention trend in this series happens to be shallow. The real difference is in the last column. A before-after ratio cannot tell you whether this was a step or a change of direction, and that is precisely what clinical readers want to know. A policy that knocks an indicator down one notch and then lets it climb again calls for different follow-up from a policy that bends the whole trajectory.

There is a second, invisible cost: a before-after ratio cannot be caught out by its own figure. An ITS plot carries a counterfactual line the reader can judge for plausibility. Two means offer nothing to disagree with.

Whatever you fail to subtract gets charged to the policy

This is the most practical section on the page. Same level change, adjustment terms removed one at a time:

ModelLevel RR95% CIMonthly slope RRAIC
Adjusted (petrol price + distance offset)0.6800.654–0.7071.01235204
No petrol price (distance offset kept)0.6650.640–0.6911.01295330
No distance offset (petrol price kept)0.6820.657–0.7091.01364719
Neither (counts only)0.6600.635–0.6851.01444988
Adjusted + calendar month0.7390.711–0.7681.00622941
(Reference) before-after ratio, no time term0.6540.642–0.665

The first thing worth noticing runs against intuition. Dropping petrol price and the distance offset moves the estimate only between 0.660 and 0.682, a spread of 3.4%, with heavily overlapping intervals. On this dataset, whether you adjusted for petrol price cannot change the conclusion. That point was originally planned as this page’s headline lesson and the numbers overturned it once the script actually ran.

What does change the conclusion is seasonality. Add calendar month and the level change moves from 0.680 to 0.739 (95% CI 0.711–0.768) — an interval that does not overlap the fully adjusted model’s 0.654–0.707. AIC falls at the same time from 5204 to 2941, a drop of 2263, which says the seasonal cycle was the largest piece of structure the other models were ignoring.

The reason is not mysterious. Road casualties have a strong within-year cycle — short winter days, worse weather, more casualties — and the law arrived in 1983-02, so the 23 post-intervention months do not cover the same mix of calendar months as the 169 months before them. Without a calendar-month term, that seasonal difference is charged to the law.

The placebo series: the line the law could not reach

The great weakness of an ITS is that it has no control group — its control is the same population’s own past. So anything else that changed the indicator in the same month (another policy, an oil shock, a change of coding rules) is indistinguishable from the intervention.

Seatbelts offers a clean check: run exactly the same model on rear. Rear-seat casualties share the season, the petrol price and the distance driven, but the law did not cover them. That makes rear-seat casualties a negative control outcome: if the model is right, no level change should appear here.

SeriesModelLevel RR95% CIp
Front seats (law applies)Fully adjusted0.6800.654–0.707< 0.0001
Rear seats (placebo)Fully adjusted0.9630.919–1.0080.1072
Rear seats (placebo)Unadjusted, counts only0.9530.910–0.9980.0400

The fully adjusted placebo series gives a level RR of 0.963 with a 95% CI of 0.919–1.008, which crosses 1: not statistically significant. That row is the most valuable line on this page. The law really did reach only the front seats, and the reader can now see that as evidence in a table rather than take it as the author’s assertion.

The wording has to stay precise. That row says no level change was detected in these data, not rear-seat casualties did not change. The lower confidence limit reaches 0.919, so a genuine reduction of roughly 8.1% remains compatible with the data. Claiming that the rear seats were unaffected would require a pre-specified equivalence margin, not an interval that happens to cross 1.

The third row carries a bonus lesson: the same placebo series turns significant when it is left unadjusted (RR 0.953, 95% CI 0.910–0.998, p = 0.0400). A placebo test is itself sensitive to model specification. It is not free insurance — a badly specified placebo test hands out false reassurance as readily as false alarms.

The full taxonomy of negative controls — what a negative control exposure and a negative control outcome can each refute, and how to read one that is not null — is on the instrumental variables page. The last section here takes the same idea and scales it to dozens of outcomes.

Difference-in-differences: borrowing the counterfactual

With rear in hand, a placebo test is not the only thing available. Stack the two series into long format, add a group indicator, and the counterfactual switches from extrapolated to borrowed:

logE[Ygt]  =  α0  +  α1grpg  +  α2lawt  +  α3(grpg×lawt)  +  α4t  +  α5Xt  +  log(kmt)\log \mathbb{E}[Y_{gt}] \;=\; \alpha_0 \;+\; \alpha_1 \,\mathrm{grp}_g \;+\; \alpha_2 \,\mathrm{law}_t \;+\; \alpha_3 \,(\mathrm{grp}_g \times \mathrm{law}_t) \;+\; \alpha_4 t \;+\; \alpha_5 X_t \;+\; \log(\mathrm{km}_t)

α3\alpha_3, the interaction, is the DiD estimate: the treated group’s change across the intervention, minus the control group’s change over the same period. Anything that hit both groups — petrol, weather, the economy, a change of coding rules — cancels in the subtraction. That cancellation is what the control series buys.

Two monthly casualty series drawn on one set of axes. The horizontal axis is the calendar year, labelled every three years from 1969 to 1984; the vertical axis is casualties per month, with both series standardised to the mean distance driven. A thin red line traces monthly front-seat casualties, running distinctly higher with a large saw-toothed seasonal swing; a thin blue-grey line traces monthly rear-seat casualties, running lower and swinging less. Two heavy lines are the corresponding twelve-month moving averages: the heavy red one drifts slowly downward across the whole period, the heavy blue-grey one stays roughly flat. A dark dashed vertical line marks the month the law came into force, labelled law in force 1983-02. To the right of that line the red series drops markedly while the blue-grey one does not follow, so the previously wide gap between the two series narrows there. A two-row legend at top right distinguishes front seats, where the law applies, from rear seats, where it does not. Two lines of text above the plot state that both series are standardised to mean distance driven and that the heavy lines are twelve-month moving averages, and report a DiD interaction RR of 0.642 (0.624–0.660) with the front-to-rear gap closing only after the law.
DiD reads the gap between the two lines and asks how it changed. The interaction RR of 0.642 (95% CI 0.624–0.660) is the factor by which that gap moved across the intervention.Plotting script figures/scripts/B6-10-its-did.R

All three coefficients are worth unpacking, because papers routinely print only the interaction row and readers never learn what the other two were doing:

CoefficientRR95% CIWhat it says
Group main effect2.1822.162–2.202How many times higher front-seat casualties were before the law. DiD does not require the two groups to match here
Period main effect1.1901.162–1.218The control series’ own change after the intervention — the borrowed counterfactual
Interaction (the DiD estimate)0.6420.624–0.660How much further the front seats moved than the rear seats did

The group main effect of 2.182 says front-seat casualties were already more than twice rear-seat casualties before the law. DiD does not require the two groups to be at the same level, only that their trends would have moved in parallel. That is the sharpest difference between DiD and the matching and weighting methods, and the point most often misread.

DiD trades extrapolation for a control series, and the price is a new assumption: parallel trends — that absent the policy, the gap between the two series would have stayed put.

The assumption cannot be verified, because it describes a world that did not happen. What can be done is a pre-trend check: split the pre-intervention period into bins, estimate a treated-versus-control value in each, and see whether they all sit near 1. That is an event-study plot.

A plot of the front-to-rear ratio in each pre-intervention year. The horizontal axis is the pre-law calendar year, labelled from 1969 through 1982; the vertical axis is the front-versus-rear rate ratio on a logarithmic scale. Each year is one point with a vertical confidence interval; the reference year 1982 is drawn as an open circle fixed at 1 with no interval. A horizontal dashed line marks 1. The four years from 1969 to 1972 sit clearly above 1, between 1.143 and 1.174, with intervals entirely above the line; 1973 and 1974 step down but their intervals still exclude 1; from 1975 onward most points lie near 1, with the intervals for 1975, 1976 and 1981 covering it while 1977 through 1980 tilt up again and exclude it. The overall shape is not a flat line at 1 but an elevated early stretch that only levels off later. Three lines of text above the plot state that these are pre-law group-by-year interactions, report the joint test that all of them are zero as chi-squared 129.6 on 13 degrees of freedom with p < 0.0001, note that 10 of the 13 non-baseline years exclude 1 and that the open circle is the reference year, and warn that a flat plot cannot prove parallel trends but only fail to refute them.
The front-to-rear ratio in each pre-intervention year. 10 of the 13 non-baseline years have intervals excluding 1, and the joint test is chi-squared 129.6 on 13 degrees of freedom, p < 0.0001. This plot refutes parallel trends over the full period.Plotting script figures/scripts/B6-10-its-did.R
YearFront vs rear RR95% CIInterval
19691.1521.098–1.209Excludes 1
19701.1741.120–1.232Excludes 1
19711.1431.090–1.199Excludes 1
19721.1681.114–1.225Excludes 1
19731.0791.029–1.131Excludes 1
19741.0571.007–1.110Excludes 1
19751.0030.954–1.054Covers 1
19761.0380.988–1.092Covers 1
19771.0971.044–1.154Excludes 1
19781.0891.036–1.144Excludes 1
19791.0891.036–1.144Excludes 1
19801.0561.005–1.110Excludes 1
19811.0180.968–1.070Covers 1
1982Reference year (fixed at 1)

The result is unambiguous, and for this page it is good news: 10 of the 13 non-baseline years have intervals that exclude 1, and the joint test that all of them are zero gives chi-squared 129.6 on 13 degrees of freedom, p < 0.0001. Across 1969 to 1972 the front-to-rear ratio ran at 1.143 to 1.174 times its baseline value; only after 1975 does it settle.

So the DiD estimate of 0.642 on this page cannot be presented as more trustworthy than the ITS estimate of 0.680. The honest formulation is that the pre-trend check refutes parallel trends over the full period and only the later stretch is defensible. A DiD here should either restrict the sample to that stretch or move to a specification that allows differential trends — and either decision belongs in the Methods.

How to compute it

All four models are base R glm() with no extra packages.

data(Seatbelts)
d <- as.data.frame(Seatbelts)
d$time <- seq_len(nrow(d))
d$mon  <- (d$time - 1) %% 12 + 1
d$month <- factor(d$mon)

# Derive the intervention index from the data; never hard-code a month. The
# effective date in a policy circular and the month the database actually
# turns are routinely one or two months apart.
law_idx <- which(d$law == 1)[1]

# Months elapsed since the intervention, 0 before it. This coding makes the
# `law` coefficient the step AT the transition and `tsl` the change in slope
# after it; shifting the origin by one month moves value between the two.
d$tsl <- pmax(0, d$time - law_idx + 1)

# --- 1. ITS on the front seats --------------------------------------------
its <- glm(front ~ time + law + tsl + PetrolPrice + offset(log(kms)),
           data = d, family = poisson())
exp(cbind(RR = coef(its), confint.default(its)))["law", ]

# --- 2. Seasonality: add calendar month. The term that moves the answer ----
its_season <- glm(front ~ time + law + tsl + PetrolPrice + month +
                    offset(log(kms)), data = d, family = poisson())
exp(coef(its_season)["law"])

# --- 3. Placebo series: the identical model on the rear seats -------------
# The law did not cover rear seats. A level change here means the model is
# picking up something other than the law.
placebo <- glm(rear ~ time + law + tsl + PetrolPrice + offset(log(kms)),
               data = d, family = poisson())
exp(cbind(RR = coef(placebo), confint.default(placebo)))["law", ]

# --- 4. DiD: stack the two series into long format ------------------------
long <- rbind(
  data.frame(y = d$front, grp = 1L, d[, c("time", "law", "kms", "PetrolPrice")]),
  data.frame(y = d$rear,  grp = 0L, d[, c("time", "law", "kms", "PetrolPrice")])
)
did <- glm(y ~ grp * law + time + PetrolPrice + offset(log(kms)),
           data = long, family = poisson())
exp(cbind(RR = coef(did), confint.default(did)))["grp:law", ]

# --- 5. The pre-trend check (event study) ---------------------------------
# Pre-intervention data only, one grp x year interaction per year.
pre <- subset(long, law == 0 & time < law_idx)
pre$year <- 1969 + (pre$time - 1) %/% 12
pre$yf <- relevel(factor(pre$year), ref = "1982")   # last complete pre-law year
es <- glm(y ~ grp + yf + grp:yf + PetrolPrice + offset(log(kms)),
          data = pre, family = poisson())

# Joint test that every pre-intervention interaction is zero. Rejecting it
# refutes parallel trends; failing to reject does NOT establish them.
es_null <- glm(y ~ grp + yf + PetrolPrice + offset(log(kms)),
               data = pre, family = poisson())
anova(es_null, es, test = "LRT")

Verified with R 4.6.0 and jsonlite 2.0.0. Seatbelts ships with base R; data(Seatbelts) is the whole acquisition step.

ITS and DiD side by side: what a control series buys

ITSDiD
Where the counterfactual comes fromExtrapolating the pre-intervention trendBorrowed from a control series
Core assumptionAbsent the intervention, the pre-intervention trend would have continuedAbsent the intervention, the gap between the groups would have stayed put
Estimate on this page0.680 (0.654–0.707)0.642 (0.624–0.660)
Can the assumption be pre-tested?Not directly; placebo series and multiple intervention points give indirect evidenceAn event study can, but it can only refute, never establish
What the check found hereNo level change detected in the placebo series, consistent with a front-seat-only effectThe pre-trend check refutes parallel trends over the full period
How it breaksA second intervention at the same time, a change of case definition, a trend about to turn anywaySpillover onto the control group, the two groups facing different shocks, or units adopting the policy at different times (see the staggered-adoption warning above)

The two estimates differ by 0.038, with the DiD estimate the further from 1 — that is, the larger reduction (0.642 against 0.680). The source of the gap is visible: the DiD period main effect of 1.190 is above 1, so the borrowed counterfactual says the indicator should have risen over that window, and the front seats therefore have to fall further relative to it.

That does not make DiD the better answer here. It means the two methods disagree about what would have happened, and on this dataset the assumption behind the DiD answer failed its pre-test. What the control series buys is cancellation of common shocks; what it costs is a requirement that the relative trajectory of the two series be stable, and here it is not.

Common practice is to report both — one as the primary analysis and the other as a sensitivity analysis — and to say explicitly that their assumptions differ, so that agreement is support and disagreement is something to explain. Reporting only one, without mentioning the other, leaves the reader unable to judge how sensitive the conclusion is to the choice of method.

Negative controls and empirical calibration

A single negative control outcome — rear, above — answers whether there is bias. A panel of them answers a harder question: how large the bias is and in which direction.

A two-panel figure of simulated results. The left panel is titled as a simulated negative-control panel, with a subtitle giving the random seed and the number of subjects. Its horizontal axis is the estimated rate ratio on a logarithmic scale and its vertical axis is the standard error with the direction reversed, so the most precise estimates sit at the top — the conventional layout for this plot. 39 blue-grey filled circles are the negative-control estimates, whose true value is 1 in every case, yet the whole cloud sits noticeably to the right of 1. A dark solid vertical line marks 1 and a red dashed vertical line marks the fitted centre of the null distribution, labelled null centre RR 1.316; the distance between the two lines is the residual bias. A red filled triangle marks the outcome of interest, further right than any negative control. A four-row legend at bottom left identifies the negative controls with their true RR of 1, the outcome of interest with its true RR of 2.0, the line at RR equal to 1 where the nulls belong, and the fitted null centre as the estimate of residual bias. The right panel is titled as the outcome of interest and is a two-row forest plot: the upper row is the uncalibrated estimate of 2.99 with an interval from 2.72 to 3.29, lying entirely to the right of the truth; the lower row is the calibrated estimate of 2.27 with an interval from 1.77 to 2.91, visibly wider and covering the truth. A dashed vertical line marks the true RR of 2.0. Two subtitle lines report that calibration widens the interval by a factor of 2.6 and that coverage among the nulls goes from 12.8% to 94.9%.
Simulated. Left: 39 negative controls whose true RR is 1, sitting as a cloud to the right of 1, with a fitted null centre of RR 1.316. Right: subtracting that offset widens the interval for the outcome of interest by a factor of 2.6 and brings it to cover the true RR of 2.0.Plotting script figures/scripts/B6-10-its-did.R

The cloud in the left panel is the whole argument. All 39 of those outcomes have a true RR of 1, so an unbiased analysis would scatter them either side of 1. Instead the cloud sits to the right, with a fitted null-distribution centre of RR 1.316 — off 1 by 31.6% — and a spread (tau, on the log scale) of 0.117.

One number is sharper still: 34 of the 39 negative controls have a 95% CI that excludes 1. Read conventionally, those 34 significant associations would all be believed, and every one of them has a true RR of 1. Intervals labelled 95% achieve actual coverage of 12.8%.

UncalibratedCalibratedNominal / true
Coverage of the negative controls’ 95% CIs12.8%94.9%95.0%
RR for the outcome of interest2.992.272.0
95% CI for the outcome of interest2.72–3.291.77–2.91Has to cover 2.0

The calibration itself is simple: on the log scale, subtract the fitted offset mu from every estimate and replace the standard error with the square root of the original variance plus tau squared. Three things then happen at once:

  1. Coverage among the negative controls returns from 12.8% to 94.9%, which is what the nominal level promised.
  2. The outcome of interest moves from 2.99 (95% CI 2.72–3.29, which misses the true value of 2.0) to 2.27 (95% CI 1.77–2.91, which covers it).
  3. The price is an interval 2.6 times wider. Calibration does not make you more certain. It makes your certainty honest.

Questions to ask of a policy-evaluation paper

When a title says an indicator fell by so much after a policy, four questions dispose of most of the doubt:

  1. Who is the control group? An ITS uses the same population’s own past; a DiD uses another group over the same period. A paper that does not say which cannot be evaluated. If it is a DiD, the reason the control group is beyond the policy’s reach has to be argued.
  2. Was the parallel-trends assumption checked? Is there an event-study plot, or only a sentence saying the check was not significant? The second reads low power as proof.
  3. Were seasonality and the secular trend subtracted? On this page, one calendar-month term moved the level change from 0.680 to 0.739, with intervals that do not overlap.
  4. Is there a negative control or placebo series? An outcome or a group the policy could not reach is the cheapest and most convincing check available.

Two more details that get skipped: how the intervention month was defined (the circular’s date and the database’s turning point are routinely a month or two apart), and whether autocorrelation was handled (if not, the standard errors are optimistic and the intervals too narrow).

Common misuses

MisuseWhy it is wrong
Claiming a policy effect from a before-after comparison of meansCharges an already-moving trend entirely to the policy
Reporting the level change without the slope changeReaders assume the drop persisted, when it may rebound inside the observation window
Reporting a slope change from only a few post-intervention monthsThe slope is the most fragile estimate in the model and a short window cannot support it
Leaving seasonality unadjustedUnless the post-intervention window is a whole number of years, the seasonal difference is charged to the policy
Hard-coding the intervention month from the policy circularThe database usually turns one or two months later, putting a transition month on the wrong side
Treating unequal group levels as a problem for DiDDiD requires parallel trends, not equal levels
Reading a flat event-study plot as proof of parallel trendsThe plot can refute the assumption but never establish it, and a null result may just be low power
Reporting DiD unchanged after the pre-trend check failsAt minimum, restrict the period or change the specification, and put that decision in the Methods
Using a control series the policy reaches indirectlySpillover dilutes the true effect and biases the DiD estimate toward the null
Applying this 2×2 DiD when units adopt the policy at different timesUnder staggered adoption a two-way fixed-effects DiD uses already-treated units as controls; when the effect changes over time this can produce negative weights and even the wrong sign
Not inspecting the residuals for autocorrelationStandard errors come out optimistic and intervals narrower than they should be
Reading the standard errors straight off a GLM fitted to two stacked seriesThe two rows for the same month are not independent observations, so the intervals come out too narrow
Reporting only the ITS or only the DiD, without mentioning the otherTheir assumptions differ, so the reader cannot judge how sensitive the conclusion is
Reading a non-significant placebo series as no effect at allNot detected is not absent; claiming equivalence needs a pre-specified margin
Running a database study with no negative controls at allResidual bias is the norm in these data, and without negative controls there is no way to measure it

How this page relates to the others

  • Where you meet it clinically — see database and claims-data studies. Any trend analysis across years has to check the reimbursement policy history, and a policy change is itself something the methods on this page can estimate.
  • The underlying model — see Poisson regression and incidence rates. Every model here is a Poisson GLM with an offset, and each exponentiated coefficient is a rate ratio.
  • Another design where people serve as their own controls — see self-controlled designs. It places the control window inside the same person’s own follow-up, which is the same family of idea as using a whole series’ past.
  • The language of counterfactuals and identifying assumptions — see causal diagrams and the backdoor criterion and target trial emulation. Parallel trends is a counterfactual assumption, unverifiable in exactly the way exchangeability is.
  • The full taxonomy of negative controls — see instrumental variables.
  • Time-related traps — see time-varying covariates. Policy-evaluation data often carry a time-varying exposure and time-varying confounding at once.

Rerunning every number on this page

/opt/homebrew/bin/Rscript figures/scripts/B6-10-its-did.R

Read the figure

The answer comes from the same statistical output that produced this page's figures, not from a number typed in beside them.

For the same step change, dropping petrol price and the distance offset moves the estimate only between 0.660 and 0.682; adding calendar month moves the step from 0.680 to 0.739. What does that say?

Show the answer and why

Correct answer: Seasonality is the largest piece of structure this analysis was ignoring: with calendar month in, the step is 0.739 and its interval does not overlap the fully adjusted model

Road casualties have a strong within-year cycle, the law arrived in February, and the months covered by the post-law window are not the same mix as the months before it - without calendar month in the model, that seasonal difference is booked to the law. So the step moves from 0.680 to 0.739 and the two intervals do not overlap. Conversely, the whole span from 0.660 to 0.682 is the entire influence of the three petrol and distance variants, with heavily overlapping intervals: in these data, whether petrol price is adjusted for cannot change the conclusion. The lesson is not that more adjustment is safer but that the right adjustment matters - which term matters is a property of the data, and almost any monthly health indicator has a seasonal cycle.

Running the identical model on rear-seat casualties, the series the law does not touch, gives a step of 0.963 with a 95% CI from 0.919 to 1.008. How should that row be written up?

Show the answer and why

Correct answer: No step change in rear seats was detected in these data, noting that the lower limit reaches 0.919, so a real reduction of about 8% remains compatible with them

This is the most valuable row on the page, but what it says is not detected rather than absent. The interval around 0.963 crosses the null and its lower limit reaches 0.919, so a real reduction of nearly a tenth is still compatible with these data; claiming rear seats were unaffected would require a pre-specified equivalence margin. The value 0.953 is the same placebo series under the unadjusted model, and its interval excludes the null - that is, it is significant. A placebo test is itself sensitive to model specification, and a badly specified one hands out false reassurance and false alarms alike; it is not evidence that the law spilled over.

In the pre-law event study of front-seat against rear-seat casualties, 10 of the 13 non-baseline years have intervals excluding the null. What does that say about the DiD estimate?

Show the answer and why

Correct answer: The pre-test refutes parallel trends over the whole period - the earliest year alone sits at 1.152 times the baseline year

An event study checks whether the relative path of the two series was stable before the intervention, and 10 of the 13 non-baseline years have intervals excluding the null, with the earliest year as high as 1.152 times the baseline; the series only flattens in the later stretch. That refutes parallel trends across the whole period, so 0.642 cannot be presented as more credible than the ITS figure of 0.680. But refuted is not the same as useless: the honest response is to restrict the sample to the later stretch where the assumption holds up, or move to a specification that allows differing trends, and to write that decision into the Methods. Conversely, the pre-law shape is not background irrelevant to DiD - the entire counterfactual is borrowed from the control series, and this figure is what says whether the loan is sound.

The ITS step is 0.680 and the DiD estimate is 0.642. Where does that gap come from?

Show the answer and why

Correct answer: From the borrowed counterfactual: the DiD period main effect is 1.190, meaning the control series says this stretch should have risen anyway, so the front seats have that much further to fall relative to it

The two methods give different answers to what would have happened anyway. ITS extrapolates the pre-law trend; DiD borrows from the control series, and the control series says the post-law stretch should have risen - the period main effect of 1.190 is above the null - so front seats must fall further relative to it, which is why 0.642 sits further from the null than 0.680. The value 2.182 is the group main effect, the fixed gap between front and rear, and that is precisely what the difference in differences cancels; it never enters the policy effect. The value 1.012 is the ITS monthly slope change, the amount by which each month moves faster after the law than before it, and the DiD model carries a time term too, so this is not a question of one modelling trend and the other not. The gap itself does not make either method better; it says their assumptions differ, and in these data the DiD assumption failed its pre-test.

Across 39 negative-control outcomes whose true value is the null, the fitted empirical null is centred at 1.316. What does that say?

Show the answer and why

Correct answer: Nominal 95% intervals actually cover only 0.128 of the negative controls, so reading the p-values as usual would believe a large batch of null results

If the analysis were unbiased, 39 estimates whose truth is the null would scatter on both sides of it; instead the whole cloud sits to one side, with a fitted centre of 1.316. That is what systematic bias looks like - and 0.117, the spread of that cloud, being smaller than the offset says the points moved together rather than scattering. The consequence is written in the coverage: nominal 95% intervals actually cover 0.128 of the negative controls, so the great majority of results whose truth is the null read as significant associations. This is the situation of a database study: an unmeasured confounder acts on the exposure and on every outcome, and the analyst never sees it.

After the offset is subtracted back out, the outcome of interest moves from 2.99 to 2.27, against a true value of 2. What does calibration buy, and what does it cost?

Show the answer and why

Correct answer: It buys honest confidence: the calibrated lower limit falls to 1.77 and the interval finally covers the truth, at the cost of an interval more than twice as wide

Calibration does two things: it subtracts the offset from every estimate on the log scale, and it replaces the standard error with the square root of the original variance plus the spread of the empirical null. The uncalibrated 2.99 with a lower limit of 2.72, sitting entirely to the right of the truth, becomes 2.27 with a lower limit of 1.77, an interval that covers the truth, while negative-control coverage returns to its nominal value. The cost is an interval 2.64 times wider - which is not diluting the signal but restoring uncertainty that had been understated. Calibration does not make you more confident; it makes your confidence honest. An interval that looks narrow while missing the truth is narrow only in appearance.

A plain before-after comparison gives 0.654 with an interval of 0.642 to 0.665; the ITS step is 0.680 with an interval of 0.654 to 0.707. The two are close, so is the before-after comparison good enough?

Show the answer and why

Correct answer: No. A before-after comparison gives one number and cannot say whether this was a step or a turn; the ITS separately estimates a monthly slope change of 1.012

The two being close is luck in these data, whose pre-law trend was relatively flat to begin with. The real difference is not the value but what each can separate: a before-after comparison is two means, and it cannot say whether the policy pushed the indicator down a notch or bent the whole trajectory, which are very different things for what happens next. Alongside the step of 0.680, the ITS separately estimates 1.012 as the monthly slope change relative to the pre-law trend - the post-law slope itself is that term combined with the time term - something the before-after comparison is structurally blind to. The value 0.009 is the before-after standard error; its smallness is neither a virtue nor something to patch afterwards, since widening an interval does not produce a slope coefficient. There is one further hidden cost: a before-after comparison cannot be caught out by its own figure, whereas an ITS plot carries a counterfactual dashed line the reader can judge for themselves.

Sources and licences

This page is original writing

Report a content problem

The statistics on this site are written by AI and reviewed by AI; a human only spot-checks. What you can see may be what we cannot.

The more specific, the more fixable — e.g. which sentence disagrees with which textbook or paper.

Needed only if you want a reply; reports without it are still read.

Sent along with your report

These are attached automatically. You can drop any of them.