[R-sig-ME] MCMCglmm with datasets of different lengths
David Duffy
David.Duffy at qimr.edu.au
Thu May 9 07:24:22 CEST 2013
> But then, ANOVA does not seem to be an appropriate model here as the
> assumption of data independence is violated (each subject reads the same
> sentences repeatedly).
Not necessarily so, given you have speaker in the model. Are tempo and
sentence order randomized? Vary by speaker?
> So I have been recommended to use linear mixed models,
> which apparently gets more and more popular in my field. These models,
> however, tell me a very different story of what I can see in the data:
Not if you fit comparable models. Looking at the interaction terms,
ISTM you can use random slopes. Anyway, enough already ;)
x <- read.table("BonnTempoData.txt", h=T)
for(i in 1:3) x[,i] <- as.factor(x[,i])
hist(x$percentV)
shapiro.test(x$percentV) # Not usually recommended
library(MASS)
boxcox(percentV ~ (speaker+tempo+sentence)^2, data=x)
anova(lm(percentV ~ (speaker+tempo+sentence)^2, data=x))
qqnorm(r <- residuals(lm(percentV ~ (speaker+tempo+sentence)^2, data=x)))
qqline(r)
with(x, plot(percentV ~ tempo, notch=TRUE, col="grey90"))
with(x, points(jitter(as.numeric(x$tempo)), x$percentV))
aline <- function(i) {y <- as.vector(by(x$percentV[x$speaker==i],
x$tempo[x$speaker==i], mean));
lines(1:5,y,col=as.integer(i), lwd=3);
points(1:5,y,col=as.integer(i),pch=16,cex=3)
}
for(i in levels(x$speaker)) aline(i)
| David Duffy (MBBS PhD) ,-_|\
| email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / *
| Epidemiology Unit, Queensland Institute of Medical Research \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v
More information about the R-sig-mixed-models
mailing list