Advertisement
pcornell99

fmrs

Jan 28th, 2024
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import delimited "/Users/Downloads/FMR_All_1983_2024.csv", clear
  2.  
  3. collapse fmr* pop*, by(fips)
  4. drop fmr00_0-fmr_area
  5. rename fmr*_0 fmr_020*
  6. rename fmr*_1 fmr_120*
  7. rename fmr*_2 fmr_220*
  8. rename fmr*_3 fmr_320*
  9. keep pop* fmr_* fips
  10. reshape long fmr_0 fmr_1 fmr_2 fmr_3, i(fips) j(year)
  11. drop if year>2024
  12. preserve
  13. keep if year<2010
  14. collapse fmr* [aw=pop2000], by(year)
  15. save first10, replace
  16. restore
  17. preserve
  18. keep if year>=2010 & year<2017
  19. collapse fmr* [aw=pop2010], by(year)
  20. save second7, replace
  21. restore
  22.  
  23. keep if year>=2017
  24. collapse fmr* [aw=pop2017], by(year)
  25. append using first10
  26. append using second7
  27. forvalues i = 0/3{
  28.  
  29. gen fmrbase`i' = fmr_`i' if year==2001
  30.  
  31. egen fmrbase_wide`i' = min(fmrbase`i')
  32.  
  33. gen inflation`i'= fmr_`i'/ fmrbase_wide`i'
  34.  
  35. }
  36. keep inflation* year
  37.  
  38. twoway (line inflation0 year, sort) (line inflation1 year, sort) (line inflation2 year, sort) (line inflation3 year, sort)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement