Skip to content

nesting hierarchy in glmer

2 messages · Hariet Rose, Thierry Onkelinx

#
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
#
Dear Hariet Rose,

It looks like you scenario's (temperature:dose) were too extreme since all
seedlings died in some scenario's. Keep that in mind when designing your
next experiment.

First of all adding room to both the fixed effect as the random effect is
not OK in case of categorical variables:
https://rpubs.com/INBOstats/both_fixed_random

To salvage as much as possible I'd remove the scenario's in which all
seedlings died. Then fit one model:

glmer(survivorship ~ pops * scenario + (1|room/id), family = binomial, data
= all.relevant.data)

Best regards,


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

2016-05-29 18:24 GMT+02:00 Hariet Rose <harietrose123 at gmail.com>: