Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gregfaletto/fetwfePackage

Repository files navigation

Fused Extended Two-Way Fixed Effects

The {fetwfe} package implements fused extended two-way fixed effects (FETWFE), a methodology for estimating treatment effects in difference-in-differences with staggered adoptions.

  • For a brief introduction to the methodology, as well as background on difference-in-differences with staggered adoptions and motivation for FETWFE, see this blog post.
  • For more detailed slides on the methodology (but less detailed than the paper), see here.
  • Check out the most recent draft of the full paper here.
  • This blog post explains a little more about what the package does under the hood, if you're interested.

fetwfePackage

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 that implements the data application from the paper:

library(fetwfe)
library(bacondecomp)

set.seed(23451)

data(divorce)

res <- fetwfe(
    pdata=divorce[divorce$sex == 2, ],
    time_var="year",
    unit_var="st",
    treatment="changed",
    covs=c("murderrate", "lnpersinc", "afdcrolls"),
    response="suiciderate_elast_jag",
    q=0.5,
    verbose=TRUE)

summary(res)

For vignettes and full documentation, check out the page for the {fetwfe} package on CRAN.

References

About

Implementation of fused extended two-way fixed effects (Faletto 2024)

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages