Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.44.0304111147380.17384-100000@gannet.stats>
Date: 2003-04-11T10:52:48Z
From: Brian Ripley
Subject: multiple numerical variables in aov
In-Reply-To: <20030411104206.18113.qmail@web41114.mail.yahoo.com>

On Fri, 11 Apr 2003, Rishabh Gupta wrote:

>  I have a question regarding the anova function aov(). I want to perform 
> an anova calculation
> using one grouping variable but more than one numerical variables:
> So instead of:
>      aov(v ~ g)
> I want something like
>      aov(v1 + v2 + v3 ~ g)
> Essentially I want to find out whether the variables v1, v2, v3, etc can collectively discriminate
> between different values of variable g. Could somebody tell whether this is possible and if so
> how?

You might intend MANOVA, run in R by

summary(manova(cbind(v1,v2,v3) ~g)))

but from your words it sounds like you want lda(g ~ v1+v2+v3).

> Also, could somebody please tell me the difference between the aov() function and the anova()
> function. I've been using aov() so far and it seems to work fine. Could somebody tell me what the
> difference is and which one is better.

They are completely different. anova() extracts results from one or more
fitted models.

See the help pages or any of the good books on using S.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595