cohortDD is an R package for the cohort discontinuity design (CDD). A period shock reaches everyone alive at the same date, so no unexposed group exists at that date. The design compares respondents of a given age in a survey taken after the shock with respondents who were the same age in the surveys just before it, and it uses the trend across those earlier cohorts to extrapolate what the exposed cohort would have reported without the shock. The gap between the observed mean and the extrapolated one estimates the effect of the shock on that cohort, Delta_c(k), at k years since onset, and repeating the comparison age by age gives the effect for every birth cohort.
The package needs only repeated cross-sectional surveys with the survey year, the age of the respondent, and a survey weight.
Installation
# install.packages("remotes")
remotes::install_github("wenhaojiangsoc/cohortDD")A minimal example
The example is the killing of Michael Brown in Ferguson, Missouri, on August 9, 2014, and the share of Americans who say the country spends too little on improving the conditions of Blacks. The data are the bundled extract of the General Social Survey, gss_culture. The call below drops the 2014 interviews conducted after August 9 and estimates the effect on each cohort aged 20 to 70 in 2016, from a local-linear fit (order = 1) through the five surveys before the event (H = 5, the surveys of 2006 to 2014), pooling respondents within five years of each target age (b = 5).
library(cohortDD)
data(gss_culture)
d <- subset(gss_culture, age <= 84 & post_ferguson14 == 0)
fit <- cdd(d, outcome = "natrace", onset = 2015, wave = 2016,
H = 5, order = 1, b = 5, ages = 20:70, levels = 1,
controls = c("factor(race)", "factor(sex)", "educ"),
reweight = c("factor(race)", "factor(sex)"))
head(as.data.frame(fit)[, c("age", "cohort", "ate", "se", "lower", "higher")], 4)
#> age cohort ate se lower higher
#> 1 20 1996 0.213 0.0762 0.0638 0.363
#> 2 21 1995 0.226 0.0704 0.0876 0.363
#> 3 22 1994 0.219 0.0653 0.0908 0.347
#> 4 23 1993 0.218 0.0613 0.0975 0.338Each row is one cohort. The column ate is the estimated effect on the share saying too little, se is its standard error, and lower and higher bound the 95 percent sampling interval.
plot_design(subset(d, year <= 2018), "natrace", onset = 2015, wave = 2016, H = 5,
from = 2000, level = 1, scale = 100) +
ggplot2::labs(y = "Too little spent on Blacks (%)")
plot_profile(fit, scale = 100, ylab = "Effect (points)")
![]() The design. Survey means for ages 20 to 70. The shaded band covers the five pre-event surveys, the line is the fit through them, and the arrow is the gap between its extension and the first survey after the event. |
![]() The age profile. The estimated effect for each cohort by age in 2016. The darker band is the 95 percent sampling interval and the lighter band the bias-aware interval. |
plot_design() shows the comparison for all ages pooled, and plot_profile() shows it cohort by cohort. The share saying too little was about 17 points above the extrapolated trend in 2016, and the profile is positive at every age: adults in their sixties moved as much as adults in their twenties. A comparison of the young with the old would report a difference near zero for this pattern, the same number it would report had nobody moved. The Get started article goes through this case one specification at a time.
Where to go next
| Question | Article | Main functions |
|---|---|---|
| What does each specification do, on one worked case? | Get started |
cdd(), cdd_popavg(), cdd_bandwidth(), plot_estimates()
|
| What does the estimator compute, and how are the intervals built? | The estimator and its inference |
cdd(), cdd_breakdown(), wave_weights()
|
| Kernel mean or local-linear fit, and how many pre-shock surveys? | Choosing the extrapolant and the window |
cdd_bandwidth(), cdd_cv(), cdd_risk_ideal()
|
| Could the estimate arise without a shock? | Tests and falsification |
cdd_placebo(), cdd_adjust(), cdd_placebo_summary()
|
| Which figures does the package draw? | Visualization |
plot_design(), plot_profile(), plot_estimates(), plot_dynamics(), plot_bandwidth()
|
| How do I summarize by age group or follow cohorts over time? | Groups, trajectories and population averages |
cdd_groups(), cdd_popavg(), cdd_design()
|
| How does the design relate to a difference-in-differences? | Replicating a difference-in-differences |
cdd(), cdd_groups()
|
References
Jiang, W., Mark, N., and Wu, L. L. The Cohort Discontinuity Design. Working paper.
Keskintürk, T. (2026). Generational imprinting: How political events shape cohorts. Social Forces. doi:10.1093/sf/soag143

