Ordinal logistic regression for ranked ratings, with example
Ordinal logistic regression models a response with three or more categories that have a natural order, such as a visual rating of good, fair or poor, as a function of one or more predictors. The usual form, the proportional odds model, fits one slope per predictor that shifts the whole rating scale up or down, plus one cutoff (threshold) between each pair of neighboring categories. It uses the order in the data without pretending that the categories are evenly spaced numbers.
When to use it
- The response is a ranked rating: appearance class 1 to 3, severity none/minor/major, a customer satisfaction scale.
- You want to know whether a process variable pushes ratings toward the better or worse end, and by how much.
- Treating the ratings as numbers (1, 2, 3) and running ordinary regression would assume the step from good to fair equals the step from fair to poor, which you cannot defend.
- Collapsing the scale to pass/fail would throw away information.
If there are only two outcomes, use binary logistic regression. If the categories have no order (types of defect, for instance), use nominal logistic regression. Before you model ratings made by people, check that the inspectors agree with an attribute agreement analysis.
How it works
Number the categories 1 to J from best to worst. Instead of modeling each category, the model looks at the cumulative probabilities P(Y ≤ j), the chance of being in category j or better, and puts each on the logit scale:
ln[ P(Y ≤ j) / (1 − P(Y ≤ j)) ] = θⱼ + βx, j = 1, …, J − 1- There are J − 1 thresholds θⱼ, one per cut between categories. They always increase with j.
- There is a single slope β for each predictor, shared by every cut. This is the proportional odds assumption: the predictor shifts all cumulative odds by the same factor, e^β per unit.
- The probability of each category is a difference of cumulative probabilities: P(Y = j) = P(Y ≤ j) − P(Y ≤ j − 1).
With this sign convention, a negative β means higher x moves ratings toward the worse end. Some programs write the model as θⱼ − βx, which flips the sign of β, so always check the convention before you read the direction.
The parameters are fitted by maximum likelihood (here, Newton's method on the log-likelihood). The output resembles that of binary logistic regression: coefficients with standard errors, Z and p-values; an odds ratio e^β with its interval; the log-likelihood; a likelihood-ratio test of all predictors against a model with thresholds only; and Pearson and deviance goodness-of-fit tests on grouped data.
Example
A paint line grades panels as Good, Fair or Poor for orange peel. The engineer suspects paint viscosity (efflux cup time, in seconds) and grades 30 panels at each of five viscosity levels:
| Viscosity (s) | Good | Fair | Poor |
|---|---|---|---|
| 18 | 29 | 1 | 0 |
| 20 | 23 | 7 | 0 |
| 22 | 19 | 8 | 3 |
| 24 | 10 | 18 | 2 |
| 26 | 6 | 13 | 11 |
The fit converges in five Newton steps:
| Term | Coef | SE Coef | Z | P | Odds ratio | 95% CI |
|---|---|---|---|---|---|---|
| Threshold 1 (Good) | 12.292 | 1.870 | 6.57 | < 0.001 | ||
| Threshold 2 (Good or Fair) | 14.696 | 2.001 | 7.35 | < 0.001 | ||
| Viscosity | −0.5370 | 0.0820 | −6.55 | < 0.001 | 0.584 | 0.498 to 0.686 |
The log-likelihood is −107.72, against −137.74 for the model with thresholds only, so the likelihood-ratio statistic is G = 60.05 with 1 degree of freedom (p < 0.001). The goodness-of-fit tests show no lack of fit: Pearson chi-square 6.73 and deviance 7.43, both on 7 degrees of freedom (10 cells minus 3 parameters), with p = 0.458 and 0.386.
Fitted probabilities:
| Viscosity (s) | 18 | 20 | 22 | 24 | 26 |
|---|---|---|---|---|---|
| Good | 0.932 | 0.825 | 0.617 | 0.355 | 0.158 |
| Fair | 0.061 | 0.156 | 0.330 | 0.504 | 0.517 |
| Poor | 0.007 | 0.019 | 0.053 | 0.141 | 0.325 |
How to read the results
- The slope gives direction and size. β = −0.537 per second: thicker paint pushes ratings toward Poor. Each extra second multiplies the odds of "Good" against "Fair or Poor", and equally the odds of "Good or Fair" against "Poor", by 0.584. Two seconds multiply them by 0.342.
- The thresholds set the baseline. On their own they mean little (they are log-odds at a viscosity of 0 s); use them through the fitted probabilities.
- Read the fitted table for decisions. Keeping viscosity at 20 s or below gives about 82% Good and under 2% Poor; at 24 s, Poor rises to 14%.
- Check the proportional odds assumption. Fit two binary logistic models, one for each cut. Here "Good against the rest" gives a slope of −0.516 (SE 0.085) and "Poor against the rest" gives −0.622 (SE 0.169). They agree within their standard errors, so one shared slope is reasonable. A formal score test of the assumption does the same job.
Common mistakes
- Getting the sign convention backwards. Check whether the software writes θⱼ + βx or θⱼ − βx, and whether category 1 is the best or the worst.
- Treating ratings as measurements. Averaging 1, 2 and 3 and running ordinary regression assumes equal spacing between categories.
- Ignoring rater disagreement. If two inspectors would grade the same panel differently, the model fits their disagreement as noise. Settle the rating standard first.
- Sparse categories. A category with very few observations (Poor at low viscosity here) gives unstable cell counts; goodness-of-fit tests then become unreliable. Pool rarely used categories if it makes sense.
- Forcing proportional odds. If the slopes for the different cuts clearly differ, a nominal model or separate binary models describe the data better.
Frequently asked questions
What does "proportional odds" mean?
That a one-unit change in the predictor multiplies the odds at every cut point by the same factor. Here, 0.584 per second whether you split the scale after Good or after Fair.
Why not use binary logistic regression on Good versus not Good?
You can, but you throw away the difference between Fair and Poor. The ordinal model uses all three categories and gives a more precise slope (SE 0.082 against 0.085 for the Good cut alone).
How do I interpret the thresholds?
They are the log-odds of being in category j or better when every predictor equals 0. They matter only through the fitted probabilities; there is usually nothing to test about them.
How many observations do I need?
Enough that every category occurs reasonably often across the range of the predictor. As a rough guide, aim for at least 10 observations in each category for each coefficient you estimate.