Guest User

Untitled

a guest
Nov 24th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. library(lme4)
  2. library(MuMIn)
  3.  
  4. mtcars2 <- mtcars
  5. mtcars2$vs <- factor(mtcars2$vs)
  6.  
  7. gl <- lmer(mpg ~ am + disp + hp + qsec + (1 | cyl), mtcars2,
  8. REML = FALSE, na.action = 'na.fail')
  9. d <- dredge(gl)
  10.  
  11. av <- model.avg(d, subset = cumsum(weight) <= 0.95)
  12. summary(av)
  13.  
  14. Call:
  15. model.avg(object = d, subset = cumsum(weight) <= 0.95)
  16.  
  17. Component model call:
  18. lme4::lmer(formula = mpg ~ <7 unique rhs>, data = mtcars2, REML = FALSE, na.action = na.fail)
  19.  
  20. Component models:
  21. df logLik AICc delta weight
  22. 13 5 -77.81 167.92 0.00 0.37
  23. 123 6 -76.34 168.05 0.13 0.35
  24. 134 6 -77.54 170.43 2.51 0.11
  25. 1234 7 -76.25 171.16 3.24 0.07
  26. 23 5 -79.85 172.00 4.08 0.05
  27. 2 4 -81.63 172.75 4.83 0.03
  28. 124 6 -78.99 173.34 5.42 0.02
  29.  
  30. Term codes:
  31. am disp hp qsec
  32. 1 2 3 4
  33.  
  34. Model-averaged coefficients:
  35. (full average)
  36. Estimate Std. Error Adjusted SE z value Pr(>|z|)
  37. (Intercept) 25.457505 6.467643 6.648016 3.829 0.000129 ***
  38. am 4.103425 1.861593 1.898182 2.162 0.030636 *
  39. hp -0.043829 0.017926 0.018265 2.400 0.016415 *
  40. disp -0.009419 0.011834 0.011983 0.786 0.431821
  41. qsec 0.081973 0.284147 0.292015 0.281 0.778929
  42.  
  43. (conditional average)
  44. Estimate Std. Error Adjusted SE z value Pr(>|z|)
  45. (Intercept) 25.45751 6.46764 6.64802 3.829 0.000129 ***
  46. am 4.46519 1.46823 1.51835 2.941 0.003273 **
  47. hp -0.04651 0.01471 0.01515 3.070 0.002140 **
  48. disp -0.01793 0.01068 0.01099 1.632 0.102634
  49. qsec 0.40421 0.51757 0.53873 0.750 0.453075
  50. ---
  51. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  52.  
  53. Relative variable importance:
  54. hp am disp qsec
  55. Importance: 0.94 0.92 0.53 0.20
  56. N containing models: 5 5 5 3
Add Comment
Please, Sign In to add comment