Skip to content

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

2 messages · Helios de Rosario, Peter Dalgaard

#
<marco.tommasi at unich.it> wrote
III
factor
the
sum
beteween
You are missing a couple of important points here. First, fattA is a
factor according to your description, but you have coded it as a numeric
variable. You must coerce it to factor:

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"))

Now, Anova() gives the same results regardless of the SS type:
Try:
summary(Anova(f5,idata=d2,idesign=~fB,type=2),multivariate=FALSE)
summary(Anova(f5,idata=d2,idesign=~fB,type=3),multivariate=FALSE)

I recommend you read Fox's and Weisberg's book that explain many
functions of "car", including ANOVA. See specially pages 193 and
following. Type
 carWeb()
to go to its webpage.

Helios

INSTITUTO DE BIOMEC?NICA DE VALENCIA
Universidad Polit?cnica de Valencia ? Edificio 9C
Camino de Vera s/n ? 46022 VALENCIA (ESPA?A)
Tel. +34 96 387 91 60 ? Fax +34 96 387 91 69
www.ibv.org

  Antes de imprimir este e-mail piense bien si es necesario hacerlo.
En cumplimiento de la Ley Org?nica 15/1999 reguladora de la Protecci?n
de Datos de Car?cter Personal, le informamos de que el presente mensaje
contiene informaci?n confidencial, siendo para uso exclusivo del
destinatario arriba indicado. En caso de no ser usted el destinatario
del mismo le informamos que su recepci?n no le autoriza a su divulgaci?n
o reproducci?n por cualquier medio, debiendo destruirlo de inmediato,
rog?ndole lo notifique al remitente.
#
On Mar 22, 2012, at 13:29 , Helios de Rosario wrote:

            
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).