Search code examples
rlogistic-regressiondummy-variable

R glm regression not including several dummy variables


I have a data set (acs_hh) in which one of the columns is race_eth.

For the following regression:

reg <- glm(acs_hh$own ~ acs_hh$hhincome + acs_hh$race_eth, family = "binomial")
summary(q7reg)

Results

However, in my data there exist more than just the four races mentioned in the summary; asian is also a race in my dataset.

Why is R not calculating a coefficient for asians, i.e acs_hh$race_ethasian, non-hisp ?


Solution

  • When using dummy variables one of the categories is excluded and serves as the reference category to which all the others are compared. So to calculate fitted values for Asian, non-hisp you would set all of the other categories to 0.