Nov 23, 2011 at 1:27am Andreas wrote:

> I would like to do multiple comparisons for treatment levels within day
> (i.e. across treatments
> for each day in turn)

Andreas,

The following does what you want. To see how/why it works, look at the
vignette to package multcomp, where there is an example. Note that I had to
change "mean.on.active" to "mean_on_active".

##
library(nlme); library(multcomp)
Tdf <- "Your attached data set"
m.final<-lme(mean.on.active ~ treat * day,random=~1|id,na.action=na.omit,
data=Tdf)
Tdf$IntFac <- interaction(Tdf$treat, Tdf$day, drop=T)
m.finalI<-lme(mean.on.active ~ IntFac,random=~1|id,na.action=na.omit,
data=Tdf)
summary(m.final)
summary(m.finalI)
glht(m.finalI, linfct=mcp(IntFac = "Tukey"))

Regards, Mark.

-----
Mark Difford (Ph.D.)
Research Associate
Botany Department
Nelson Mandela Metropolitan University
Port Elizabeth, South Africa
--
View this message in context: 
http://r.789695.n4.nabble.com/glht-for-lme-object-with-significant-interaction-term-tp4097865p4099459.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@r-project.org 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.

Reply via email to