[R] Type II and III sum of squares (R and SPSS)

peter dalgaard pdalgd at gmail.com
Thu Mar 22 14:18:27 CET 2012


On Mar 22, 2012, at 13:29 , Helios de Rosario wrote:

> M3$fattA <- as.factor(M3$fattA)
> 
> Now, type III SS with Anova() only provides sensible results, if the
> factor contrasts are orthogonal, e.g. "contr.sum", "contr.poly", or
> "contr.helmert". This is not the default in R, so you should make it
> explicit:
> 
> f5<-lm(cbind(b1,b2,b3)~fattA,data=M3,
> contrasts=list(fattA="contr.sum"))

Ah, thanks. I did suspect that contrast coding was involved, but nothing happened when I tried changing them. Of course, if one of the "factors" isn't....

Presumably, things also clear up if you code fattA as rep(c(-1,1),each=4).

-- 
Peter Dalgaard, Professor
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list