Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.35 KB | None | 0 0
  1. > dat$age=factor(dat$age)
  2. > head(dat)
  3. age ano 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 c26
  4. 1 Entre 25 et 29 ans NON 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 2
  5. 2 Entre 25 et 29 ans NON 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 2
  6. 3 Entre 25 et 29 ans NON 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 5
  7. 4 Entre 21 et 24 ans NON 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 2
  8. 5 Entre 21 et 24 ans NON 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 4
  9. 6 Entre 21 et 24 ans NON 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 2
  10. c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42
  11. 1 4 2 2 2 2 5 3 1 1 2 1 1 1 1 1 1
  12. 2 3 3 3 1 2 3 1 1 4 1 1 1 1 1 1 1
  13. 3 5 5 5 3 2 4 1 1 4 2 2 1 1 2 2 2
  14. 4 3 2 3 2 2 2 1 1 1 2 2 1 1 1 1 1
  15. 5 1 2 4 1 2 3 3 1 1 2 1 1 1 1 1 1
  16. 6 1 3 2 1 2 5 4 1 3 2 1 1 1 2 1 1
  17. > lm1=lm(ano ~ *, data=dat)
  18. Error: unexpected '*' in "lm1=lm(ano ~ *"
  19. > lm1=lm(ano ~ ., data=dat)
  20. Warning messages:
  21. 1: In model.response(mf, "numeric") :
  22. using type = "numeric" with a factor response will be ignored
  23. 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
  24. > lm1=lm(ano ~ .-age, data=dat)
  25. Warning messages:
  26. 1: In model.response(mf, "numeric") :
  27. using type = "numeric" with a factor response will be ignored
  28. 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
  29. > lm1=lm(ano ~ c1, data=dat)
  30. Warning messages:
  31. 1: In model.response(mf, "numeric") :
  32. using type = "numeric" with a factor response will be ignored
  33. 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
  34. > lm1=lm(as.numeric(ano) ~ c1, data=dat)
  35. > aov(lm1)
  36. Call:
  37. aov(formula = lm1)
  38.  
  39. Terms:
  40. c1 Residuals
  41. Sum of Squares 0.686025 9.813975
  42. Deg. of Freedom 1 40
  43.  
  44. Residual standard error: 0.4953275
  45. Estimated effects may be unbalanced
  46. > anova(lm1)
  47. Analysis of Variance Table
  48.  
  49. Response: as.numeric(ano)
  50. Df Sum Sq Mean Sq F value Pr(>F)
  51. c1 1 0.686 0.68603 2.7961 0.1023
  52. Residuals 40 9.814 0.24535
  53. > lm1=lm(as.numeric(ano) ~ . , data=dat)
  54. > aov(lm1)
  55. Call:
  56. aov(formula = lm1)
  57.  
  58. Terms:
  59. age c1 c2 c3 c4 c5 c6 c7 c8 c9
  60. Sum of Squares 0.2666667 0.4108660 0.4395642 0.0978590 0.1008379 0.0822626 0.0499555 0.0356669 0.0000862 0.4150275
  61. Deg. of Freedom 3 1 1 1 1 1 1 1 1 1
  62. c10 c11 c12 c13 c14 c15 c16 c17 c18 c19
  63. Sum of Squares 0.0992574 0.3397310 0.0161621 0.1958846 0.0541367 0.0980954 0.7134231 0.0009259 0.6088014 0.2257926
  64. Deg. of Freedom 1 1 1 1 1 1 1 1 1 1
  65. c20 c21 c22 c23 c24 c25 c26 c27 c28 c29
  66. Sum of Squares 0.0980419 0.4307088 0.0003177 0.3049458 0.0239029 0.1130501 0.9086070 0.3851228 1.4643844 0.5612306
  67. Deg. of Freedom 1 1 1 1 1 1 1 1 1 1
  68. c30 c32 c33 c34 c35 c36 Residuals
  69. Sum of Squares 0.0207738 0.7982671 0.4438560 0.0768097 0.0246566 0.0693220 0.0000000
  70. Deg. of Freedom 1 1 1 1 1 1 1
  71.  
  72. Residual standard error: 3.053113e-16
  73. 7 out of 46 effects not estimable
  74. Estimated effects may be unbalanced
  75. 2 observations deleted due to missingness
  76. > anova(lm1)
  77. Analysis of Variance Table
  78.  
  79. Response: as.numeric(ano)
  80. Df Sum Sq Mean Sq F value Pr(>F)
  81. age 3 0.26667 0.08889 9.5359e+29 7.528e-16 ***
  82. c1 1 0.41087 0.41087 4.4077e+30 3.032e-16 ***
  83. c2 1 0.43956 0.43956 4.7156e+30 2.932e-16 ***
  84. c3 1 0.09786 0.09786 1.0498e+30 6.213e-16 ***
  85. c4 1 0.10084 0.10084 1.0818e+30 6.121e-16 ***
  86. c5 1 0.08226 0.08226 8.8250e+29 6.777e-16 ***
  87. c6 1 0.04996 0.04996 5.3592e+29 8.696e-16 ***
  88. c7 1 0.03567 0.03567 3.8263e+29 1.029e-15 ***
  89. c8 1 0.00009 0.00009 9.2489e+26 2.093e-14 ***
  90. c9 1 0.41503 0.41503 4.4524e+30 3.017e-16 ***
  91. c10 1 0.09926 0.09926 1.0648e+30 6.169e-16 ***
  92. c11 1 0.33973 0.33973 3.6446e+30 3.335e-16 ***
  93. c12 1 0.01616 0.01616 1.7339e+29 1.529e-15 ***
  94. c13 1 0.19588 0.19588 2.1014e+30 4.392e-16 ***
  95. c14 1 0.05414 0.05414 5.8077e+29 8.354e-16 ***
  96. c15 1 0.09810 0.09810 1.0524e+30 6.206e-16 ***
  97. c16 1 0.71342 0.71342 7.6535e+30 2.301e-16 ***
  98. c17 1 0.00093 0.00093 9.9332e+27 6.388e-15 ***
  99. c18 1 0.60880 0.60880 6.5312e+30 2.491e-16 ***
  100. c19 1 0.22579 0.22579 2.4223e+30 4.090e-16 ***
  101. c20 1 0.09804 0.09804 1.0518e+30 6.208e-16 ***
  102. c21 1 0.43071 0.43071 4.6206e+30 2.962e-16 ***
  103. c22 1 0.00032 0.00032 3.4080e+27 1.091e-14 ***
  104. c23 1 0.30495 0.30495 3.2714e+30 3.520e-16 ***
  105. c24 1 0.02390 0.02390 2.5643e+29 1.257e-15 ***
  106. c25 1 0.11305 0.11305 1.2128e+30 5.781e-16 ***
  107. c26 1 0.90861 0.90861 9.7474e+30 < 2.2e-16 ***
  108. c27 1 0.38512 0.38512 4.1316e+30 3.132e-16 ***
  109. c28 1 1.46438 1.46438 1.5710e+31 < 2.2e-16 ***
  110. c29 1 0.56123 0.56123 6.0208e+30 2.594e-16 ***
  111. c30 1 0.02077 0.02077 2.2286e+29 1.349e-15 ***
  112. c32 1 0.79827 0.79827 8.5637e+30 < 2.2e-16 ***
  113. c33 1 0.44386 0.44386 4.7616e+30 2.917e-16 ***
  114. c34 1 0.07681 0.07681 8.2401e+29 7.013e-16 ***
  115. c35 1 0.02466 0.02466 2.6451e+29 1.238e-15 ***
  116. c36 1 0.06932 0.06932 7.4368e+29 7.382e-16 ***
  117. Residuals 1 0.00000 0.00000
  118. ---
  119. Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  120. Warning message:
  121. In anova.lm(lm1) :
  122. ANOVA F-tests on an essentially perfect fit are unreliable
  123. >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement