# GLM with multiple categorical variables in R : how to interpret the result?

I have a binomial variable that I regress against different categorical variables which I have contrasted to build a reference of an individual Female, Married, aged 35-45, High education :

Call:
glm(formula = wpti ~ gender.f + is.married.f + age.f + edu.f,

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)        -1.303107   0.046522 -28.010  < 2e-16 ***
gender.fMale       -0.537958   0.036833 -14.605  < 2e-16 ***
is.married.fSingle  0.012196   0.040584   0.301 0.763792
age.f<25           -0.298081   0.078040  -3.820 0.000134 ***
age.f25-35         -0.121670   0.051283  -2.373 0.017667 *
age.f45-55         -0.006033   0.049078  -0.123 0.902162
age.f>55            0.239855   0.058727   4.084 4.42e-05 ***
edu.fLow           -0.340115   0.049879  -6.819 9.18e-12 ***
edu.fMedium        -0.298925   0.041729  -7.163 7.86e-13 ***


I was expecting to see all the coefficients (and not only the one for gender) to change if I contrast the gender factor with Female as reference, but they all remain the same, as if being a man or woman has no effect.

Call:
glm(formula = wpti ~ gender.f + is.married.f + age.f + edu.f,

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)        -1.841064   0.048257 -38.151  < 2e-16 ***
gender.fFemale      0.537958   0.036833  14.605  < 2e-16 ***
is.married.fSingle  0.012196   0.040584   0.301 0.763792
age.f<25           -0.298081   0.078040  -3.820 0.000134 ***
age.f25-35         -0.121670   0.051283  -2.373 0.017667 *
age.f45-55         -0.006033   0.049078  -0.123 0.902162
age.f>55            0.239855   0.058727   4.084 4.42e-05 ***
edu.fLow           -0.340115   0.049879  -6.819 9.18e-12 ***
edu.fMedium        -0.298925   0.041729  -7.163 7.86e-13 ***


However, if I remove the gender in the regression, the coefficients for the other variables are different :

Call:
glm(formula = wpti ~ is.married.f + age.f + edu.f, family = binomial(link = "logit"))

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)        -1.562816   0.043369 -36.035  < 2e-16 ***
is.married.fSingle  0.071780   0.040378   1.778 0.075455 .
age.f<25           -0.330773   0.077982  -4.242 2.22e-05 ***
age.f25-35         -0.134088   0.051091  -2.625 0.008677 **
age.f45-55          0.004803   0.048860   0.098 0.921694
age.f>55            0.224112   0.058419   3.836 0.000125 ***
edu.fLow           -0.411232   0.049424  -8.321  < 2e-16 ***
edu.fMedium        -0.332353   0.041488  -8.011 1.14e-15 ***


So I am confused : I was under the impression that the coefficients could show the difference of likeliness of having a result positive or negative if only ONE variable would vary. Now I dont know what to think. Can somebody explain how to interpret the results, and why it is different if I remove one categorical variable (eg. gender here) althought it seems it has no effect on the others ?

• Try look up the concept "confounding". What you observed is quite common because sex is either i) not a completely independent predictor or ii) associated with other predictors such as age and education. Jun 23, 2014 at 20:29
• en.wikipedia.org/wiki/Omitted-variable_bias Jun 23, 2014 at 23:30