[R] Trouble with mixed model anova (incl. random block)

Philippe Hensel Philippe.Hensel at noaa.gov
Wed Nov 17 23:28:29 CET 2010

Dear R community,
I have slightly unbalanced survey/land elevation data (over 7,000 data 
points, grouped according to 60 transects, 30 in each of two 
treatments).  Observations in both treatments are taken simultaneously, 
and the surveying of all 60 transects took 22 days.  Comparisons among 
treatments have to be restricted to the same days the two treatments 
were sampled.

I think the following model would be appropriate (at least at a first cut):

Elevation   =
         Day        (Random block)
         Treatment        (Fixed)
         Day x Treatment        (Random, error for Treatment)
         Transect (Day, Treatment)        (Random)
         Point (Transect, Day, Treatment)        (Random - residual error)

What are good candidates for algorithms to test this nested error 
anova?  I have been trying lme() and  lmer(), but I am confused as to 
how I should code for the nested error structure. I have tried:

lme(Elevation ~ Treatment, random = ~Day | Transect, data)
lmer(Elevation ~ Treatment + (1|Day / Transect), data)

I am not yet very familiar with the R output, so it is hard for me to 
figure out if I have written the model statements correctly.
How do I code for Day x Transect to make sure that it is being used as 
the error term for evaluating the fixed Treatment effect?
How do I code for Transect(Day, Treatment)?
In the anova output for the lme function, I get a highly significant 
intercept, but a non-significant Treatment effect (p=0.34).
In the anova output for the lmer function, I get a significant Treatment 
effect (p = 0.03).  How can I reconcile these two?
The log-likelihoods are similar: 15183 (lme) and 15189 (lmer).  Values 
of AIC and BIC are also similar between the two models.

Before I go any further and compare to an intercept-only model (no 
Treatment effects), I wanted to make sure I chose the correct path and 
interpret correctly.

Thank you in advance for any assistance.



Philippe Hensel, PhD
Physical Scientist
NOAA National Geodetic Survey
1315 East-West Hwy.
Silver Spring MD 20910
(301) 713 3198 ext. 137

More information about the R-help mailing list