cic: Changes-in-Changes Estimator

View source: R/cic.R

cicR Documentation

Changes-in-Changes Estimator

Description

Implements the Changes-in-Changes (CIC) estimator of Athey and Imbens (2006) for the average treatment effect on the treated in a two-group, two-period difference-in-differences setting.

Usage

cic(
  y_00,
  y_01,
  y_10,
  y_11,
  se = TRUE,
  boot = FALSE,
  boot_iters = 500L,
  seed = NULL,
  discrete = FALSE
)

Arguments

y_00

Numeric vector. Outcomes for the control group in the pre-treatment period.

y_01

Numeric vector. Outcomes for the control group in the post-treatment period.

y_10

Numeric vector. Outcomes for the treated group in the pre-treatment period.

y_11

Numeric vector. Outcomes for the treated group in the post-treatment period.

se

Logical. If TRUE (default), compute analytic standard errors using the asymptotic variance from Theorem 5.1 of Athey and Imbens (2006). Ignored (with a message) when discrete = TRUE, because Theorem 5.1 is derived under the continuous-distribution assumption.

boot

Logical. If TRUE, also compute bootstrap standard errors. Default is FALSE.

boot_iters

Integer. Number of bootstrap iterations. Default 500.

seed

Integer or NULL. Random seed for bootstrap.

discrete

Logical. If FALSE (default), use the continuous CIC estimator (Theorem~3.1 of Athey and Imbens 2006), which applies F^{-1}_{01}(F_{00}(y_{10,i})) to each pre-treatment treated observation. If TRUE, use the discrete CIC estimator (Theorem~4.1), which integrates the counterfactual over the quantile band [F_{00}(y^-), F_{00}(y)] to handle mass points in the outcome distribution. Use discrete = TRUE when the outcome takes a small number of distinct values (e.g., integer counts).

Details

The CIC estimator constructs a counterfactual distribution for the treated group in the post-treatment period by applying the transformation:

Y^{N,CIC}_{11} = F^{-1}_{Y,01}(F_{Y,00}(Y_{10}))

The average treatment effect is then:

\hat{\tau}^{CIC} = \frac{1}{N_{11}} \sum Y_{11,i} - \frac{1}{N_{10}} \sum F^{-1}_{Y,01}(F_{Y,00}(Y_{10,i}))

The analytic variance follows Theorem 5.1 of Athey and Imbens (2006):

Var(\sqrt{N} \hat{\tau}^{CIC}) = V^p/\alpha_{00} + V^q/\alpha_{01} + V^r/\alpha_{10} + V^s/\alpha_{11}

Value

An object of class "cic" containing:

tau

The CIC average treatment effect estimate.

se

Analytic standard error (if se = TRUE).

z

z-statistic.

pval

Two-sided p-value.

counterfactual_mean

Mean of the counterfactual distribution.

tau_did

The standard DID estimate for comparison.

N

Total sample size.

n

Named vector of group sample sizes.

boot_se

Bootstrap standard error (if boot = TRUE).

ecdfs

List of empirical CDF objects for each group.

References

Athey, S. and Imbens, G. W. (2006). Identification and Inference in Nonlinear Difference-in-Differences Models. Econometrica, 74(2), 431–497. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1468-0262.2006.00668.x")}

Examples

# Workers' compensation example (Meyer, Viscusi, and Durbin 1995)
if (requireNamespace("wooldridge", quietly = TRUE)) {
  data("injury", package = "wooldridge")
  result <- cic(
    y_00 = injury$ldurat[injury$highearn == 0 & injury$afchnge == 0],
    y_01 = injury$ldurat[injury$highearn == 0 & injury$afchnge == 1],
    y_10 = injury$ldurat[injury$highearn == 1 & injury$afchnge == 0],
    y_11 = injury$ldurat[injury$highearn == 1 & injury$afchnge == 1]
  )
  print(result)
}


sccic documentation built on April 10, 2026, 5:07 p.m.