From 8d3adb75b7986adb3fd0273fbb93c3669c44b2c0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 19:52:07 +0000 Subject: [PATCH 1/3] Initial plan From a5d8bfc86a18b974e4ffe49efb7a1897166c053b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 19:54:40 +0000 Subject: [PATCH 2/3] Summarize CiC (Change in Changes) method from qte package documentation Agent-Logs-Url: https://github.com/d-morrison/cie/sessions/783695b6-db31-4d7d-82c1-56c2050ff87d Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com> --- d_in_d.qmd | 53 +++++++++++++++++++++++++++++++++++++++ references/references.bib | 20 +++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/d_in_d.qmd b/d_in_d.qmd index 567d77a..c6fee81 100644 --- a/d_in_d.qmd +++ b/d_in_d.qmd @@ -12,4 +12,57 @@ Difference-in-differences makes a weaker exchangeability assumption: $$\Expf{Y_t(0) - Y_{t'}(0) | X = 1} = \Expf{Y_t(0) - Y_{t'}(0) | X = 0}$$ +## Change in Changes + +The **Change in Changes (CiC)** model [@atheyimbens2006] is a DiD-type method that estimates the **Quantile Treatment Effect on the Treated (QTET)** — that is, treatment effects across the full distribution of outcomes, not just the mean [@bcallaway_cic]. + +CiC requires two periods of data (a pre-treatment and a post-treatment period). The data can be either repeated cross-sections or panel data [@bcallaway_cic]. + +### Assumption + +Rather than the standard parallel trends assumption (that average outcomes would have followed parallel paths absent treatment), CiC assumes that the *distribution* of untreated potential outcomes evolves over time in the same way for both treated and control groups [@atheyimbens2006]. + +### Covariate adjustment + +CiC can condition on covariates by first fitting a linear model for outcomes conditional on group–time indicators and covariates, then residualizing (removing predicted values), and finally applying the CiC estimator to these quasi-residuals [@atheyimbens2006; @bcallaway_cic]. + +### R implementation + +The `CiC()` function in the `qte` R package [@bcallaway_cic] implements this estimator. Key arguments are (note: `formla` and `xformla` are the actual argument names in the package): + +| Argument | Description | +|-----------|-------------| +| `formla` | `y ~ d` where `y` is the outcome and `d` is a binary treatment indicator | +| `xformla` | Optional one-sided formula for additional covariates (e.g., `~ age + education`) | +| `t` | Post-treatment time period | +| `tmin1` | Pre-treatment time period | +| `tname` | Name of the column containing the time variable | +| `data` | Data frame containing all variables | +| `panel` | `TRUE` if the dataset is panel data | +| `probs` | Vector of quantile levels at which to estimate the QTET | +| `iters` | Number of bootstrap iterations for standard errors | + +The function returns a `QTE` object with QTET estimates and (optionally) bootstrap confidence intervals at each quantile in `probs`. + +### Example + +The following example from @bcallaway_cic estimates the QTET for the National Supported Work Demonstration job-training program using the `lalonde.psid.panel` dataset, conditioning on several pre-treatment characteristics: + +```r +library(qte) +data(lalonde) + +c1 <- CiC( + re ~ treat, + t = 1978, tmin1 = 1975, tname = "year", + xformla = ~ age + I(age^2) + education + black + hispanic + married + nodegree, + data = lalonde.psid.panel, idname = "id", + se = FALSE, probs = seq(0.05, 0.95, 0.05) +) + +summary(c1) +``` + +The resulting QTET estimates suggest that the treatment had no measurable effect on the lower quantiles of the earnings distribution but large positive effects at higher quantiles, with an estimated average treatment effect of roughly $4,600 [@bcallaway_cic]. + diff --git a/references/references.bib b/references/references.bib index c96aac0..0b4fc72 100644 --- a/references/references.bib +++ b/references/references.bib @@ -173,3 +173,23 @@ @misc{catalogofbias_collider note = {Catalog of Bias} } +@article{atheyimbens2006, + author = {Athey, Susan and Imbens, Guido}, + title = {Identification and Inference in Nonlinear Difference-in-Differences Models}, + journal = {Econometrica}, + volume = {74}, + number = {2}, + pages = {431--497}, + year = {2006}, + doi = {10.1111/j.1468-0262.2006.00668.x}, + url = {https://doi.org/10.1111/j.1468-0262.2006.00668.x} +} + +@misc{bcallaway_cic, + author = {Callaway, Brantly}, + title = {{CiC}: Change in Changes estimator for quantile treatment effects}, + year = {2024}, + url = {https://bcallaway11.github.io/qte/reference/CiC.html}, + note = {qte R package reference manual} +} + From 2f5f2407ccce66666486cd4e496d49b8061f5efb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 06:07:08 +0000 Subject: [PATCH 3/3] Convert CiC example code block to evaluated R chunk; add qte to DESCRIPTION Agent-Logs-Url: https://github.com/d-morrison/cie/sessions/63560068-2d5d-4270-a3ec-db94e32c4932 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com> --- DESCRIPTION | 3 ++- d_in_d.qmd | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e9acfce..c033655 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -11,4 +11,5 @@ Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.3 Imports: did, - plotly + plotly, + qte diff --git a/d_in_d.qmd b/d_in_d.qmd index c6fee81..eff3b00 100644 --- a/d_in_d.qmd +++ b/d_in_d.qmd @@ -48,7 +48,7 @@ The function returns a `QTE` object with QTET estimates and (optionally) bootstr The following example from @bcallaway_cic estimates the QTET for the National Supported Work Demonstration job-training program using the `lalonde.psid.panel` dataset, conditioning on several pre-treatment characteristics: -```r +```{r} library(qte) data(lalonde)