Analysis of Covariance using R

 

Using hwy as the dependent variable, cyl as the independent variable, and also add cty as a continuous variable to this model.

> summary(aov(hwy ~ factor(cyl) + cty))
  
            Df  Sum Sq    Mean  Sq F value   Pr(>F) 
factor(cyl)  3    4836  1612.1       525.9   <2e-16 ***
cty          1    2724  2723.5       888.6   <2e-16 ***
Residuals 229 702 3.1 
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

 

 

See Also:

Do the same test in SAS

Leave a Reply

Your email address will not be published. Required fields are marked *