Last active
December 3, 2019 19:52
-
-
Save benzipperer/bfad261608fcbca66483ce8aef959ad1 to your computer and use it in GitHub Desktop.
effective state minimum wages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set more off | |
| clear all | |
| * load CPS for population weights | |
| load_epiextracts, begin(1979m1) end(2018m12) sample(basic) keep(age statefips) | |
| keep if age >= 16 | |
| * convert monthly weight to annual | |
| replace basicwgt = basicwgt / 12 | |
| collapse (sum) pop = basicwgt, by(statefips year) | |
| tempfile statepops | |
| save `statepops' | |
| * load CPI | |
| sysuse cpi_annual, clear | |
| keep year cpiurs | |
| tempfile cpi | |
| save `cpi' | |
| * download and load into state historical state level annual min wage data | |
| tempfile mwzip mwdata | |
| copy https://github.com/benzipperer/historicalminwage/releases/download/v1.2.0/mw_state_stata.zip `mwzip' | |
| !unzip -p `mwzip' mw_state_annual.dta > `mwdata' | |
| use `mwdata', clear | |
| rename max_mw statemw | |
| rename max_fed_mw fedmw | |
| keep statefips year statemw fedmw | |
| * calculate population weighted real mw | |
| merge 1:1 statefips year using `statepops', keep(3) nogenerate | |
| merge m:1 year using `cpi', keep(3) nogenerate | |
| sum cpiurs if year == 2018 | |
| scalar cpibase = r(mean) | |
| foreach var of varlist statemw fedmw { | |
| gen real_`var' = `var' * cpibase / cpiurs | |
| } | |
| collapse (mean) *statemw *fedmw [aw=pop], by(year) | |
| scatter real_statemw real_fedmw year, connect(l l) | |
| graph export effectivemw.pdf, replace | |
| export delimited using effectivemw.csv, replace | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment