Skip to content
Prev 5410 / 20628 Next

using mixed model vs just using plot means

Dear Derek,

Your problem is due to the small sample size. Therefore I would not trust the results you get from either lme() nor aov().
Take a look at the example below.

Best regards,

Thierry

library(nlme)
TE <- c(0, 10)
sdPlot <- 1
sdNoise <- 10
dataset <- expand.grid(Treatment = factor(LETTERS[1:2]), Plot =factor(seq_len(3)), Plant = factor(seq_len(2)))
dataset$Plot <- dataset$Treatment:dataset$Plot

tmp <- replicate(1000, {
	dataset$Response <- with(dataset, TE[Treatment] + rnorm(length(levels(Plot)), sd = sdPlot)[Plot] + rnorm(nrow(dataset), sd = sdNoise))
	c(anova(aov(x ~ Treatment, data = aggregate(dataset$Response, dataset[, c("Treatment", "Plot")], FUN = mean)))[1, 5],
	anova(lme(Response ~ Treatment, random = ~ 1|Plot, data = dataset))[2, 4])
})
plot(t(tmp))

#The p-value of the lme model is always equal to or greater than the p-value of the aov model.

#Let's increase the number of plots to ten. Notice that the difference in p-value is much smaller

dataset <- expand.grid(Treatment = factor(LETTERS[1:2]), Plot =factor(seq_len(10)), Plant = factor(seq_len(2)))
dataset$Plot <- dataset$Treatment:dataset$Plot

tmp <- replicate(1000, {
	dataset$Response <- with(dataset, TE[Treatment] + rnorm(length(levels(Plot)), sd = sdPlot)[Plot] + rnorm(nrow(dataset), sd = sdNoise))
	c(anova(aov(x ~ Treatment, data = aggregate(dataset$Response, dataset[, c("Treatment", "Plot")], FUN = mean)))[1, 5],
	anova(lme(Response ~ Treatment, random = ~ 1|Plot, data = dataset))[2, 4])
})
plot(t(tmp))

#Increasing both the number of plots and the number of plants per plot eliminates the difference in p-value.

dataset <- expand.grid(Treatment = factor(LETTERS[1:2]), Plot =factor(seq_len(10)), Plant = factor(seq_len(20)))
dataset$Plot <- dataset$Treatment:dataset$Plot

tmp <- replicate(1000, {
	dataset$Response <- with(dataset, TE[Treatment] + rnorm(length(levels(Plot)), sd = sdPlot)[Plot] + rnorm(nrow(dataset), sd = sdNoise))
	c(anova(aov(x ~ Treatment, data = aggregate(dataset$Response, dataset[, c("Treatment", "Plot")], FUN = mean)))[1, 5],
	anova(lme(Response ~ Treatment, random = ~ 1|Plot, data = dataset))[2, 4])
})
plot(t(tmp))

----------------------------------------------------------------------------
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium

Research Institute for Nature and Forest
team Biometrics & Quality Assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium

tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey