Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. > dat = read.csv("stats.csv", header = TRUE)
  2. > head(dat)
  3. age ano sum c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25
  4. 1 Entre 25 et 29 ans NON 125 1 4 4 4 4 4 4 4 2 4 4 4 5 4 4 4 5 4 4 4 4 4 2 2 4
  5. 2 Entre 25 et 29 ans NON 83 2 1 2 3 2 2 1 2 2 2 3 2 2 2 3 2 2 1 2 3 3 3 2 1 3
  6. 3 Entre 25 et 29 ans NON 167 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 3 3 5
  7. 4 Entre 21 et 24 ans NON 102 3 4 4 2 3 4 3 3 2 3 3 3 2 4 2 3 3 4 4 3 3 3 2 1 3
  8. 5 Entre 21 et 24 ans NON 110 4 4 4 2 4 4 3 2 2 5 3 4 4 5 2 2 2 5 2 5 4 4 1 1 2
  9. 6 Entre 21 et 24 ans NON 104 4 3 2 3 5 5 4 4 3 2 3 4 4 4 2 2 3 2 2 2 2 2 1 1 2
  10. c26 c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42
  11. 1 2 4 2 2 2 2 5 3 1 1 2 1 1 1 1 1 1
  12. 2 2 3 3 3 1 2 3 1 1 4 1 1 1 1 1 1 1
  13. 3 5 5 5 5 3 2 4 1 1 4 2 2 1 1 2 2 2
  14. 4 2 3 2 3 2 2 2 1 1 1 2 2 1 1 1 1 1
  15. 5 4 1 2 4 1 2 3 3 1 1 2 1 1 1 1 1 1
  16. 6 2 1 3 2 1 2 5 4 1 3 2 1 1 1 2 1 1
  17. > as.numeric(dat$ano)
  18. [1] 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2
  19. > lm1=lm(as.numeric(ano) ~ sum, data=dat)
  20. > aov(lm1)
  21. Call:
  22. aov(formula = lm1)
  23.  
  24. Terms:
  25. sum Residuals
  26. Sum of Squares 0.799145 9.700855
  27. Deg. of Freedom 1 40
  28.  
  29. Residual standard error: 0.4924646
  30. Estimated effects may be unbalanced
  31. > anova(lm1)
  32. Analysis of Variance Table
  33.  
  34. Response: as.numeric(ano)
  35. Df Sum Sq Mean Sq F value Pr(>F)
  36. sum 1 0.7991 0.79915 3.2952 0.07699 .
  37. Residuals 40 9.7009 0.24252
  38. ---
  39. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  40. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement