panel_qtt: Panel QTT (Callaway-Li 2019)

View source: R/panel_qtt.R

panel_qttR Documentation

Panel QTT (Callaway-Li 2019)

Description

Computes Quantile Treatment Effects on the Treated (QTT) and the Average Treatment Effect on the Treated (ATT) using the three-period panel identification strategy of Callaway and Li (2019). Handles two-period (one post + two pre-treatment periods) and staggered treatment adoption via ptetools. Requires panel data for both groups.

Identification. Under a copula stability assumption and distributional parallel trends on changes, the counterfactual distribution F_{Y(0)^{\text{post}}|D=1} is recovered from three periods of panel data without requiring rank invariance.

pre_copula. Controls which pre-treatment periods are used as the copula-transfer base for post-treatment cells (g, g+e):

"long" (default)

pre2 = 2*(g - anticipation) - (g+e) - 2, matching the copula window to the event horizon e. Cells where pre2 does not exist in the data are excluded from aggregation with two-step weight renormalization.

"short"

pre2 = g - anticipation - 2, always anchored at treatment onset.

Pre-test placebo cells always use the sliding base regardless of pre_copula.

Usage

panel_qtt(
  yname,
  gname,
  tname,
  idname,
  data,
  xformula = ~1,
  weightsname = NULL,
  control_group = "notyettreated",
  anticipation = 0,
  alp = 0.05,
  cband = TRUE,
  biters = 100,
  cl = 1,
  gt_type = "att",
  probs = NULL,
  pre_copula = "long"
)

Arguments

yname

Name of the outcome variable.

gname

Name of the treatment group variable (first treatment period; 0 for never-treated units).

tname

Name of the time period variable.

idname

Name of the unit id variable (required).

data

A data frame.

xformula

One-sided formula for covariates. Default ~1.

weightsname

Name of the sampling weights column. Default NULL.

control_group

"notyettreated" (default) or "nevertreated".

anticipation

Number of periods of anticipation. Default 0.

alp

Significance level. Default 0.05.

cband

Logical; uniform confidence band if TRUE (default).

biters

Number of bootstrap iterations. Default 100.

cl

Number of parallel clusters. Default 1.

gt_type

"att" (default) or "qtt".

probs

Quantile grid for gt_type = "qtt". Default seq(0.05, 0.95, 0.05).

pre_copula

"long" (default) or "short". See Details.

Value

For gt_type = "att", a pte_emp_boot object. For gt_type = "qtt", a pte_qtt object.

References

Callaway, Brantly and Tong Li. “Quantile Treatment Effects in Difference-in-Differences Models with Panel Data.” Quantitative Economics 10(4), pp. 1579-1618, 2019.

See Also

cic, qdid, mdid, ddid

Examples


data(mpdta, package = "did")

## Panel QTT with rolling pre-period copula (default pre_copula = "long")
res <- panel_qtt(yname = "lemp", gname = "first.treat", tname = "year",
                 idname = "countyreal", data = mpdta,
                 gt_type = "qtt", probs = seq(0.1, 0.9, 0.1), biters = 20)
summary(res)



qte documentation built on July 23, 2026, 5:13 p.m.