[R] Random effects ANOVA?
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Mar 30 09:36:20 CEST 2006
I think you want print or summary rather than anova. anova() is not very
useful for aov() models even without error strata. The point of the aov
classes is that they present the results of lm() fits in ways which are
more conventional for designed experiments, including giving conventional
ANOVA tables without recourse to anova().
I didn't follow how the videos were chosen. Random effects apply when the
'treatments' were chosen from a large population (which might apply if
each subject watched (on separate occasions) three videos chosen randomly
from a larger pool), and if the interest is in the variability of the
response over videos in the pool. If subjects were observed more than
once then I suspect you most likely want a random effect for subjects.
What I guess is more likely is that you have 60 measurements on 60
subjects, each of whom was assigned one video and one drink. Then there
appear to be no random effects, and the problem caused by randomly
selecting videos is that the experiment is likely to be unbalanced (since
each video is not going to be selected 20 times by chance). aov() is
primarily intended for balanced designs, and interpretation is tricky
without balance (see the warnings on its help page).
There are many loose ends hindering offering help by email, and the best
advice is to consult a statistician face-to-face about an appropriate
analysis.
On Wed, 29 Mar 2006, Chris Bergstresser wrote:
> Hi all --
>
> So I have a very simple dataset, which consists of 60 subjects,
> who watched one of three videos, drank one of two drinks, and
> completed a task. The response variable is the time to complete the
> task. The ANOVA command is simple enough: anova(aov(time ~ drink *
> video, data = df));
>
> However, the videos were randomly selected; I need to use the
> random effects model for them. So I tried anova(aov(time ~ drink +
> Error(video), data = df)); This gives me a "no applicable method for
> 'anova'" error.
>
> The command aov works, but doesn't give me anything I can interpret
> effectively. Is there a simpler command I should be using? Am I
> doing something wrong?
>
> -- Chris
--
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
More information about the R-help
mailing list