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