Coder Social home page Coder Social logo

dballaelliott / esplot Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 10.0 3.58 MB

archived : use csdid instead

Home Page: https://dballaelliott.github.io/esplot/

License: MIT License

Stata 38.20% TeX 0.10% HTML 61.70%
stata event-study-analysis diff-in-diff event-study event-study-plots dynamic-effects

esplot's Introduction

esplot: a stata package for event study plots

NOTE: this package is outdated. It estimates dynamic DiD coefficients via TWFE. While this was the standard approach for many years, it is now known to be quite fragile. See What’s Trending in Difference-in-Differences? A Synthesis of the Recent Econometrics Literature for a discussion of why these TWFE specifications are difficult to interpret, and not generally an appropriate specification with more than one treatment date.

Excellent packages exist that implement DiD/event study estimation using the new, robust methods. You should not use this code. Instead use should use the stata package cs_did or the R package did.

This repository exists for backward compatability and documentation of an existing command

Event study plots are increasingly popular in applied research. esplot is a new command for stata allowing researchers to quickly and easily create event study plots.

Install

  1. Install from within stata

    net install esplot, from("https://raw.githubusercontent.com/dballaelliott/esplot/pkg/") replace

OR 2. Download/clone this repository

Examples

The example folder contains a .do file and a .csv with example data. Users may find it useful to download the folder and run (or simply browse) make_examples.do for sample syntax.

These data can also be used to experiment with the examples provided on the help site. Note that example.csv uses the same variable names for ease of use, but that the values have been randomized, so plots may not align with the example images.

Additional Information

See site for introduction and overview.

Type help esplot after installation for internal stata help documentation.

New Features

esplot 0.10.0 (late May 2021). Continuous treatment is now allowed when using panel data syntax. That is, the values of event and compare can be other than 0 and 1.
esplot 0.9.5 (early March 2021). Lets users specify saturate or bin to control how endpoints are treated.
esplot 0.9.1 (late Feb 2021). Adds support for alternate syntax when data cannot be tsset (i.e. are not panel data).
esplot 0.7.1 (late Nov 2020). Adds support for quantile regression.

Endpoints

As of esplot 0.9.0, leads and lags outside of the specified window are estimated, but not displayed. This is a change to the default; in earlier versions, periods outside the window were binned together. The old functionality is available by specifying the suboption bin to window with window(start end, bin). But think before you bin! This forces the dynamic effects to be constant outside of the specified window. If you're comfortable with that restriction, it can help with the identification of time fixed effects, but if this assumption is violated, it can cause the dynamic effects within the window to be misidentified. See the docs for more information on these suboptions.

For users of older versions of Stata

Currently, this project nominally supports Stata versions as early as 11. However, I've mostly developed and tested this program, especially the graphics, in Stata 16 and later. I've tried to test that core functionality works in older versions, but I can't guarantee that I haven't missed anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.