Hi Thomas,

I'm anxious to see what more experienced folks say, but in the mean time,
as I understand it, your first model is the right one:

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

In this model, "year" is a fixed variable and "plot" is the random variable
and you're testing for an interaction between "year" and "plot".

You may find Chapter 5 of Zuur et al.'s (2009) Mixed Effects Models and
Extensions in Ecology with R, Springer useful.  The book describes a method
for determining the optimal random structure of a mixed-effect model using
nlme rather than lme4, but it is a useful heuristic.

Christian






On Mon, Jun 30, 2014 at 5:33 AM, Thomas Möckel <thomas.mockel@nateko.lu.se>
wrote:

> 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@nateko.lu.se
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>



-- 
Christian Perry
Ph.D. Candidate
New York Cooperative Fish and Wildlife Research Unit
Department of Natural Resources
Cornell University
618 Bradfield Hall
Ithaca, NY 14853
Phone: 607-255-2839
email: pcp35@cornell.edu

*"And remember, also," added the Princess of Sweet Rhyme, "that many places
you would like to see are just off the map and many things you want to know
are just out of sight or a little beyond your reach.  But someday you'll
reach them all, for what you learn today, for no reason at all, will help
you discover all the wonderful secrets of tomorrow."  *from *The Phantom
Tollbooth, *Norton Juster, 1961, 10th page of chapter 18.

	[[alternative HTML version deleted]]

