[R] Question about factor that is numeric, in aov()

2010-05-09 Thread Ravi Kulkarni
I notice something curious about how aov() treats a numeric factor: score is a dependent variable and group is a factor in a one-way ANOVA. But group contains numeric codes and is not a factor (checked with is.factor). An ANOVA done using: aov(score~factor(group), data=mydata) gives the right

Re: [R] Question about factor that is numeric, in aov()

2010-05-09 Thread David Winsemius
On May 9, 2010, at 8:36 AM, Ravi Kulkarni wrote: I notice something curious about how aov() treats a numeric factor: score is a dependent variable and group is a factor in a one-way ANOVA. But group contains numeric codes and is not a factor (checked with is.factor). An ANOVA done using:

Re: [R] Question about factor that is numeric, in aov()

2010-05-09 Thread Adrian Dusa
Dear Ravi, On Sunday 09 May 2010, Ravi Kulkarni wrote: I notice something curious about how aov() treats a numeric factor: In R, there is no such thing as a numeric factor. A numeric vector is not a factor unless declared as such. score is a dependent variable and group is a factor in a

Re: [R] Question about factor that is numeric, in aov()

2010-05-09 Thread Dennis Murphy
Hi: On Sun, May 9, 2010 at 5:36 AM, Ravi Kulkarni ravi.k...@gmail.com wrote: I notice something curious about how aov() treats a numeric factor: score is a dependent variable and group is a factor in a one-way ANOVA. But group contains numeric codes and is not a factor (checked with