0
$\begingroup$

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? enter image description here

Can your help me, please?

Thank you very much,

Jose

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – AdamO Mar 22 '18 at 16:05
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Thank you very much @Isabella Ghement! Excellent answer! Now I understand the p-value of Alboran ecoregion :) $\endgroup$ – Jos Antonio Sanabria Fernndez Mar 27 '18 at 22:34
  • $\begingroup$ 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 $\endgroup$ – Isabella Ghement Mar 27 '18 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.