*! version 0.7.1 24Sep2024

Title

staggered -- Stata implementation of the Staggered R package

Syntax

Stata version of the Staggered R package, which implements the efficient
estimator for staggered rollout designs proposed by Roth and Sant'Anna (2023).

staggered
depvar
,
i(individual)
t(time)
g(cohort)
estimand()
[options]

i() identifies each individual and can be of any type; however,
t() and g() must both be numeric and have the same units,
as they both indicate time periods. Further, at least one estimand must
be requested (and multiple estimands are allowed).

Options
i(varname) Individual

t(varname) Time

g(varname) Cohort (i.e.the time period the individual enters treatment).

estimand(str) Estimand; any combination of: simple, cohort, calendar, eventstudy.

eventTime(numlist) Event times for estimand eventstudy (default 0).

beta(real) User-input beta (to use instead of betastar).

num_fisher(int) Number of fisher permutations (default 0).

skip_data_check Do not balance data (warning: data must already be balanced).

return_full_vcv Return full vcov matrix (for event study estimands).

drop_treated_beforet Drop cohorts treated (weakly) before first time period.

use_last_treated_only Only use last treated cohort as treatment.

vce(str) Either 'neyman' or 'adjusted' (default)

cs Callaway and Sant'Anna estimator (alias for beta(1) drop_treated_beforet).

sa Sun and Abraham estimator (alias for beta(1) drop_treated_beforet use_last_treated_only).

Description

See the online examples for details or refer to the examples below.

Example 1: Basic Usage

. local github https://github.com/mcaceresb/stata-staggered

. use `github'/raw/main/test/pj_officer_level_balanced.dta, clear

.

. local stagopts i(uid) t(period) g(first_trained)

. staggered complaints, `stagopts' estimand(simple)

. staggered complaints, `stagopts' estimand(eventstudy simple) eventTime(0/4) num_fisher(500)

Stored results

staggered stores the following in e():

Scalars

e(N) number of observations

e(fisher_supt_pval) fisher p-value from sup-t-statistic (only with num_fisher))

Macros

e(cmd) staggered

e(cmdline) command as typed

e(depvar) name of dependent variable

e(individual) name of variable identifying individuals

e(time) name of variable identifying the time period

e(cohort) name of variable identifying cohort (when treated)

e(vce) variance computed (neyman, adjusted)

e(vcetype) same as vce but capitalized

e(properties) b V

e(mata) name of mata object where results are stored (see below)

Matrices

e(b) coefficient of interest (theta)

e(V) variance of theta (diagonal matrix unless return_full_vcv is requested)

e(eventTime) event times (only with multiple eventTime values)

e(thetastar) estimates (only with multiple estimates or eventTime values)

e(se_neyman) neyman SEs (only with multiple estimates or eventTime values)

e(se_adjusted) adjusted SEs (only with multiple estimates or eventTime values)

e(Wald_test) Wald statistic (column 1) and p-value (column 2)

e(fisher_neyman) neyman fisher p-value (only with num_fisher())

e(fisher_adjusted) adjusted fisher p-value (only with num_fisher))

e(results) single matrix consolidating all results (estimate and SEs)

Functions

e(sample) marks estimation sample

The following data are available in e(mata) (default name: StaggeredResults):

real scalar N
number of observations used in estimation

real scalar Ni
number of individuals

real scalar Nt
number of time periods

real scalar Ng
number of cohorts

real colvector times
vector of unique time periods (sorted)

real colvector cohorts
vector of unique cohorts (sorted)

real colvector cohort_size
vector of cohort sizes (as used internally in the estimation)

real scalar num_fisher
number of fisher permutations

real colvector thetastar
estimated coefficient of interest

real colvector betastar
estimated \beta^* (or user-provided beta)

real colvector Xhat
estimate of \hat

real colvector Xhat_t
t-statistic, \hat / diagonal(V_{\hat})

real matrix V_X
estimate of V_{\hat} (variance of \hat)

real colvector V_thetaX
covariance of \hat and \hat{\theta} (estimate of V_{\hat{\theta}, \hat})

real colvector V_theta
estimate of V_{\hat{\theta}} (variance of \hat{\theta})

real matrix A_theta
auxiliary matrix with rows containing A_ (stacked for multiple estimates/event times)

real matrix A_0
auxiliary matrix with rows containing A_{0, g} (stacked for multiple estimates/event times)

real colvector se_neyman
estimate of 'neyman' SE

real colvector se_adjusted
estimate of 'adjusted' SE

real matrix full_neyman
estimate of 'neyman' vcov (only with return_full_vcv)

real matrix full_adjusted
estimate of 'adjusted' vcov (only with return_full_vcv)

real rowvector Wald_test
Wald statistic (column 1) and p-value (column 2)

real colvector fisher_neyman
simulated 'neyman' fisher p-value

real colvector fisher_adjusted
simulated 'adjusted' fisher p-value

real scalar fisher_supt_pval
simulated sup-t-statistic fisher p-value

References

See the paper by Roth and Sant'Anna (2023).