Giter Site home page Giter Site logo

did-1's Introduction

did

NOTE: DUE TO AN RCALL UPDATE, SOME ELEMENTS OF THE AGGTE FUNCTION HAVE BROKEN IN WAYS THAT ARE VERY DIFFICULT TO FIX. UNTIL RCALL IS UPDATED AGAIN, AGGTE MAY NOT WORK. INSTEAD, AFTER RUNNING att_gt, DO rcall: aggte(CS_Model)

A Stata package that acts as a wrapper for Callaway and Sant'Anna's R did package. This makes heavy use of the rcall package by Haghish.

This package is fully functional, although it is also relatively untested and there may remain some bugs. Thankfully, since all the calculation is done in the R package, those bugs are more likely to give you no results than to give you wrong ones.

Functions included in this package:

  • did which does nothing but remind you to read the help file
  • didsetup to set up the appropriate packages so you can run the did R package
  • mpdta to load the mpdta example data from the did package
  • att_gt to estimate group-time treatment effects
  • aggte to estimate treatment effects aggregated to the group and/or time level
  • ggdid to produce graphs of either att_gt or aggte output
  • conditional_did_pretest to perform an integrated moments test of the conditional parallel trends assumption

You can install did with

net install did, from("https://raw.githubusercontent.com/NickCH-K/did/master/") replace

Make sure the R language is installed on your computer. Then run didsetup in Stata.

Citation

If you use this package, some citations are in order! BibTeX entries at at the bottom of this readme.

You should definitely cite the Callaway and Sant'Anna paper that describes the estimator used in this package:

Callaway, Brantly and Pedro H.C. Sant'Anna. "Difference-in-Differences with Multiple Time Periods." Forthcoming at the Journal of Econometrics, 2020.

The published version of the paper can be found here, and the ungated working paper is here.

You may also want to cite the Callaway and Sant'Anna R package that performs the estimation:

Callaway, Brantly and Pedro H.C. Sant'Anna. "did: Difference in Differences." R package version 2.0.0. https://bcallaway11.github.io/did/.

Finally, should you also cite this package, which acts purely as a Stata wrapper for their R package which actually does all the work? I don't know! There's not really a citation standard for this sort of thing. I certainly wouldn't mind it though. A few more years until tenure review, just sayin'.

Huntington-Klein, Nick. "'did': Use the Callaway and Sant'Anna R package 'did' in Stata." Stata package version 0.2.0. https://github.com/NickCH-K/did.

And if you're really feeling it (citing a dependency? Alas and alack we have no guide), there's also the rcall package, which allows me to use R from Stata. This package could not be built without it.

Haghish, E. F. "Seamless interactive language interfacing between R and Stata." The Stata Journal 19.1 (2019): 61-82.

BibTeX entries for citations:

@article{callaway2020difference,
  title={Difference-in-differences with Multiple Time Periods},
  author={Callaway, Brantly and Sant'Anna, Pedro H.C.},
  journal={Journal of Econometrics},
  year={2020},
  publisher={Elsevier}
}

@Misc{,
    title = {did: Difference in Differences},
    author = {Callaway, Brantly and Sant'Anna, Pedro H.C.},
    year = {2020},
    note = {R package version 2.0.0},
    url = {https://bcallaway11.github.io/did/},
 }
  
@Misc{,
    title = {'did': Use the Callaway and Sant'Anna R package 'did' in Stata},
    author = {Huntington-Klein, Nick},
    year = {2021},
    note = {Stata package version 0.2.0},
    url = {https://github.com/NickCH-K/did},
} 

@article{haghish2019seamless,
  title={Seamless Interactive Language Interfacing between R and Stata},
  author={Haghish, E.F.},
  journal={The Stata Journal},
  volume={19},
  number={1},
  pages={61--82},
  year={2019},
  publisher={SAGE Publications Sage CA: Los Angeles, CA}
}

did-1's People

Contributors

hveemos avatar nickch-k avatar

Watchers

 avatar

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.