Advertisement
Guest User

Untitled

a guest
Jul 4th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.68 KB | None | 0 0
  1. > d <- data.frame(Factor1 = c(rep("A", 10), rep("B", 10), rep("C", 10)),
  2. +      
  3. +               Factor2 = c(rep("D", 8), rep("E", 6), rep("F", 16)),
  4. +              
  5. +               Factor3 = c(rep("1", 15), rep("2", 15)),
  6. +                      
  7. +               Response = c(1:30))
  8. >
  9. > summary.lm(lm(Response ~ Factor1 + Factor2 + Factor3,
  10. +      
  11. +             data = d,
  12. +      
  13. +             contrasts = list(Factor1 = contr.poly)))
  14.  
  15. Call:
  16. lm(formula = Response ~ Factor1 + Factor2 + Factor3, data = d,
  17.     contrasts = list(Factor1 = contr.poly))
  18.  
  19. Residuals:
  20.    Min     1Q Median     3Q    Max
  21.   -4.5   -1.5    0.0    1.5    4.5
  22.  
  23. Coefficients:
  24.             Estimate Std. Error t value Pr(>|t|)    
  25. (Intercept)    9.000      1.694   5.314 1.88e-05 ***
  26. Factor1.L      7.425      1.750   4.243 0.000285 ***
  27. Factor1.Q      1.837      1.010   1.818 0.081526 .  
  28. Factor2E       5.000      1.909   2.619 0.015056 *  
  29. Factor2F       7.500      3.307   2.268 0.032627 *  
  30. Factor32       3.000      2.646   1.134 0.268039    
  31. ---
  32. Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  33.  
  34. Residual standard error: 2.415 on 24 degrees of freedom
  35. Multiple R-squared: 0.9377, Adjusted R-squared: 0.9247
  36. F-statistic: 72.26 on 5 and 24 DF,  p-value: 1.133e-13
  37.  
  38. >
  39. > Anova(lm(Response ~ Factor1 + Factor2 + Factor3,
  40. +              
  41. +        data = d,
  42. +              
  43. +        contrasts = list(Factor1 = contr.poly)),
  44. +      
  45. +     type="II")
  46. Anova Table (Type II tests)
  47.  
  48. Response: Response
  49.           Sum Sq Df F value    Pr(>F)    
  50. Factor1    199.5  2 17.1000 2.418e-05 ***
  51. Factor2     45.0  2  3.8571   0.03528 *  
  52. Factor3      7.5  1  1.2857   0.26804    
  53. Residuals  140.0 24                      
  54. ---
  55. Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement