[R] LME and overall treatment effects

Mark Bilton mark.bilton at uni-tuebingen.de
Thu Jul 14 20:02:39 CEST 2011

Hello fellow R users,

I am having a problem finding the estimates for some overall treatment  
effects for my mixed models using 'lme' (package nlme). I hope someone  
can help.

Firstly then, the model:
The data: Plant biomass (log transformed)
Fixed Factors: Treatment(x3 Dry, Wet, Control) Year(x8 2002-2009)
Random Factors: 5 plots per treatment, 5 quadrats per plot (N=594 (3*5*5*8)
with 6 missing values).

I am modelling this in two ways, firstly with year as a continuous variable
(interested in the difference in estimated slope over time in each treatment
'year*treatment'), and secondly with year as a categorical variable
(interested in difference between 'treatments').

When using Year as a continuous variable, the output of the lme means  
that I can compare the 3 treatments within my model...
i.e. it takes one of the Treatment*year interactions as the baseline  
and compares (contrasts) the other two to that.
I can then calculate the overall treatment*year effect using  

However, the problem comes when I use Year as a categorical variable.  
Here, I am interested solely in the Treatment effect (not the  
interaction with year). However, the output for the two labelled  
'Treatment's against the third comparison, are not the overall effect  
but are a comparison within a year (2002). I can still get my overall  
effect (using anova.lme) but how do I calculate the estimates (with  
P-Values if possible) for each seperate overall treatment comparison  
(not within year). I tried 'glht' (package 'multicomp') but this only  
works if there are no interactions present, otherwise again it gives a  
comparison for one particular year.

Very grateful for any assistance,

More information about the R-help mailing list