Logistic Regression – Understanding Logistic Regression with Ordinal Independent Variables

logisticordinal-datareferencesregression

I have found this post:

Yes. The coefficient reflects the change in log odds for each increment of change in the ordinal predictor. This (very common) model specification assumes the the predictor has a linear impact across its increments. To test the assumption, you can compare a model in which you use the ordinal variable as a single predictor to one in which you discretize the responses and treat them as multiple predictors (as you would if the variable were nominal); if the latter model doesn't result in a significantly better fit, then treating each increment as having a linear effect is reasonable.

@dmk38 Dec 12 '10 at 5:21

Could you please tell me where can find something published that supports this claim? I am working with data and I would like to use ordinal independent variables in logistic regression.

Best Answer

As @Scortchi notes, you can also use orthogonal polynomials. Here is a quick demonstration in R:

set.seed(3406)
N      = 50
real.x = runif(N, 0, 10)
ord.x  = cut(real.x, breaks=c(0,2,4,6,8,10), labels=FALSE)
ord.x  = factor(ord.x, levels=1:5, ordered=TRUE)
lo.lin = -3 + .5*real.x
p.lin  = exp(lo.lin)/(1 + exp(lo.lin))
y.lin  = rbinom(N, 1, prob=p.lin)

mod.lin = glm(y.lin~ord.x, family=binomial)
summary(mod.lin)
# ...
# Coefficients:
#             Estimate Std. Error z value Pr(>|z|)   
# (Intercept)  0.05754    0.36635   0.157  0.87520   
# ord.x.L      2.94083    0.90304   3.257  0.00113 **
# ord.x.Q      0.94049    0.85724   1.097  0.27260   
# ord.x.C     -0.67049    0.77171  -0.869  0.38494   
# ord.x^4     -0.09155    0.73376  -0.125  0.90071   
# ...
Related Question