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?
color*season+(color+season|site). But one can choose to use a simpler modelcolor*season+(1|site); recommendations differ. – amoeba Jul 23 '17 at 07:57the same as:
and:
– rhomboideus capitis Jul 23 '17 at 17:36Site/Seasonsin 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, youraovformula is the correct RM-ANOVA specification and yes, it's equivalent to your firstlmerformula. – amoeba Jul 23 '17 at 18:55lmerformula 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 makelmermatch results ofaov. – amoeba Jul 23 '17 at 18:58