Skip to content

Different results

4 messages · vasilis pappas, Peter Dalgaard, David Scott +1 more

#
vasilis pappas <vasileios_p at yahoo.gr> writes:
You need  x <- factor(x) , I guess.
#
On Thu, 27 May 2004, [iso-8859-7] vasilis pappas wrote:

            
If you want to do a traditional one-way anova, you have to declare x
to be a factor:
Df Sum Sq Mean Sq F value    Pr(>F)    
x            1 9264.1  9264.1  26.414 3.761e-05 ***
Residuals   22 7715.9   350.7                      
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Df  Sum Sq Mean Sq F value    Pr(>F)    
xf           2 12320.1  6160.0  27.761 1.269e-06 ***
Residuals   21  4659.9   221.9                      
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 


Notice that when x is not a factor there is only one degree of freedom for 
x.

David Scott






_________________________________________________________________
David Scott	Department of Statistics, Tamaki Campus
		The University of Auckland, PB 92019
		Auckland	NEW ZEALAND
Phone: +64 9 373 7599 ext 86830		Fax: +64 9 373 7000
Email:	d.scott at auckland.ac.nz 


Graduate Officer, Department of Statistics
#
x is numeric, so R consider this to be a linear regression, not a 3 group analysis. To do the latter in R:

x<-factor(1:3)

Read the R Introductory manuals or the first few and other relevant chapters Venables' and Ripley's MASS first, please!

-- Bert Gunter
vasilis pappas wrote:

            
--

Bert Gunter

Non-Clinical Biostatistics
Genentech
MS: 240B
Phone: 650-467-7374


"The business of the statistician is to catalyze the scientific learning process."

 -- George E.P. Box