lme4 - Cannot get emmeans when have a nested factor?

14 Views Asked by At

So I have a treatment with 3 factors (Air Temperature, Water Temperature, and Region), but within each Region, there are populations, that work as replicates, e.g., Region A has 4 populations (Poulation 1 to 4), Region B has another 4 populations (Population 5 to 8). So My model currently is like this: Model <- lmer(Growth ~ Air + Water + (1|Region/Population) ) Assuming here that ?m saying there's an additive effect between Air+Water+Region , but that Region has a nested random factor called Population . Problem is, when I check for pairwise comparison: emmeans(Model, pairwise~AirWaterRegion, , adjust = "tukey") I get: No variable named Region in the reference grid.

BUT If I define my models like this: Model <- lmer(Growth ~ Air + Water + Region + (1|Population) ) The same emmeans line goes well and gives me the comparisons that I want....but this later model does not have Populations as nested within Region...right?

So how to I get pairwise comparisons if I have a factor with a nested random variable within?

Thank you!

0

There are 0 best solutions below