# Results of Fixed factor with four levels in lmer4 {glmer}

I am working in GLMMs applying lmer4 {glmer} function. In detailed, I have 2 fixed categorical variables (ecoregion and protection), and 1 random categorical variables (id). And I am running the next script:

mdl3 <- glmer(Bimfull ~ ecoregion * proteccion + (1|id), full, family=gaussian(link="log"), glmerControl(optimizer="bobyqa"))


The ecoregion fixed factor is composed by four levels: Atlantic, Alboran, Mediterranean and Canary, but in the results (please see results) only I obtain Atlantic, Mediterranean and Canary, and what happen with Alboran? How can I obtain Alboran results?

Thank you very much,

Jose

• This should probably be closed as off-topic, this comes up a lot on the site. Coding of dummy variables uses $k-1$ factors for $k$ levels. Mar 22 '18 at 16:05

By default, R uses dummy variable coding for encoding categorical variables and your output reflects that. What that means is that R sets aside one category (the one which is missing from the model output) and then compares the remaining categories against it. You could spell out your model "by hand" from the R output to better understand what it looks like.

To do that, note that:

ecoregionAtlantic = 1 when ecoregion = Atlantic and 0 otherwise

ecoregionCanary = 1 when ecoregion = Canary and 0 otherwise

ecoregionMediterranean = 1 when ecoregion = Mediterranean and 0 otherwise

All the variables defined above are dummy variables.

Then go through all possible cases and "spell out" the model:

1) ecoregionAtlantic = 0, ecoregionCanary = 0, ecoregionMediterranean = 0 (this tells you what the model looks like for the region that was set aside, Alboran)

2) ecoregionAtlantic = 1, ecoregionCanary = 0, ecoregionMediterranean = 0 (this tells you what the model looks like for the Atlantic region)

3) ecoregionAtlantic = 0, ecoregionCanary = 1, ecoregionMediterranean = 0 (this tells you what the model looks like for the Canary region)

4) ecoregionAtlantic = 0, ecoregionCanary = 0, ecoregionMediterranean = 1 (this tells you what the model looks like for the Mediterranean region).

For the region that was set aside (Alboran), all dummy variables are set to zero, so the right side of the model reduces to intercept + slope of proteccionunprotected * proteccionunprotected.

• Thank you very much @Isabella Ghement! Excellent answer! Now I understand the p-value of Alboran ecoregion :) Mar 27 '18 at 22:34
• That's great to hear, Jose! I always like to understand what R does behind the scenes to make sure I'm interpreting the R output correctly. You may find the R package sjPlot useful for visualizing glmer results: strengejacke.de/sjPlot/sjp.glmer Mar 27 '18 at 22:39