[R] lme() F-values disagree with aov()

From: William Simpson <wsimpson_at_utsc.utoronto.ca>
Date: Tue 15 Aug 2006 - 00:27:19 EST


I have used lme() on data from a between-within subjects experiment. The correct ANOVA table is known because this is a textbook example (Experimental Design by Roger Kirk Chapter 12: Split-Plot Factorial Design). The lme() F-values differ from the known results. Please help me understand why.

d<-read.table("kirkspf2.dat",header=TRUE) for(j in 1:4) d[,j] <- factor(d[,j]) ### Make vars into type "factor"

##lme() results

library(nlme)
fit<-lme(y~a*b*c,random=~1|s, data=d)
anova(fit)

##correct anova table
##subjects are nested within a; a between, b & c within
fit2<-aov(y ~ a*b*c + Error(s/(c*b)), data=d) summary(fit2)

I suspect I need a different random=... statement in lme(). Thanks very much for any help
Bill

The data file is attached -- kirkspf2.dat Here it is again:

s a c b y
1 1 1 1 3
1 1 1 2 7
1 1 2 1 4
1 1 2 2 7
2 1 1 1 6
2 1 1 2 8
2 1 2 1 5
2 1 2 2 8
3 1 1 1 3
3 1 1 2 7
3 1 2 1 4
3 1 2 2 9
4 1 1 1 3
4 1 1 2 6
4 1 2 1 3
4 1 2 2 8
5 2 1 1 1
5 2 1 2 5
5 2 2 1 2
5 2 2 2 10
6 2 1 1 2
6 2 1 2 6
6 2 2 1 3
6 2 2 2 10
7 2 1 1 2
7 2 1 2 5
7 2 2 1 4
7 2 2 2 9
8 2 1 1 2
8 2 1 2 6
8 2 2 1 3
8 2 2 2 11



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 Tue Aug 15 00:42:29 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 Tue 15 Aug 2006 - 02:23:24 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.