Uses the estimation procedures recommended from Borusyak, Jaravel, Spiess (2021); Callaway and Sant'Anna (2020); Gardner (2021); Roth and Sant'Anna (2021); Sun and Abraham (2020)

event_study(
  data,
  yname,
  idname,
  gname,
  tname,
  xformla = NULL,
  horizon = NULL,
  weights = NULL
)

Arguments

data

The dataframe containing all the variables

yname

Variable name for outcome variable

idname

Variable name for unique unit id

gname

Variable name for unit-specific date of initial treatment (never-treated should be zero or NA)

tname

Variable name for calendar period

xformla

A formula for the covariates to include in the model. It should be of the form ~ X1 + X2. Default is NULL.

horizon

Integer of length two. The first integer is the earliest pre-effect to include and the second is the latest post-effect to include. Default is all horizons.

weights

Variable name for estimation weights. This is used in estimating Y(0) and also augments treatment effect weights

Value

tibble of point estimates for each estimator

Examples

data(df_het, package = "did2s") out = event_study( data = df_het, yname = "dep_var", idname = "unit", tname = "year", gname = "g" )
#> Estimating TWFE Model
#> Estimating using Gardner (2021)
#> Estimating using Callaway and Sant'Anna (2020)
#> Estimating using Sun and Abraham (2020)
#> Estimating using Borusyak, Jaravel, Spiess (2021)
#> Estimatng using Roth and Sant'Anna (2021)