Giter Club home page Giter Club logo

shiftsharesestata's Introduction

ShiftShareSEStata

This Stata package implements confidence intervals in shift-share designs (also called Bartik 1991 designs) using the AKM and AKM0 procedures from Adão, Kolesár, and Morales (2019). See the ShiftShareSEMatlab package for Matlab version of this code, and the ShiftShareSE package for an R version.

Example

IV regression using data from Autor, Dorn, and Hanson (2013), including the first-stage results

    use "data/ADH_derived.dta", clear
    local control_varlist t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource
    ivreg_ss d_sh_empl_mfg, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) control_varlist(`control_varlist') share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1) firststage(1)

Corresponding reduced-form regression

    reg_ss d_sh_empl, shiftshare_var(d_tradeotch_pw_lag) control_varlist(`control_varlist') share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1)

The datasets needed to run these commands are stored in the data directory: ADH_derived.dta and sector_derived.dta. The do file ADHapplication.do contains additional examples that use these datasets to illustrate how to use the reg_ss and ivreg_ss to estimate linear regressions in which the regressor of interest has a shift-share structure, and instrumental variables regressions in which the instrument has a shift-share structure.

Installation

The released version of reg_ss and ivreg_ss is available at REPEC (see reg_ss and ivreg_ss). You can install these packages from within Stata using the ssc command:

ssc install reg_ss
ssc install ivreg_ss

Alternatively, to download the development version of these packages from GitHub, download the files reg_ss.ado, reg_ss.sthlp, ivreg_ss.ado, ivreg_ss.sthlp from the code directory, and put them into Stata's personal ado directory, typically

  • c:\ado\personal on Windows
  • ~/Documents/Stata/ado on a Mac
  • ~/ado on Linux
  • The simple way to find out your local Stata directory is to run the command sysdir in Stata.

For more information on how to use personal ado files, please refer to Stata Official FAQ.

Bug reporting and Questions

Please open issues and leave feedback, use click on the Issues tab.

Some Special Notes

  • Please make sure you have no missing values in your dataset. We don't handle missing values in our code, and having missing values in the dataset causes the program to shut down.
  • Since Stata doesn't support nested preserve and restore, our ivreg_ss code cannot return your original dataset after computing AKM standard errors. reg_ss will return your original dataset if you don't compute clustered standard errors. We suggest reloading your dataset every time after you compute AKM standard errors.

Common Error Message

  • no observations: You may have missing values in your share variable list / shiftshare variable

shiftsharesestata's People

Contributors

zhangxiang0822 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.