Guest User

Untitled

a guest
Apr 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. year - observation year
  2. state - state (FIPS code)
  3. legal1820 - percentage of 18-20 year olds who can legally drink
  4. dtype - death cause (4 types)
  5. pop - state population
  6. mrate - mortality rate per 100,000/year
  7.  
  8. mortality rate = α+ δDDLEGALst + βSTATEs + γYEARt + εst
  9. DDLEGALst - proportion of 18-20 year olds that can drink in state s at time t
  10. STATEs is the dummy variable for each state
  11. YEARt is the dummy variable for each year
  12. εst - error term
  13.  
  14. deathall <- subset(mlda_data, mlda_data$dtype == 1)
  15. deathmotor <- subset(mlda_data, mlda_data$dtype == 2)
  16. deathsuicide <- subset(mlda_data, mlda_data$dtype == 3)
  17. deathinternal <- subset(mlda_data, mlda_data$dtype == 6)
  18.  
  19. deathall$statedummy = ifelse(deathall$legal1820 < 100, 1, 0)
  20. deathall$yeardummy = ifelse(deathall$legal1820 < 100, 1, 0)
  21.  
  22. deathall$did = deathall$statedummy * deathall$yeardummy
  23. deathall_baseline = lm(mrate ~ statedummy + yeardummy + did, data = deathall)
  24.  
  25. > summary(deathall_baseline)
  26.  
  27. Call:
  28. lm(formula = mrate ~ statedummy + yeardummy + did, data = deathall)
  29.  
  30. Residuals:
  31. Min 1Q Median 3Q Max
  32. -88.214 -24.803 -6.004 14.797 191.199
  33.  
  34. Coefficients: (2 not defined because of singularities)
  35. Estimate Std. Error t value Pr(>|t|)
  36. (Intercept) 130.014 2.302 56.478 < 2e-16 ***
  37. statedummy 10.674 2.966 3.598 0.000343 ***
  38. yeardummy NA NA NA NA
  39. did NA NA NA NA
  40. ---
  41. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  42.  
  43. Residual standard error: 38.79 on 712 degrees of freedom
  44. Multiple R-squared: 0.01786, Adjusted R-squared: 0.01648
  45. F-statistic: 12.95 on 1 and 712 DF, p-value: 0.0003425
  46.  
  47. deathall_statepop = lm(mrate ~ statedummy + yeardummy + pop + state + did, data = deathall)
Add Comment
Please, Sign In to add comment