Estimation and Visualization of Linear Panel Event Studies

Estimates linear panel event study models. Plots coefficients following the recommendations in Freyaldenhoven et al. (2021) . Includes sup-t bands, testing for key hypotheses, least wiggly path through the Wald region. Allows instrumental variables estimation following Freyaldenhoven et al. (2019) .


eventstudyr

CRANstatus CRAN RStudio mirrordownloads

Overview

The eventstudyr package implements tools for estimating linear panel event study models, following the recommendations in Freyaldenhoven et al. (2021). Includes sup-t bands, testing for key hypotheses, least wiggly path through the Wald region. Allows instrumental variables estimation following Freyaldenhoven et al. (2019).

Installation

# Install from CRAN
install.packages("eventstudyr")

# Install latest version from GitHub
install.packages("devtools")
devtools::install_github("JMSLab/eventstudyr")

Usage

Find a minimal example below. For more examples see the package documentation and vignette.

library(eventstudyr)
set.seed(10) # for reproducibility of sup-t bands

estimates_ols <- EventStudy(
   estimator = "OLS",
   data = example_data,   # Use package sample data
   outcomevar = "y_smooth_m",
   policyvar = "z",
   idvar = "id",
   timevar = "t",
   controls = "x_r",
   pre = 0,  post = 4,
   kernel = "fixest"
)

plt <- EventStudyPlot(estimates = estimates_ols)
plt

Event-study plot using the example data of the package
 and default plotting options.

Citation

Simon Freyaldenhoven, Christian Hansen, Jorge Pérez Pérez, and Jesse M. Shapiro. “Visualization, Identification, and Estimation in the Panel Event-Study Design.” NBER Working Paper No. 29170, August 2021.

Simon Freyaldenhoven, Christian Hansen, Jorge Pérez Pérez, Jesse M. Shapiro, Veli M. Andirin, Richard Calvo, Santiago Hermo, Nathan Schor, Emily Wang. “eventstudyr package.” Code and data repository at https://github.com/JMSLab/eventstudyr, March 2023.

Acknowledgments

Thank you to Eliana Sena Sarmiento and Melissa Wu for their excellent work testing and reviewing eventstudyr prior to its public release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("eventstudyr")

1.2.1 by Santiago Hermo, 16 days ago


https://github.com/JMSLab/eventstudyr


Report a bug at https://github.com/JMSLab/eventstudyr/issues


Browse source code at https://github.com/cran/eventstudyr


Authors: Simon Freyaldenhoven [aut] , Christian Hansen [aut] , Jorge Pérez Pérez [aut] , Jesse Shapiro [aut] , Veli Andirin [aut] , Richard Calvo [aut] , Santiago Hermo [aut, cre] , Nathan Schor [aut] , Emily Wang [aut] , JMSLab [cph] , Ryan Kessler [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports car, data.table, dplyr, estimatr, fixest, ggplot2, MASS, rlang, pracma, stats, stringr

Suggests rmarkdown, knitr, testthat


See at CRAN