Guest User

Untitled

a guest
Jun 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. mean_presc deprivation
  2. count 202.000000 202.000000
  3. mean 1.108072 106.306931
  4. std 0.139628 60.217804
  5. min 0.641107 1.000000
  6. 25% 1.033221 54.250000
  7. 50% 1.119174 107.500000
  8. 75% 1.206066 158.750000
  9. max 1.449776 209.00000
  10.  
  11. mean_presc deprivation
  12. 0 1.074778 121
  13. 1 1.209622 144
  14. 2 1.106975 193
  15. 3 1.098038 16
  16. 4 0.906051 136
  17.  
  18. y=depr_mean["mean_presc"]
  19. X=depr_mean["deprivation"]
  20. model = sm.OLS(y,X).fit()
  21. print (model.summary())
  22.  
  23. > OLS Regression Results
  24. ==============================================================================
  25. Dep. Variable: mean_presc R-squared: 0.716
  26. Model: OLS Adj. R-squared: 0.715
  27. Method: Least Squares F-statistic: 507.8
  28. Date: Wed, 20 Jun 2018 Prob (F-statistic): 6.50e-57
  29. Time: 22:46:44 Log-Likelihood: -181.65
  30. No. Observations: 202 AIC: 365.3
  31. Df Residuals: 201 BIC: 368.6
  32. Df Model: 1
  33. Covariance Type: nonrobust
  34. ===============================================================================
  35. coef std err t P>|t| [0.025 0.975]
  36. -------------------------------------------------------------------------------
  37. deprivation 0.0077 0.000 22.535 0.000 0.007 0.008
  38. ==============================================================================
  39. Omnibus: 29.635 Durbin-Watson: 1.541
  40. Prob(Omnibus): 0.000 Jarque-Bera (JB): 7.996
  41. Skew: 0.065 Prob(JB): 0.0184
  42. Kurtosis: 2.034 Cond. No. 1.00
  43. ==============================================================================
  44.  
  45. Warnings:
  46. [1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
  47.  
  48. library (dplyr)
  49. depr_mean<-read.csv("depr_mean.csv")
  50. summary (depr_mean)
  51.  
  52. X mean_presc deprivation
  53. Min. : 0.00 Min. :0.6411 Min. : 1.00
  54. 1st Qu.: 50.25 1st Qu.:1.0332 1st Qu.: 54.25
  55. Median :100.50 Median :1.1192 Median :107.50
  56. Mean :100.50 Mean :1.1081 Mean :106.31
  57. 3rd Qu.:150.75 3rd Qu.:1.2061 3rd Qu.:158.75
  58. Max. :201.00 Max. :1.4498 Max. :209.00
  59.  
  60. head(depr_mean)
  61. X mean_presc deprivation
  62. 0 1.0747779 121
  63. 1 1.2096218 144
  64. 2 1.1069754 193
  65. 3 1.0980376 16
  66. 4 0.9060512 136
  67. 5 1.2064052 39
  68.  
  69. model_pgr <- lm (mean~IMD, data=depr_desc)
  70. summary (model_pgr)
  71.  
  72. Call:
  73. lm(formula = mean ~ IMD, data = depr_desc)
  74.  
  75. Residuals:
  76. Min 1Q Median 3Q Max
  77. -0.49150 -0.05094 0.01817 0.08530 0.27441
  78.  
  79. Coefficients:
  80. Estimate Std. Error t value Pr(>|t|)
  81. (Intercept) 1.1779952 0.0191975 61.362 < 2e-16 ***
  82. IMD -0.0006578 0.0001572 -4.184 4.29e-05 ***
  83. ---
  84. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  85.  
  86. Residual standard error: 0.1342 on 200 degrees of freedom
  87. Multiple R-squared: 0.08047, Adjusted R-squared: 0.07587
  88. F-statistic: 17.5 on 1 and 200 DF, p-value: 4.294e-05
Add Comment
Please, Sign In to add comment