8
$\begingroup$
library(lme4)
    out <- glmer(cbind(incidence, size - incidence)
                 ~ period
                 + (1 | herd),
                 data = cbpp,
                 family = binomial,
                 contrasts = list(period = "contr.sum"))

summary(out)
Fixed effects:
            Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.32337    0.22129 -10.499  < 2e-16 ***
period1      0.92498    0.18330   5.046 4.51e-07 ***
period2     -0.06698    0.22845  -0.293    0.769
period3     -0.20326    0.24193  -0.840    0.401

I was never in a situation where I needed to fit a generalised linear model with effect coding (contr.sum for R users). Can I apply the same interpretation as in the linear model case? In a normal linear model the intercept would be the grand mean and the $\beta$s (parameters for period1, period2, period3 and period4 = (Intercept) - period1 - period2 - period3 the effects i.e. how the factor levels deviate from the grand mean.

Here is how I think the analogous interpretation for generalised linear models goes. (I will exponentiate all parameters and hence transform the log-odds(-ratios) to odds(-ratios).) The intercept $\exp((\text{Intercept}))$ would then be the overall odds of success vs. failure (sticking here to classical binomial terminology) and the $\beta$s the log-odds-ratios. And we get the odds for e.g. period1 by adding $\text{(Intercept)}+\text{period1}$ and then exponentiating: $\exp(\text{(Intercept)}+\text{period1})$. Is the $\text{(Intercept)}$ really the overall/medium odds and the $\beta$s odds-ratios?

$\endgroup$
3
$\begingroup$

Under effect coding, the intercept in the summary table summary(out) is the average logit (log-odds or the log of odds ratio) across all the four periods in your case, and each of the other effects is the logit difference of the corresponding period relative to the average logit.

You can easily verify your interpretation by comparing your current results to a different coding method such as dummy coding on your data:

out2 <- glmer(cbind(incidence, size - incidence)
                 ~ period
                 + (1 | herd),
                 data = cbpp,
                 family = binomial,
                 contrasts = list(period = "contr.treatment"))

summary(out2)
$\endgroup$
  • 1
    $\begingroup$ I'd argue that the intercept is not an odds ratio but rather the average odds and only the coefficients ($\beta$'s) are odds-ratios. The $\text{(Intercept)}$ gives you the average odds (after exponentiating) and when you add the log-odds ratio of e.g. $\text{period1}$ to the log odds of $\text{(Intercept)}$ and exponentiate this sum then you have the odds for $\text{period1}$. I think that it is important to really keep odds-ratios and odds apart. The former is a ratio between odds the latter are the odds of success vs. failure (in a binomial model). $\endgroup$ – lord.garbage Sep 4 '14 at 21:08
  • $\begingroup$ Pet your comment, I edited my answer a little bit. See if it's better now. $\endgroup$ – bluepole Sep 4 '14 at 22:05

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.