Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. Call:
  2. glm(formula = k ~ a + b + c + d + e + f + g + h + i + j,
  3. family = binomial(link = "logit"), data = bz)
  4.  
  5. Deviance Residuals:
  6. Min 1Q Median 3Q Max
  7. -2.33397 -1.11978 0.06133 1.12395 2.47743
  8.  
  9. Coefficients:
  10. Estimate Std. Error z value Pr(>|z|)
  11. (Intercept) -0.442743 0.037655 -11.758 < 2e-16 ***
  12. a -0.042182 0.002231 -18.911 < 2e-16 ***
  13. b 0.514025 0.037674 13.644 < 2e-16 ***
  14. c -2.640015 0.166331 -15.872 < 2e-16 ***
  15. d 1.505434 0.090759 16.587 < 2e-16 ***
  16. e 1.503102 0.096854 15.519 < 2e-16 ***
  17. f -1.262869 0.116334 -10.856 < 2e-16 ***
  18. g 0.745737 0.179957 4.144 3.41e-05 ***
  19. h 0.312694 0.021166 14.774 < 2e-16 ***
  20. i -0.440660 0.032558 -13.535 < 2e-16 ***
  21. j 0.773453 0.036602 21.131 < 2e-16 ***
  22. ---
  23. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  24.  
  25. (Dispersion parameter for binomial family taken to be 1)
  26.  
  27. Null deviance: 83178 on 59999 degrees of freedom
  28. Residual deviance: 79092 on 59989 degrees of freedom
  29. AIC: 79114
  30.  
  31. Number of Fisher Scoring iterations: 4
  32.  
  33. probabilities <- mod %>% predict(bz, type = "response")
  34. predicted.classes <- ifelse(probabilities > 0.5, "1", "0")
  35.  
  36. prop.table(table(predicted.classes,bz$k))
  37.  
  38. predicted.classes 0 1
  39. 0 0.3039000 0.1946333
  40. 1 0.1961000 0.3053667
  41.  
  42. mean(predicted.classes == bz$millennials_01)
  43. [1] 0.6092667
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement