Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- > dat$age=factor(dat$age)
- > head(dat)
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- c27 c28 c29 c30 c31 c32 c33 c34 c35 c36 c37 c38 c39 c40 c41 c42
- 1 4 2 2 2 2 5 3 1 1 2 1 1 1 1 1 1
- 2 3 3 3 1 2 3 1 1 4 1 1 1 1 1 1 1
- 3 5 5 5 3 2 4 1 1 4 2 2 1 1 2 2 2
- 4 3 2 3 2 2 2 1 1 1 2 2 1 1 1 1 1
- 5 1 2 4 1 2 3 3 1 1 2 1 1 1 1 1 1
- 6 1 3 2 1 2 5 4 1 3 2 1 1 1 2 1 1
- > lm1=lm(ano ~ *, data=dat)
- Error: unexpected '*' in "lm1=lm(ano ~ *"
- > lm1=lm(ano ~ ., data=dat)
- Warning messages:
- 1: In model.response(mf, "numeric") :
- using type = "numeric" with a factor response will be ignored
- 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
- > lm1=lm(ano ~ .-age, data=dat)
- Warning messages:
- 1: In model.response(mf, "numeric") :
- using type = "numeric" with a factor response will be ignored
- 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
- > lm1=lm(ano ~ c1, data=dat)
- Warning messages:
- 1: In model.response(mf, "numeric") :
- using type = "numeric" with a factor response will be ignored
- 2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
- > lm1=lm(as.numeric(ano) ~ c1, data=dat)
- > aov(lm1)
- Call:
- aov(formula = lm1)
- Terms:
- c1 Residuals
- Sum of Squares 0.686025 9.813975
- Deg. of Freedom 1 40
- Residual standard error: 0.4953275
- Estimated effects may be unbalanced
- > anova(lm1)
- Analysis of Variance Table
- Response: as.numeric(ano)
- Df Sum Sq Mean Sq F value Pr(>F)
- c1 1 0.686 0.68603 2.7961 0.1023
- Residuals 40 9.814 0.24535
- > lm1=lm(as.numeric(ano) ~ . , data=dat)
- > aov(lm1)
- Call:
- aov(formula = lm1)
- Terms:
- age c1 c2 c3 c4 c5 c6 c7 c8 c9
- Sum of Squares 0.2666667 0.4108660 0.4395642 0.0978590 0.1008379 0.0822626 0.0499555 0.0356669 0.0000862 0.4150275
- Deg. of Freedom 3 1 1 1 1 1 1 1 1 1
- c10 c11 c12 c13 c14 c15 c16 c17 c18 c19
- Sum of Squares 0.0992574 0.3397310 0.0161621 0.1958846 0.0541367 0.0980954 0.7134231 0.0009259 0.6088014 0.2257926
- Deg. of Freedom 1 1 1 1 1 1 1 1 1 1
- c20 c21 c22 c23 c24 c25 c26 c27 c28 c29
- Sum of Squares 0.0980419 0.4307088 0.0003177 0.3049458 0.0239029 0.1130501 0.9086070 0.3851228 1.4643844 0.5612306
- Deg. of Freedom 1 1 1 1 1 1 1 1 1 1
- c30 c32 c33 c34 c35 c36 Residuals
- Sum of Squares 0.0207738 0.7982671 0.4438560 0.0768097 0.0246566 0.0693220 0.0000000
- Deg. of Freedom 1 1 1 1 1 1 1
- Residual standard error: 3.053113e-16
- 7 out of 46 effects not estimable
- Estimated effects may be unbalanced
- 2 observations deleted due to missingness
- > anova(lm1)
- Analysis of Variance Table
- Response: as.numeric(ano)
- Df Sum Sq Mean Sq F value Pr(>F)
- age 3 0.26667 0.08889 9.5359e+29 7.528e-16 ***
- c1 1 0.41087 0.41087 4.4077e+30 3.032e-16 ***
- c2 1 0.43956 0.43956 4.7156e+30 2.932e-16 ***
- c3 1 0.09786 0.09786 1.0498e+30 6.213e-16 ***
- c4 1 0.10084 0.10084 1.0818e+30 6.121e-16 ***
- c5 1 0.08226 0.08226 8.8250e+29 6.777e-16 ***
- c6 1 0.04996 0.04996 5.3592e+29 8.696e-16 ***
- c7 1 0.03567 0.03567 3.8263e+29 1.029e-15 ***
- c8 1 0.00009 0.00009 9.2489e+26 2.093e-14 ***
- c9 1 0.41503 0.41503 4.4524e+30 3.017e-16 ***
- c10 1 0.09926 0.09926 1.0648e+30 6.169e-16 ***
- c11 1 0.33973 0.33973 3.6446e+30 3.335e-16 ***
- c12 1 0.01616 0.01616 1.7339e+29 1.529e-15 ***
- c13 1 0.19588 0.19588 2.1014e+30 4.392e-16 ***
- c14 1 0.05414 0.05414 5.8077e+29 8.354e-16 ***
- c15 1 0.09810 0.09810 1.0524e+30 6.206e-16 ***
- c16 1 0.71342 0.71342 7.6535e+30 2.301e-16 ***
- c17 1 0.00093 0.00093 9.9332e+27 6.388e-15 ***
- c18 1 0.60880 0.60880 6.5312e+30 2.491e-16 ***
- c19 1 0.22579 0.22579 2.4223e+30 4.090e-16 ***
- c20 1 0.09804 0.09804 1.0518e+30 6.208e-16 ***
- c21 1 0.43071 0.43071 4.6206e+30 2.962e-16 ***
- c22 1 0.00032 0.00032 3.4080e+27 1.091e-14 ***
- c23 1 0.30495 0.30495 3.2714e+30 3.520e-16 ***
- c24 1 0.02390 0.02390 2.5643e+29 1.257e-15 ***
- c25 1 0.11305 0.11305 1.2128e+30 5.781e-16 ***
- c26 1 0.90861 0.90861 9.7474e+30 < 2.2e-16 ***
- c27 1 0.38512 0.38512 4.1316e+30 3.132e-16 ***
- c28 1 1.46438 1.46438 1.5710e+31 < 2.2e-16 ***
- c29 1 0.56123 0.56123 6.0208e+30 2.594e-16 ***
- c30 1 0.02077 0.02077 2.2286e+29 1.349e-15 ***
- c32 1 0.79827 0.79827 8.5637e+30 < 2.2e-16 ***
- c33 1 0.44386 0.44386 4.7616e+30 2.917e-16 ***
- c34 1 0.07681 0.07681 8.2401e+29 7.013e-16 ***
- c35 1 0.02466 0.02466 2.6451e+29 1.238e-15 ***
- c36 1 0.06932 0.06932 7.4368e+29 7.382e-16 ***
- Residuals 1 0.00000 0.00000
- ---
- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
- Warning message:
- In anova.lm(lm1) :
- ANOVA F-tests on an essentially perfect fit are unreliable
- >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement