[R] between-within anova: aov and lme

William Simpson wsimpson at utsc.utoronto.ca
Fri Aug 4 14:03:48 CEST 2006


Well nobody answered :-(
Nobody on R-help is doing anovas I guess -- I don't blame them! (It's just for aggies.)

In the absence of any response and for no good reason I am doing:
fitn1 <- aov(amplitude ~ stereo*site*stimulus + Error(subject), stereon1) This is
Bill Venables's way.
And when the data are unbalanced I am doing:
lme(amplitude ~ site+stimulus+stereo*stimulus, random=~1|subject, method="ML",
stereon1)

And I have no clue why.

Every discussion of between-within ANOVA I have read (practical or mathematical) is
either vacuous or opaque...

Cheers
Bill
> I have 2 questions on ANOVA with 1 between subjects factor and 2 within factors.
>
> 1. I am confused on how to do the analysis with aov because I have seen two
examples on the web with different solutions.
>
> a) Jon Baron (http://www.psych.upenn.edu/~baron/rpsych/rpsych.html) does 6.8.5
Example 5: Stevens pp. 468 - 474 (one between, two within)
>
> between: gp
> within: drug, dose
> aov(effect ~ gp * drug * dose + Error(subj/(dose*drug)), data=Ela.uni)
>
> b) Bill Venables answered a question on R help as follows.
>
> - factor A between subjects
> - factors B*C within subjects.
>
> aov(response ~ A*B*C + Error(subject), Kirk)
> "An alternative formula would be response ~ A/(B*C) + Error(subject), which would
only change things by grouping together some of the sums of squares."
>
> -------------------------------------------------------
> SO: which should I do????
> aov(response ~ A*B*C + Error(subject), Kirk)
> aov(response ~ A/(B*C) + Error(subject), Kirk)
> aov(response ~ A*B*C + Error(subject/(B*C)), Kirk)
> --------------------------------------------------------
>
> 2. How would I do the analysis in lme()?
> Something like
> lme(response~A*B*C,random=~1|subject/(B*C))???
>
>
> Thanks very much for any help!
> Bill Simpson
>
> ______________________________________________
> R-help at 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 and
provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list