0
$\begingroup$

In an exercise that asks to estimate the odds ratio the GLM is fitted without the intercept (see code below). It's the first time I see such a configuration and at first sight it seems right but I am unable to find an intuitive justification of why, I just generally feel that this way everything is explained by the levels of the predictor, but if I must explain why this is good and whether it is correct I can not. Can someone explain
- wether fitting without intercept is correct, in this case and in general with response and regressor both factors
- why
- whether fitting with the intercept would be right or wrong
- if right what would be the differences, in this and similar cases (factors, continuous variables it's clear)

library(MASS)

str(shuttle)
'data.frame': 256 obs. of 7 variables:
\$ wind : Factor w/ 2 levels "head","tail":
\$ use : Factor w/ 2 levels "auto","noauto":
# other vars omitted

fit <- glm(use ~ wind-1, family = "binomial", data = shuttle)

coeff <- exp(coef(fit))
oddsRatio <- coeff[1]/coeff[2]
print(oddsRatio)
windhead
[1] 1.032323

$\endgroup$
3
  • 1
    $\begingroup$ Surprisingly, there seem to be a great deal of posts about this topic here: please check out the links at stats.stackexchange.com/search?q=no+intercept. $\endgroup$
    – whuber
    Commented Feb 22, 2018 at 21:23
  • $\begingroup$ Thank you, had searched before posting but clearly not very effectively :-) $\endgroup$
    – user110848
    Commented Feb 22, 2018 at 21:26
  • $\begingroup$ There's an art to it. The search that worked best for me in this case used keywords no intercept regression glm. I think I got a little lucky with that. $\endgroup$
    – whuber
    Commented Feb 22, 2018 at 21:29

0