Nominal (multinomial) logistic regression explained

Updated

Nominal logistic regression, also called multinomial logistic regression, models a response with three or more categories that have no natural order, such as the type of defect on a part, as a function of one or more predictors. It picks one category as the reference and fits a separate logistic equation for each other category against it. The result tells you how a predictor shifts the mix of categories.

When to use it

  • The response is a category without an order: defect type (scratch, dent, split), failure mode, supplier chosen, machine that flagged a fault.
  • You want to know whether a process variable changes which kind of outcome happens, not only whether something happens.
  • A cross tabulation with chi-square tells you that the mix differs between a few groups, but your predictor is continuous, or you have several predictors at once.

If the categories are ordered (good, fair, poor), ordinal logistic regression uses that order and needs fewer parameters. With only two categories, the model is the same as binary logistic regression.

How it works

Choose a reference category, r. For every other category j, the model fits the log of the odds of j against r:

ln[ P(Y = j) / P(Y = r) ] = β₀ⱼ + β₁ⱼx, j ≠ r

With J categories there are J − 1 equations, each with its own constant and its own slope. The probabilities come back from all equations together, so they always add up to 1:

P(Y = j) = e^(β₀ⱼ + β₁ⱼx) / (1 + Σₖ e^(β₀ₖ + β₁ₖx)) P(Y = r) = 1 / (1 + Σₖ e^(β₀ₖ + β₁ₖx))

All coefficients are estimated together by maximum likelihood, here with Newton's method on the log-likelihood. For each equation the output shows coefficients, standard errors, Z and p-values, and an odds ratio e^(β₁ⱼ·Δx): how much the odds of category j against the reference multiply when x rises by Δx. A likelihood-ratio test compares the model with a constant-only model, with (J − 1) × (number of predictors) degrees of freedom, and Pearson and deviance statistics check the fit on grouped data.

The choice of reference changes the equations you see, not the fitted probabilities. Pick the most common category or the one that makes comparisons easiest to explain.

Example

A stamping press makes a steel bracket. At higher press speeds the defect mix seems to change. The quality engineer runs the press at four speeds and classifies the first 40 defective brackets at each speed:

Speed (strokes/min)ScratchDentSplit
2024142
2522153
30171112
359724

Scratch, the most common type overall, is the reference. The fit converges in seven Newton steps:

LogitTermCoefSE CoefZPOdds ratio per 5 strokes/min95% CI
Dent vs ScratchConstant−0.8190.958−0.850.393
Speed0.01510.03610.420.6761.080.76 to 1.54
Split vs ScratchConstant−8.1091.521−5.33< 0.001
Speed0.25860.04975.21< 0.0013.642.24 to 5.93

The log-likelihood is −150.10 against −170.89 for the constant-only model: G = 41.60 with 2 degrees of freedom, p < 0.001. Pearson (0.88) and deviance (0.86) statistics on 4 degrees of freedom have p-values of 0.93, so the model matches the table closely.

Fitted share of each defect type:

Speed (strokes/min)20253035
Scratch0.6060.5450.4170.232
Dent0.3620.3500.2890.174
Split0.0320.1050.2930.594
Fitted share of each defect type by press speed0.00.20.40.6Share of defectsScratchDentSplit20253035Speed (strokes/min)
Fitted share of each defect type by press speed

How to read the results

  • Read each equation against the reference. "Split vs Scratch" has a strong positive slope: every 5 strokes/min multiplies the odds of a split, relative to a scratch, by 3.64. "Dent vs Scratch" is flat (p = 0.676): dents and scratches keep the same ratio to each other as speed changes.
  • Use fitted probabilities to tell the story. Splits go from about 3% of defects at 20 strokes/min to about 59% at 35. Scratches and dents both shrink as a share, but only because splits crowd them out.
  • Shares are not rates. These data are defective parts only, so the model describes the mix. Whether the total number of defects rises with speed is a separate question, for Poisson regression or binary logistic regression on all parts produced.
  • Act on the category that matters. Splits are scrap and can damage the die; the result points the engineer to draw depth, lubrication and blank holder force at high speed.

Common mistakes

  • Comparing coefficients across equations as if they shared a baseline that does not exist. Each slope is relative to the reference category. To compare Dent with Split directly, refit with one of them as the reference, or compare fitted probabilities.
  • Choosing a rare reference. If the reference category has few observations, every equation has large standard errors.
  • Using it for ordered categories. You lose power and add parameters. Use the ordinal model when the order is real.
  • Too many categories for the data. Each extra category adds a full set of coefficients. Combine rare types into "Other" if they are not of interest.
  • Ignoring the independence assumption. The model assumes that each observation is independent. Several defects on the same part, all counted, break that assumption.

Frequently asked questions

What is the reference category for?

It is the baseline that every other category is compared with. It does not change the fitted probabilities, only how the coefficients are written.

What is the difference between nominal and ordinal logistic regression?

The ordinal model uses one slope per predictor for the whole ordered scale. The nominal model uses a separate slope for each non-reference category, so it can describe any change in the mix but needs more data.

Can I use a chi-square test instead?

For a categorical predictor with a few levels, a cross tabulation with chi-square tests whether the mix differs. Here it would treat the four speeds as unrelated groups; the regression uses the fact that speed is numeric and gives a single, interpretable slope for each defect type.

How do I report the result?

Give the odds ratio for the comparisons that matter, with confidence intervals, and a table or chart of fitted shares across the range of the predictor.

Try it with your own data

StatLab SPC is free, open-source statistics for engineers. It runs in your browser, works offline, and never uploads your data.

Open StatLab