2

Before I go into my question I'd like some clarification on fixed and random effects. From what I understand "Effects are fixed if they are interesting in themselves or random if there is interest in the underlying population". So the variable "teachers" would be a fixed effect if I care about particular teachers but a random effect if I care about teachers in general. Is that correct? Keep in mind I'm working in Ecology and strict statistical definition will probably be lost on me.

My real question is whether I should nest some groups within my study. I have 3 categorical variables "site", "season", "bowl color" and a response/dependent variable "abundance". "Site" is set as a random effect. Abundance was measured repeatedly at each site during each season. And bowls of each color were placed in all sites during each season. It does not seem to me like any of my groups should be nested within another. However it was suggested to me that I might need to nest season within site. Is this correct?

In R my model is:

lmer(Abundance ~ Seasons + Color + (1|Site/Seasons), data=data)

I'm thinking I should just use (1|Site) instead.

From what I understand in a mixed model  group A should be nested within group B if certain categories in group A are only found in certain categories of group B. For example "teachers" would be nested within "school" if some teachers only teach at one school, so teachers 1-5 only teach at school1, teachers 6-10 only at school2 etc... If all teachers teach at all the schools than group A should not be nested within group B, is that correct?

Also the example in this link seems to contradict my understanding: http://www.jason-french.com/tutorials/repeatedmeasures.html. It seems to me like the groups should not be nested but the authors nest them anyway. Is it wrong or am I missing something?

amoeba
  • 93,463
  • 28
  • 275
  • 317
  • If somebody suggests you to nest season within site, why don't they suggest to nest color within site as well? From your description, it sounds like color and season are in the same relationship with site. Another question: for each color-site-season combination, do you have 1 abundance measurement, or more? – amoeba Jul 22 '17 at 22:31
  • They also suggested nesting "color" but they were less sure about that. For each color-site-season combination there is only one abundance measurement. I don't understand why i would need to nest season and abundance within site. to me they look like they are crossed not nested within site. – rhomboideus capitis Jul 22 '17 at 23:25
  • 1
    Yes, they are crossed. However, color and season are *repeated measures* on each (random) site. To mimic in lmer what classical repeated-measures ANOVA is doing to analyze this design, one needs to include (1|site) and also (1|site:season) which together are equivalent to (1|site/season). The idea is that each site can have its own random deviation from the rest but also each site-season combination can have its own random deviation as well. In mixed models logic, it is much more common to use (season|site) approach. – amoeba Jul 23 '17 at 07:56
  • [cont.] The full model in your case would be `color*season+(color+season|site)`. But one can choose to use a simpler model `color*season+(1|site)`; recommendations differ. – amoeba Jul 23 '17 at 07:57
  • Here is a essentially the same question that I asked some time ago: https://stats.stackexchange.com/questions/232109 but unfortunately without satisfactory answer. At some point I am planning to post an answer there myself. – amoeba Jul 23 '17 at 10:38
  • Ok so are you saying that there are different definition of nested at play here? meaning nested for mixed effect is not the same for repeated measures. also is: `aov(Abundance ~ Seasons*Color + error(Site/(Seasons*Color)),data=data)` the same as: `lmer(Abundance ~ Seasons*Color +(1|Site)+(1|Site:Seasons)+ (1|Site:Color),data=data)` and: `lmer(Abundance~ Seasons*Color+(Color+Season|Site),data=data)` – rhomboideus capitis Jul 23 '17 at 17:36
  • Sorry about the formatting i can't seem to get the 4space indentation right. correct me if i'm wrong, my understanding of the models i wrote in my last comment is that they are essentially saying that the effect of "Season" and "color" may vary by "Site" therefore we are allowing each Site-Seasons-Color combination to have their own variation. – rhomboideus capitis Jul 23 '17 at 17:55
  • Regarding terminology, I don't think there are various meanings of "nested"; color and seasons are NOT nested within sites, and that's it. However, it does make sense to write e.g. `Site/Seasons` in lmer or aov formulas, and so the formula is the same as if they were nested. Hence the confusion between repeated measures and nested factors. Regarding formulas, your `aov` formula is the correct RM-ANOVA specification and yes, it's equivalent to your first `lmer` formula. – amoeba Jul 23 '17 at 18:55
  • [cont.] But the second `lmer` formula is different! E.g. if your season variable has 4 levels, then `(1|Site:Seasons)` estimates one random intercept whereas `(Seasons|Site)` estimates four random terms and 4*3/2=6 correlation parameters between them. So this last model is a quite a bit more complex. But I'd say it's more common approach in the mixed models field. You will rarely see terms like `(1|Site:Seasons)` in the literature on mixed models; I only saw them in the discussions of how to make `lmer` match results of `aov`. – amoeba Jul 23 '17 at 18:58
  • 1
    Thank you, this was very helpful. i found this wonderful site which shows how to replicate what aov does with lme and lmer. i'll put it here just in case someone in the future needs it http://dwoll.de/rexrepos/posts/anovaMixed.html#conventional-analysis-using-aov-1 – rhomboideus capitis Jul 23 '17 at 22:57

0 Answers0