Ellen Andresen
2015-Oct-01 14:59 UTC
[R] glmm: random term, overdispersion and comparisons
Hello, I studied the effect of a hurricane in Cozumel on understory birds. I have bird abundances (i.e. counts) registered always on the SAME six sites (i.e. blocks). I have data for: before the hurricane, first year after the hurricane, second year after the hurricane. I each of these time periods, I also have data for summer season and for winter season. I do not have a balanced design, in one of the time periods I only have data for 5 of the six sites, and for another period I only have data for 3 of the six sites. I am defining Poisson error distrubution for the response variable. I am using 'glmer' with two fixed factors, and I am interested in their interaction: - factor hurricane (three levels: before, after 1 y, after 2 y) - factor season (two levels: summer, winter) I am also specifying a random factor (sites), and I am specifying the nested structure of the design. However, I don't know if I am specifying the random part of the model in the correct way; this is what I am doing: abundance ~ hurricane*season + (1|site/hurricane/season) I have three questions: 1. Is the random part specified correctly? 2. How do I check for overdispersion, and how can I correct for it? (for each site I only have one observation; sites are my replicates) 3. How do I make the following comparisons: I am interested in testing for each season separately, after 1 y vs. before the hurricane, and after 2 years vs. before the hurricane. Thank you so much! Ellen Andresen UNAM-Mexico
Thierry Onkelinx
2015-Oct-02 08:03 UTC
[R] glmm: random term, overdispersion and comparisons
Dear Ellen, You're using the Poisson distribution. There is no error (noise) term in a glmm with Poisson distribution. 1) The random part seems to be quite complicated given the sample size. (1|site) is probably sufficient. Note that your design is not nested but crossed. 2) Overdispersion is likely in bird abundance. You could use a negative binomial distribution instead of a Poisson distribution. Then the overdispersion is modeled. Use the glmer.nb() function. 3) Have a look at the glht() function in the multcomp package. That allows you to test specific contrasts of your model parameters. Note that the r-sig-mixedmodels list is more appropriate for follow-up questions. 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 2015-10-01 16:59 GMT+02:00 Ellen Andresen <eandresens at gmail.com>:> Hello, > I studied the effect of a hurricane in Cozumel on understory birds. I > have bird abundances (i.e. counts) registered always on the SAME six > sites (i.e. blocks). I have data for: before the hurricane, first year > after the hurricane, second year after the hurricane. I each of these > time periods, I also have data for summer season and for winter > season. I do not have a balanced design, in one of the time periods I > only have data for 5 of the six sites, and for another period I only > have data for 3 of the six sites. > I am defining Poisson error distrubution for the response variable. > I am using 'glmer' with two fixed factors, and I am interested in > their interaction: > - factor hurricane (three levels: before, after 1 y, after 2 y) > - factor season (two levels: summer, winter) > I am also specifying a random factor (sites), and I am specifying the > nested structure of the design. However, I don't know if I am > specifying the random part of the model in the correct way; this is > what I am doing: > abundance ~ hurricane*season + (1|site/hurricane/season) > > I have three questions: > 1. Is the random part specified correctly? > 2. How do I check for overdispersion, and how can I correct for it? > (for each site I only have one observation; sites are my replicates) > 3. How do I make the following comparisons: I am interested in testing > for each season separately, after 1 y vs. before the hurricane, and > after 2 years vs. before the hurricane. > > Thank you so much! > Ellen Andresen > UNAM-Mexico > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]