unparallel

A tiny, deterministic staggered-adoption panel — 12 units over 10 years, no noise — in which the treated cohorts sit on a differential linear trend relative to the never-treated controls, so the parallel-trends assumption is violated before anyone is treated. Drawn as an event study around adoption, the pre-treatment coefficients are visibly non-flat: the teachable diagnostic that a post-period estimate cannot be read as a causal effect. It is the companion to signflip; the same mechanism can be dialed into the interactive app by giving the treated cohorts a nonzero slope.

Codebook

Variable Type Description
id integer Unit identifier (1–12)
group character "early" (4 units, adopt year 5), "late" (4 units, adopt year 7), or "never" (4 units, never treated)
adopt_year integer Treatment adoption year; NA for never-treated
year integer Calendar year (1–10)
outcome numeric Deterministic outcome base + slope·(year − 1) + effect; no noise, so worked numbers are exact

Every treated unit drifts up 2 units/year relative to the flat controls in every period and receives a true effect of +10 at adoption. With kappa_pre = kappa_post = 3 the normalized event-study coefficients are exactly −4, −2, 0 for t = −3, −2, −1 and 12, 14, 16, 18 for t = 0…3.

Source and citation

Generated deterministically by the package (data-raw/unparallel.R). No external data. See Wing, C., Freedman, S., & Hollingsworth, A. (2024). Stacked Difference-in-Differences. Working paper.

The data

library(stacked)
data(unparallel, package = "stacked")
head(unparallel)
   id group adopt_year year outcome
1:  1 early          5    1      10
2:  1 early          5    2      12
3:  1 early          5    3      14
4:  1 early          5    4      16
5:  1 early          5    5      28
6:  1 early          5    6      30
dim(unparallel)
[1] 120   5

Preview

source("../assets/style-web.R")

d <- copy(unparallel)
agg <- d[, .(outcome = mean(outcome)), by = .(year, group)]
agg[, group := factor(group, levels = c("early", "late", "never"))]

p_preview <- ggplot(agg, aes(year, outcome, color = group, fill = group, shape = group)) +
  geom_line(linewidth = 0.7) +
  geom_point(size = pt_size, stroke = pt_stroke, color = border_color) +
  scale_color_manual(values = c(early = highlight_color, late = highlight_color, never = grey_line)) +
  scale_fill_manual(values  = c(early = highlight_color, late = "white",         never = grey_fill)) +
  scale_shape_manual(values = c(early = shp_primary,     late = shp_primary,     never = shp_grey)) +
  labs(title = "Outcome paths by cohort",
       subtitle = "Treated cohorts (highlighted) drift up relative to flat controls before adoption",
       x = "Year") +
  base_theme

Download

Load it

data(unparallel, package = "stacked")
stacked use unparallel, clear