Estimates the canonical two-group / two-period DiD treatment effect $$\hat\tau = (\bar Y_{1,\text{post}} - \bar Y_{1,\text{pre}}) - (\bar Y_{0,\text{post}} - \bar Y_{0,\text{pre}}).$$ With covariates, fits the regression \(Y = \alpha + \beta D + \gamma P + \tau (D \times P) + X\delta + \varepsilon\) and reports \(\hat\tau\).
Usage
morie_did_2x2(
data,
outcome,
treatment,
post,
covariates = NULL,
cluster = NULL,
alpha = 0.05
)Arguments
- data
A data frame containing the outcome, treatment, post and any covariate columns.
- outcome
Name of the outcome column.
- treatment
Name of the binary (0/1) treatment-group column.
- post
Name of the binary (0/1) post-period column.
- covariates
Optional character vector of covariate column names.
- cluster
Optional cluster ID column for CR1 standard errors.
- alpha
Significance level for confidence intervals (default 0.05).
Value
A list with elements estimate, std_error,
t_stat, p_value, ci_lower, ci_upper,
n_treated, n_control, method, details.
Details
For multi-period staggered designs prefer
morie_did_group_time_att (Callaway-Sant'Anna via
did). morie_did_doubly_robust (via DRDID)
is the recommended option when pre-treatment covariates are
available.