[R] two way ANOVA with unequal sample sizes

julien claude claude at isem.univ-montp2.fr
Tue Oct 16 21:33:48 CEST 2001


Hi,

I am trying a two way anova with unequal sample sizes but results are not
as expected:

I take the example from Applied Linear Statistical Models (Neter et al.
pp889-897, 1996)

growth rate		gender	bone development
1.4			1		1
2.4			1		1
2.2			1		1
2.4			1		2
2.1			2		1
1.7			2		1
2.5			2		2
1.8			2		2
2			2		2
0.7			3		1
1.1			3		1
0.5			3		2
0.9			3		2
1.3			3		2

expected results are

source of variation	SS	df	MS	F	
gender			0.12	1	0.12	0.74	
bone development	4.1897	2	2.0949	12.89**	
interaction		0.0754	2	0.377	0.23	
Error			1.3	8	0.1625		

# I use 
aov (growrate ~ gender * bonedevelopment)->m
summary(m)

   						  Df      Sum Sq    Mean Sq 	F value   Pr(>F)   
as.factor(gender)                     			2 	4.3063  	2.1531 		13.2501
0.002891 **
as.factor(bonedevlopment)            		1 	0.0926  	0.0926  		0.5697
0.472022   
as.factor(gender:bonedevlopment)  		 2 	0.0754 	 0.0377 	 	0.2321	 0.798034   
Residuals                            			8 	1.3000 	 0.1625      

#if I change the order of factors, results are different
aov (growrate ~ bonedevelopment * gender)->m
summary(m)

                                      		Df 	Sum Sq Mean Sq 	F value
Pr(>F)   
as.factor(bonedevlopment)             	1 	0.0029  0.0029 		 0.0176
0.897785   
as.factor(gender)                    		2 	4.3960  2.1980 		13.5262 0.002713 **
as.factor(gender:bonedevlopment)  	2 	0.0754  0.0377  		0.2321   0.798034   
Residuals                           		8 	1.3000  0.1625      

#In the both cases, results for main effects differ from those expected in
Neter et al.
However interaction and residuals are well estimated.
Can anyone help, either I am wrong in the formula, or either is there an
other problem? Is there a mean to conduct easily the  test as in it is in
Neter et al. ?
The same problems occurs with anova(lm(....))?

thank you very much

julien CLAUDE
-------------------------------

CLAUDE julien
Université Montpellier II
Institut des Sciences de l'Evolution de Montpellier
Laboratoire de Paléontologie (Morphométrie), Cc64
2, Place Eugène Bataillon.
34095, Montpellier, cedex 5
FRANCE

Phone :  (33) 4 67 14 47 82
Fax : (33) 4 67 14 36 10
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list