The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
The {fetwfe} package implements fused extended
two-way fixed effects (FETWFE), a methodology for estimating
treatment effects in difference-in-differences with staggered
adoptions.
To install the {fetwfe} package, simply use
install.packages("fetwfe")You can also install the latest development version by using
# install.packages("remotes") # if needed
remotes::install_github("gregfaletto/fetwfePackage")The primary function in the {fetwfe} is
fetwfe(), which implements fused extended two-way fixed
effects. Here’s some example code applying fetwfe() to the
castle data set from the bacondecomp
package:
library(fetwfe)
library(bacondecomp)
data(castle)
# Response: the log homicide rate. Treatment: `cdl` records the share of
# the year the castle-doctrine law was in effect, so `cdl > 0` gives the
# absorbing 0/1 treatment indicator `fetwfe()` requires.
castle$l_homicide <- log(castle$homicide)
castle$treated <- as.integer(castle$cdl > 0)
res <- fetwfe(
pdata = castle,
time_var = "year",
unit_var = "state",
treatment = "treated",
response = "l_homicide",
verbose = TRUE)
summary(res)For vignettes and full documentation, check out the page for the
{fetwfe} package on CRAN.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.