[R] simple lme question

Ben Bolker bolker at ufl.edu
Thu Jul 23 15:34:44 CEST 2009




Sarah B wrote:
> 
> Hi everyone,
> 
> I am trying to analyse my data from a small plant experiment (for a
> meeting tomorrow afternoon) and am a beginner to R so I apologise if this
> is a very basic question.
> 
> I carried out a plant experiment examining plant interactions between two
> species (A and B) under different watering treatments. I had:
> - 7 watering treatments (7 different watering frequencies labelled 1-7)
> - 3 replicates of each treatment (blocks labelled 1-3)
> 
> I need to see whether I have a significant block effect and as it will be
> a random effect, I need to use lme in R.
> 
> At each watering treatment, I had 5 different combinations of plants. I
> have shown how I have labelled these in brackets for species A:
> A in isolation (Aiso)
> A+A monoculture (Amono)
> A+B interspecific competition (Amix)
> .. and the same combinations for species B.
> I have final biomass data for each of the plants.
> 
> My first step is to check species A for interspecific competition, for
> which I will use:
> 
> Response variable:  Amix (continuous - biomass measurement)
> Random effect:      Block (factor - replicates labelled as 1,2,3)
> Main effect:          watering treatment (wt) (factor, 1-7)
> Covariate:             Aiso (continuous - biomass measurement)
> Covariate:             Amix.initialsize (initial biomass of Amix to
> account for any size variation before treatment was started)
> 
> Before I thought I'd have to include block as random effect, I used the
> following formula for a lm:
> lm1<-lm(Amix~Aiso+wt+block+Amix.initialsize+Aiso:wt)
> 
> but I do not know how to structure this in an lme. Would someone please
> help me with this?
> 
> 

lme:

lm1<-lme(Amix~Aiso+wt+Amix.initialsize+Aiso:wt,random = ~1|block)

or equivalently

 lme(Amix~Aiso*wt+Amix.initialsize,random = ~1|block)


lmer:

 lmer(Amix~Aiso*wt+Amix.initialsize+(1|block))


  Reasons to use lme:
  * better documented (Pinheiro and Bates 2000)
  * better diagnostics/plot methods etc.
  * will handle spatial, temporal autocorrelation models, heteroscedasticity
  * will compute df and p-values for F tests

 Reasons to use lmer:
  * faster/more efficient, especially for large data sets
  * will handle non-normal/count data (GLMMs)
  * will handle crossed designs better

  HOWEVER: since you only have 3 blocks, they are not going to be very well
handled by a 'modern' mixed model.  You may do better using aov() with
an Error term (since your design is balanced/normal), or simply treating
block
 as a fixed effect as you have already
done ... (see e.g. Crawley Data Analysis in S-PLUS ...)

   You might want to send future queries to r-sig-mixed-models at r-project.org
...

 good luck,
    Ben Bolker
-- 
View this message in context: http://www.nabble.com/simple-lme-question-tp24622668p24625867.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list