[R-sig-ME] nesting hierarchy in glmer

Hariet Rose harietrose123 at gmail.com
Sun May 29 18:24:02 CEST 2016

Hi, I am a newbie at posting on this forum and relatively new to R.  My
question is about nesting in glmer and examples on the forums do not
correspond to my experiment, especially as I think I could run my design as
two separate analyses.

I have a glasshouse complex study where I have six independent rooms. Three
rooms were randomly chosen to be set at the hot temperature for the
duration of the experiment, and another three rooms were randomly chosen
and set at a cold temperature for the duration of the experiment (13
weeks).  This is why I think I could run two separate models


[There were other rooms that I didn’t use although they were ‘available’ to
be chosen randomly].

 For my question, I want to know if two populations (pops = pop1, pop2) of
seedlings respond in different ways to 3 water dosages under the
temperature regimes. The rooms were stocked evenly with seedlings from two
different populations of the same species; each seedling in each room
received only 1 of 3 water doses; local, wet or dry.  I measured
survivorship of seedlings at week 13 and the response was 1 = alive or 0 =
dead.  In the models below “id” is the code I have given to all plants that
received the same treatment within a room (e.g.id 1=  replicate 1, all
plants from pop1 in room1 (hot)  that received the local water treatment)..

As all seedlings died when the following treatments were applied;  hot +
dry, hot +local and cool + dry, I have a very skewed response.  This
suggests to me that some model simplification may be possible...

Because the two temperatures could be seen as independent experiments and
because of the skewed response I am thinking it would be simpler to run two
separate models, one for the cool rooms and another for the hot rooms;

R version 3.1.3 (2015-03-09), library(lme4)

coolmodel <- glmer(survivorship ~ room*pops*dose * (1|room/id), family
= binomial, data = mydata1)

 mydata1 is a matrix of cool room data only and the samples from the
dry dose treatment have been removed (i.e., both pops of dry dosed
plants died).

hotmodel <- glmer(survivorship ~ room*pops * (1|room/id), family =
binomial, data = mydata2)

mydata2 is a matrix of hot room data only and the samples from the dry
and local have been removed (i.e., both pops of dry and local dosed
plants died)

in the above model, because there were only survivors for one dose
(wet) I have not specified the fixed effect of dose.

Question 1. Is the above approach correct? I am concerned that the
nesting of id may be incorrect.

For the combined cool and hot room data set, I have used this model

bothtempsmodel <- glmer(survivorship ~ temp*pops*dose *
(1|temp/room/id), family = binomial, data = mydata)

where mydata has all samples from all temps, rooms, and treatments –
i.e., no data have been removed.

Question 2. In the bothtempsmodel, if I have explained the nesting and
everything else correctly, I end up with many significant two and the
three way interaction/s whereas coolmodel and hotmodel have outputs
that are simplified.
Would a strategy be to specify the full model (bothtempsmodel) and
then go on to explain and implement the simplified coolmodel and
hotmodel, with the removal of data as explained above.

 I can post the outputs if anyone is interested..

 Thank you very much for your time.. :) hariet-rose

	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list