didWD | R Documentation |
Make a DID regression conditional on staggered treatment based on Wooldridge (2021).
didWD(dt, id, year, y, w, wcontinuous = NULL, pretime = FALSE)
dt |
A data.frame including |
id |
A coloumn name denotes individuals. |
year |
A coloumn name denotes times. |
y |
A coloumn name denotes the dependent variable. |
w |
A dummy variable which equals D_i\cdot T_i where D_i=1 indicates treated group, and T-i=1 indicates in the treated periods. |
wcontinuous |
A character, the continuous treatment variable's name. Default is |
pretime |
Wheather add dq\cdot ft, t < q as independent variables. Default is |
A list including 3 elements, the first is results of regression with Two ways fixed effect, the second is the data frame ft, and the third is the data frame dq.
library(plm) data(stg6, package = 'didWD') fit <- didWD(stg6, id = 'id', year = 'year', y = 'logy', w = 'w') lmtest::coeftest(fit$fit, vcov. = vcovHC, method = 'white2') # aggregate treat effect xname <- names(coef(fit$fit)) aggeff(fit$fit, xname)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.