View source: R/mDid_weights_CH.R
mDid_weights_CH | R Documentation |
Weights from Chaisemartin and Hautefeuille
mDid_weights_CH(
data,
y_var = "y",
time.index = "Time",
treat = "tr",
unit.index = "unit",
return_details = FALSE
)
## S3 method for class 'FE_weights_CH'
print(x, ...)
## S3 method for class 'FE_weights_CH'
plot(x, by = c("time", "unit"), ...)
weights_CH_smry(data)
data |
A data frame containing the variables of itnerest, should have names |
y_var |
The name of the y variable |
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). |
return_details |
Return additional details on weights? |
x |
Output from |
by |
Which kind of plot to draw |
... |
Unused arguments |
A enhanced tibble
of class FE_weights_CH
The weight w_{g,t}
as defined in the paper
The weight w multiplied by obs_weight
. They sum to 1.
The ratio N_{g,t}/N_1
, eventually including also the treatment intensity.
examp_df <- data.frame(unit = rep(c(1, 2), each=3),
time = rep(1:3, 2),
treat = c(0, 0, 1, 0, 1, 1))
mDid_weights_CH(examp_df, treat = "treat",
time.index = "time")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.