View source: R/DiffDiff_manual_byY.R
DD_manu_many | R Documentation |
This function computes the year-to-year Did. This is useful mainly for visualisation, in particular for the pre-trends (settng lag>1), but has no inference for the DiD effect itself.
DD_manu_many(
y_var = "y",
data,
time.index = "Time",
treat = "tr",
unit.index = "unit",
lag = 1,
format_long = TRUE
)
y_var |
The name of the y variable |
data |
A data frame containing the variables of interest, 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). |
lag |
How many lags to look at? Lag=1 will consider 0_1 sequences, lag 2: 0_1_1 etc |
format_long |
Should it format in long or wide? |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.