[R] type III Sum Sq in ANOVA table - Howto?

Liaw, Andy andy_liaw at merck.com
Fri Mar 7 00:49:41 CET 2003


The short answer: use drop1().

The long(er) answer: think harder about what question(s) you want answered
(i.e., what hypotheses you really want to test, and test only those).  The
model hierarchy says that a model should not have an interaction term
involving a factor whose main effect is not present in the model.  Seen in
this light, the hypothesis you're trying to test involves a non-sensical
model.

Andy

> -----Original Message-----
> From: Josef Frank [mailto:josef.frank at gmx.ch]
> Sent: Thursday, March 06, 2003 6:14 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] type III Sum Sq in ANOVA table - Howto?
> 
> 
> Hello,
> 
> as far as I see, R reports type I sums of squares. I'd like 
> to get R to
> print out type III sums of squares. 
> 
> e.g. I have the following model:
> vardep~factor1*factor2
> 
> to get the type III sum of squares for factor1 I've tried
> anova(lm(vardep~factor2+factor1:factor2),lm(vardep~factor1*factor2))
> but that didn't yield the desired result.
> 
> Could anyone give me a hint how to proceed?
> 
> thanks in advance
> Josef
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

------------------------------------------------------------------------------



More information about the R-help mailing list