nonlinear_pretest: Pre-Treatment Parallel Trends Test for Nonlinear DiD

View source: R/pretest.R

nonlinear_pretestR Documentation

Pre-Treatment Parallel Trends Test for Nonlinear DiD

Description

Tests for pre-treatment violations of the parallel trends assumption in nonlinear staggered DiD settings. This is fundamentally different from the linear case because:

  1. Scale dependence: Parallel trends on the probability scale does NOT imply parallel trends on the latent index scale (and vice versa). Tests are performed on the scale specified in outcome_model.

  2. Roth-Sant'Anna sensitivity: Computes sensitivity of post-treatment estimates to violations of magnitude delta in pre-period, following Roth & Sant'Anna (2023).

  3. Joint test: Provides a joint chi-squared test of all pre-period ATT(g,t) = 0, accounting for correlation across (g,t) cells.

Usage

nonlinear_pretest(
  obj,
  plot = TRUE,
  alpha = 0.05,
  type = c("joint", "individual", "honestdid")
)

Arguments

obj

An object of class nonlinear_attgt.

plot

Logical. If TRUE (default), produces a pre-trends plot.

alpha

Numeric. Significance level. Default 0.05.

type

Character. Type of pre-trends test:

  • "joint": Joint chi-squared test (default)

  • "individual": Individual t-tests per pre-period cell

  • "honestdid": Sensitivity analysis a la Roth-Sant'Anna

Value

A list with:

pretest_results

Data frame of pre-period ATT(g,t) with p-values.

joint_stat

Joint test statistic.

joint_pval

P-value for joint test.

conclusion

Interpretive conclusion string.

References

Roth, J. (2022). Pretest with caution: Event-study estimates after testing for parallel trends. American Economic Review: Insights, 4(3), 305-322.

Roth, J., & Sant'Anna, P. H. C. (2023). When is parallel trends sensitive to functional form? Econometrica, 91(2), 737-747.

Examples

set.seed(99)
dat <- sim_binary_panel(n = 600, nperiods = 8, prop_treated = 0.5)
res <- nonlinear_attgt(dat, "y", "period", "id", "g",
                        outcome_model = "logit")
pt  <- nonlinear_pretest(res)
print(pt)


NonlinearDiD documentation built on May 6, 2026, 1:06 a.m.