Skip to content
Back to formatted view

Raw Message

Message-ID: <F344B8AE-37B8-4CA6-99F2-13AC74F6E6B7@gmail.com>
Date: 2012-03-22T13:18:27Z
From: Peter Dalgaard
Subject: Type II and III sum of squares (R and SPSS)
In-Reply-To: <4F6B29540200000C0000E792@mailhost.biomec.upv.es>

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