[R] Combining two ANOVA outputs of different lengths

Christoph Scherber Christoph.Scherber at agr.uni-goettingen.de
Fri Aug 10 11:21:37 CEST 2007


Dear R users,

I have been trying to combine two anova outputs into one single table 
(for later publication). The outputs are of different length, and share 
only some common explanatory variables.

Using merge() or melt() (from the reshape package) did not work out.

Here are the model outputs and what I would like to have:

anova(model1)
             numDF denDF  F-value p-value
(Intercept)     1    74 0.063446  0.8018
days     	1    74 6.613997  0.0121
logdiv          1    74 1.587983  0.2116
leg             1    74 4.425843  0.0388

anova(model2)
              numDF denDF   F-value p-value
(Intercept)      1    73 165.94569  <.0001
funcgr           1    73   7.91999  0.0063
grass            1    73  42.16909  <.0001
leg              1    73   4.72108  0.0330
funcgr:grass     1    73   8.49068  0.0047

#"merge(anova(model1),anova(model2),...)"

		F-value 1	p-val1  F-value 2	p-value 2
(Intercept)	0.063446	0.8018	165.94569	<.0001
days		6.613997	0.0121	NA		NA
logdiv		1.587983	0.2116	NA		NA
leg		4.425843	0.0388	4.72108		0.033
funcgr		NA		NA	7.91999	  	0.0063
grass		NA		NA	42.16909	<.0001
funcgr:grass	NA		NA	8.49068		0.0047


I would be glad if someone would have an idea of how to do this in 
principle.

I am using R 2.5.1 on Windows XP.

Thanks very much in advance!

Best wishes
Christoph




	
	
	

			
-- 
Dr. Christoph Scherber
DNPW, Agroecology
University of Goettingen
Waldweg 26
D-37073 Goettingen
Germany

phone +49(0)551 39 8807
fax   +49(0)551 39 8806



More information about the R-help mailing list