[R-sig-eco] Repeated measures: interaction plot problem (multcomp)

Marcelo Laia marcelolaia at gmail.com
Tue Mar 19 23:30:55 CET 2013


After reading some works, I began to analyze our data set. We are
interested in see how Trat (treatment), Clone (genotype), and Dia (day
in which each variable was measured), could be interfering in the
Planta (plant) growth, and others characteristics.

Everything was fine until I trying to make a graph of interactions
using the function cld () from multcomp package.

For the data analyzed without interaction, it works perfectly. The
problem is when I make the interaction graphic. Please could you run
the code below to view the problem?

datafilename="http://dl.dropbox.com/u/34009642/Dados_Omissao.csv"

data.min <- read.table(datafilename, header=T, sep="\t", dec=",")

head(data.min)

data.min <- within(data.min, {
  Clone <- factor(Clone)
  Dia <- factor(Dia)
  Trat <- factor(Trat)
  Planta <- factor(Planta)
})

summary(data.min)

library(nlme)

anova.lme.repetida <- lme(d ~ Clone * Trat * Dia, random = \
~1|Planta/Dia, method = "ML", data = data.min)

anova(anova.lme.repetida)

library(multcomp)

Trat.h.Tukey <- glht(anova.lme.repetida, linfct=mcp(Trat="Tukey"))

letras <- cld(Trat.h.Tukey)

plot(letras)

# # # # # # # # # # # # # # # # # # # # #
# UNTIL HERE THE GRAPH IS OK
# # # # # # # # # # # # # # # # # # # # #

data.min$CloneTrat <- interaction(data.min$Clone, data.min$Trat)

head(data.min)

anova.lme.repetida.CloneTrat <- lme(h ~ CloneTrat, random = \
~1|Planta/Dia, method = "ML", data = data.min)

anova(anova.lme.repetida.CloneTrat)

CloneTrat.Tukey <- glht(anova.lme.repetida.CloneTrat, \
linfct=mcp(CloneTrat="Tukey"))

summary(CloneTrat.Tukey)

letras <- cld(CloneTrat.Tukey)

#par(cex=0.6)

opar <- par(mai=c(1,1,2.5,1))

plot(letras)

par(opar)

Here it generates a different graph. Note that in the y axis it didn't
show the linear predictor as label, but writes ​​clone 144 and
224. The boxplots are weird. How can I fix this chart to show the
interaction more human-readable?

Thank you!

-- 
  O___   - Marcelo Luiz de Laia
 c/  /'_ - Diamantina
(*)  \(*)- Minas Gerais
~~~~~~~~~- Brazil
^^^^^^^^^- Linux user number 487797



More information about the R-sig-ecology mailing list