[R] type II and III Sum square whit empty cells

Mario Morales malfonso at telecom.com.co
Tue Apr 11 19:04:30 CEST 2006


Dear all

I need to run an anova from a factorial model

y_{ijk}=\alpha_i+\beta_j+(\alpha\beta)_{ij}+e_{ijk}

and calculate type II and III sums of square, but I have an empty
cells, so anova function from package car fail. (I believe)


y<-c(7,13,6,10,8,11,8,3,7,5,65)

a<-as.factor(c(1,1,2,2,3,3,3,1,1,1,2))

b<-as.factor( c(rep(1,7),rep(2,4)) )

table(b,a) # cell (2,3) is empty

mod<-lm(y~ a+b+a:b)

library(car)

Anova(mod,type="II")  # don't work

How can I calculate type II and III sum of square whit empty cell?

Thanks a lot




More information about the R-help mailing list