powered by
Estimates 2x2 DiD with binary outcome using probit regression. Parallel trends assumed on the probit (inverse-normal) scale.
binary_did_probit( data, yname, tname, idname, treat_period, control_period, dname = NULL, gname = NULL, xformla = ~1, se_type = c("robust", "cluster", "analytical"), cluster_var = NULL )
A list of class binary_did_probit.
binary_did_probit
A data frame (long format).
Character. Binary outcome variable name.
Character. Time period variable name.
Character. Unit ID variable name.
Numeric. The treatment (post) period.
Numeric. The pre-treatment baseline period.
Character. Treatment indicator variable name (optional).
Character. Cohort variable name (optional).
One-sided formula for covariates. Default ~1.
~1
Character. SE type: "robust" (default), "cluster", or "analytical".
"robust"
"cluster"
"analytical"
Character. Clustering variable (if se_type = "cluster").
se_type = "cluster"
dat <- sim_binary_panel(n = 500, nperiods = 4, prop_treated = 0.5) dat2 <- dat[dat$period %in% c(2, 3), ] res <- binary_did_probit(dat2, "y", "period", "id", 3, 2, gname = "g") print(res)
Run the code above in your browser using DataLab