DD | R Documentation |
Compute the diff-and-diff by period. \lifecycleexperimental
DD(
y_var = "y",
data,
time.index = "Time",
treat = "tr",
unit.index = "unit",
min_obs_required = 2,
treatment = c("binary", "categorical")
)
y_var |
The name of the y variable |
data |
A data frame containing the variables of itnerest, should have names |
time.index |
The name of the variable describing the time index (date, year, etc) |
treat |
The name of the treatment variable. |
unit.index |
The name of the units (individual, county, household, etc). |
min_obs_required |
the minimum number of either treat or control needed to run a regresion |
treatment |
Is treatment binary or categorical? |
DiD_aggreg
for aggregating the output of DD
over years.
data <- sim_dat(N=100)
DD_out <- DD(data=data)
DiD_aggreg(x=DD_out, by_DiD = FALSE)
DiD_aggreg(x=DD_out, by_DiD = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.