| count_did_poisson | R Documentation |
Estimates DiD for count outcomes using a Poisson quasi-maximum likelihood (QMLE) estimator with a log-linear parallel trends assumption. The treatment effect is a multiplicative rate ratio.
count_did_poisson(
data,
yname,
tname,
idname,
treat_period,
control_period,
dname = NULL,
gname = NULL,
xformla = ~1,
offset = NULL,
se_type = c("robust", "cluster", "analytical"),
cluster_var = NULL
)
data |
A data frame (long format). |
yname |
Character. Binary outcome variable name. |
tname |
Character. Time period variable name. |
idname |
Character. Unit ID variable name. |
treat_period |
Numeric. The treatment (post) period. |
control_period |
Numeric. The pre-treatment baseline period. |
dname |
Character. Treatment indicator variable name (optional). |
gname |
Character. Cohort variable name (optional). |
xformla |
One-sided formula for covariates. Default |
offset |
Character. Name of offset variable. Default |
se_type |
Character. SE type: |
cluster_var |
Character. Clustering variable (if |
A list of class count_did_poisson.
dat <- sim_count_panel(n = 400, nperiods = 6, prop_treated = 0.4)
dat2 <- dat[dat$period %in% c(2, 4), ]
res <- count_did_poisson(dat2, "y", "period", "id", 4, 2, gname = "g")
print(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.