# [R] between-within anova: aov and lme

From: William Simpson <wsimpson_at_utsc.utoronto.ca>
Date: Thu 03 Aug 2006 - 22:01:18 EST

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.
1. 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@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. Received on Thu Aug 03 22:07:33 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 12 Aug 2006 - 22:19:17 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.