violars
01-20-2009, 02:29 PM
Hello everybody,
I’m trying to do some ANCOVAs in R, and am wondering why the output I get from my models changes if I change the order of the variables. Here’s a couple of examples (I can't make the tables align properly...sorry!).
Response~Head+Replicate+Date+Age+Date:Age
Df Sum Sq Mean Sq F value Pr(>F)
Head 5 1257.6 251.5 10.2314 2.092e-08 ***
Replicate 5 832.9 166.6 6.7762 1.055e-05 ***
Date 3 203.3 67.8 2.7565 0.0446151 *
Age 1 340.2 340.2 13.8369 0.0002850 ***
Date:Age 3 539.5 179.8 7.3155 0.0001339 ***
Residuals 144 3540.0 24.6
Response~Replicate+Date+Head+Age+Date:Age
Df Sum Sq Mean Sq F value Pr(>F)
Replicate 5 752.6 150.5 6.1226 3.574e-05 ***
Date 3 203.3 67.8 2.7565 0.0446151 *
Head 5 1337.9 267.6 10.8849 6.752e-09 ***
Age 1 340.2 340.2 13.8369 0.0002850 ***
Date:Age 3 539.5 179.8 7.3155 0.0001339 ***
Residuals 144 3540.0 24.6
Age is a covariate, so I’ve put that last in the model. The other variables are just categorical factors with several different levels.
If anyone could shed any light, I’d be very grateful!!
Cheers :)
I’m trying to do some ANCOVAs in R, and am wondering why the output I get from my models changes if I change the order of the variables. Here’s a couple of examples (I can't make the tables align properly...sorry!).
Response~Head+Replicate+Date+Age+Date:Age
Df Sum Sq Mean Sq F value Pr(>F)
Head 5 1257.6 251.5 10.2314 2.092e-08 ***
Replicate 5 832.9 166.6 6.7762 1.055e-05 ***
Date 3 203.3 67.8 2.7565 0.0446151 *
Age 1 340.2 340.2 13.8369 0.0002850 ***
Date:Age 3 539.5 179.8 7.3155 0.0001339 ***
Residuals 144 3540.0 24.6
Response~Replicate+Date+Head+Age+Date:Age
Df Sum Sq Mean Sq F value Pr(>F)
Replicate 5 752.6 150.5 6.1226 3.574e-05 ***
Date 3 203.3 67.8 2.7565 0.0446151 *
Head 5 1337.9 267.6 10.8849 6.752e-09 ***
Age 1 340.2 340.2 13.8369 0.0002850 ***
Date:Age 3 539.5 179.8 7.3155 0.0001339 ***
Residuals 144 3540.0 24.6
Age is a covariate, so I’ve put that last in the model. The other variables are just categorical factors with several different levels.
If anyone could shed any light, I’d be very grateful!!
Cheers :)