Skip to content

Question regarding lme mixed model, error in case 1, not in case 2

2 messages · Petter Hedberg, Joerg Luedicke

#
Hi all subscribing to the r-sig-mixed-model list.
I have questions regarding the model I use, weather it makes sense, and why
I receive an error message in case 1 but not in case 2. It is a repeated
measure experiment.

The experiment consists of two fields, that are divided up in stripes were
every 2nd stripe has been treated with hay-transfer and every 2nd is a
control were no hay transfer has been conducted.
In each stripe 2 permanent plots of 2 m x 2 m were placed out, and
vegetation monitored for three years. Due to that there are differences in
elevation between the plot, each plots elevation has been measured.

The Explanatory variables I have is then Year (2009,2010,2011),Treatment
(Hay/No Hay), and (Elevation).
The response variables are % cover of different vegetation groups.
If I take the vegetation group sedges as an example.

Case 1: mydata<-lme(Sedges~as.factor(Year)*Treatment*Elevation) gives me
this error message

"Error in getGroups.data.frame(dataMix, groups) :
  Invalid formula for groups"

If I however include Site Number (There are 2 sites, with identical design)
I don?t get any error message at all.
Including it as a random is in my opinion not wrong, but not necessary for
this experiment.


Case 2:
mydata<-lme(Sedges~as.factor(Year)*Treatment*Elevation,random=~1|SiteNumber)

Would greatly appreciate any help on this issue.

Best regards, Petter Hedberg
#
Some thoughts:

1) In "Case 1" you don't specify a random effect and thus your model
would reduce to a simple linear model. I have never tried it but I can
imagine that specifying at least one random effect is required by
-lme-.

2) Did you look at main effects and 2-way interactions first before
including the 3-way interaction effect?

3) With only 2 fields, estimating a random effect will not be very
useful. But what about stripes? I think you should have varying
intercepts and/or slopes across stripes (or at least check if there is
variation across stripes). If you have perfectly balanced data and no
variation across stripes, I would believe you do not really need a
mixed effects model here. But I might very well miss something since I
am not familiar with agricultural research.

4) If your dependent variable is a percentage/ proportion, a linear
model might not be suitable. How are your outcome variables measured
exactly?

J.
On Wed, Mar 21, 2012 at 6:26 AM, Petter Hedberg <phedberg at biol.uw.edu.pl> wrote: