Thank you for your explanation, Richard.
But I want to confirm whether I understand you correctly.
Take "ancova(Sodium ~ Calories + Type, data=hotdog)" for example.
Calories is the covariate in the formula, right ?
If Calories is the covariate, the result of that command shows Type is
significant (as below), then how to do post hoc test on Type? Type has
three levels, ie. Beef, Meat, and Poultry. The ancova() result does not
carry out multiple comparison between them.
Thank you very much.
> ancova(Sodium ~ Calories + Type, data=hotdog)
Analysis of Variance Table
Response: Sodium
Df Sum Sq Mean Sq F value Pr(>F)
Calories 1 106270 106270 34.654 3.281e-07 ***
Type 2 227386 113693 37.074 1.336e-10 ***
Residuals 50 153331 3067
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.
RICHARD M. HEIBERGER wrote:
>
> 2010/3/14 Dejian Zhao >
>
> To provide more details about the confusing results mentioned in
> my previous email. Some parameters (eg. Sum Sq, Mean Sq, F value,
> Pr) about the two variables seem to depend on the order in the
> formula, and the variation of probability (Pr) directly changes
> the significance. As to my own data, changing the variables order
> in the formula leads to changes from significance to
> non-significance for one variable.
>
>
> Yes, this is correct, and indeed is part of the point of the example.
>
> The sequential sum of squares depends on the sequence.
> The ANOVA table for
> ancova(Sodium ~ Calories + Type, data=hotdog)
> allows you to test for the effect of Type conditional on Calories
> already in the model.
>
> ancova(Sodium ~ Type + Calories, data=hotdog)
> allows you to test for the effect of Calories conditional on Type
> already in the model.
>
> The Graph, the Residual Sum of Squares, the residuals, and the
> predicted values depend on the
> entire model. But the individual rows of the ANOVA table depend on
> the order in which
> the variables were brought into the model.
>
> Look up "sequential sum of squares" in any intermediate statistics text.
> I will recommend mine http://springeronline.com/0-387-40270-5
>
> Rich
[[alternative HTML version deleted]]