[R] Anova problem with order of terms in model

From: Martin Julien <martin.julien.2_at_courrier.uqam.ca>
Date: Wed 18 Jan 2006 - 07:33:57 EST


Hi
I have a linear model and I want to tests whether the model terms are significant
I used anova but F and P value depend on the order of the terms in the model.
I have repeated the same analysis in another stat software and F and P value did not differ with order of terms in the model. Can anyone can explain what happen or what am I doing wrong ?

In R
> anova (lm(Y~X.1+X.2))
Analysis of Variance Table
Response: Y

		Df	Sum Sq		Mean Sq	F value		Pr(>F)
X.1		1	4.0351		4.0351		6.5187
0.01852
X.2		1	0.5903		0.5903		0.9537
0.33991
Residuals	21	12.9991		0.619

> anova (lm(Y~X.2+X.1))
Analysis of Variance Table
Response: Y

		Df	Sum Sq		Mean Sq	F value		Pr(>F)
X.2		1	1.9651		1.9651		3.1747
0.08926
X.1		1	2.6603		2.6603		4.2977
0.05066
Residuals	21	12.9991		0.619		

With another stat software (JMP)
Y~X.1+X.2

		Df	Sum Sq		Mean Sq	F value		Pr(>F)
X.1		1	2.6603		2.6603		4.2977
0.05066
X.2		1	0.5903		0.5903		0.9537
0.33991
Residuals	21	12.9991		0.619		

Y~X.2+X.1
		Df	Sum Sq		Mean Sq	F value		Pr(>F)
X.2		1	0.5903		0.5903		0.9537
0.33991
X.1		1	2.6603		2.6603		4.2977
0.05066
Residuals	21	12.9991		0.619		


---------------------------------------------------------------------------
Julien Martin

Canadian Research Chair in behavioural ecology Université du Québec à Montréal

Email: martin.julien.2@courrier.uqam.ca



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jan 18 07:59:19 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:05 EST