[R-sig-eco] Nested factors in GLMER

Thomas Möckel thomas.mockel at nateko.lu.se
Mon Jun 30 11:33:51 CEST 2014


Dear list members,

I have species composition and abundance data of 17 plots sampled in two 
different years. From the first year to the second a general decrease in 
Ca-content and pH occurred in the area.
For each plot and year I also have two explanatory variables (Ca-content 
and pH).

My response variable is species richness (count data). I want to test if 
species richness is related to Ca-content and pH and if there is
a difference between the two years.

As I understand it should be a generalized linear mixed effect model 
with Poisson error distribution.
What I am not sure about is how to build the random term. Each plot is 
sampled twice which means that plots are pseudo-replicates.
Should the random term consist of plot within year or year within plot?

glmer(species richness ~ Ca +(year|plot), family=poisson, data=data)

or

glmer(species richness ~ Ca +(plot|year), family=poisson, data=data)


Also, if I include "year" in the random term,
how can I see if there is a difference between years and test the 
strength of that difference?

Thank you very much for your help!


-- 
*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*
Thomas Möckel, PhD student

Department of Earth and Ecosystem Science
Lund University
Sölvegatan 12
SE-223 62 Lund
Sweden

Tel:+46 (0)46 - 222 4887
E-mail: Thomas.Mockel at nateko.lu.se



More information about the R-sig-ecology mailing list