Math calculator

Multinomial Logistic Calculator

Against a baseline.

Against a baseline

Two hundred and forty commuters choosing car, bus or bike, against the distance they travel. Each extra kilometre raises the odds of the bus against the car by 1.215 and lowers the odds of the bike against the car by 0.566. Both of those sentences contain the words "against the car", and that is the whole point: car is the baseline only because it was coded 1. Refit with bike as the baseline and the coefficients move by up to 3.9978, while every one of the 720 fitted probabilities moves by 4.44e-16. The model is identical. Every number describing it has changed.

240 rows · 3 categories (88 / 110 / 42) · baseline is category 1

Every coefficient is a contrast against Car — switching that baseline moves them by up to 3.9978

And it moves every one of the 720 fitted probabilities by 4.44e-16. The model is unchanged; only its description is. That is what a multinomial coefficient is — a comparison between two categories, one of which was chosen by whoever numbered them — and it is why "raises the odds of X" is never a complete sentence here without naming what it is being raised against.

Coefficients move by

3.9978

when the baseline is switched

Predictions move by

4.44e-16

the same model, described differently

Correct predictions

60.0%

against 45.8% for always guessing the largest

Pseudo R²

0.2161

model p 6.121100e-24

Each category against the baseline

Coefficients, standard errors and odds ratios for each non-baseline category
ComparisonInterceptSlopeStandard errorOdds ratioObserved
Bus vs Car-1.41300.19460.04531.2148110
Bike vs Car1.9989-0.56940.10630.565942
Car (baseline)00188

The baseline row is zeros by construction, not by estimation — a model with K categories needs only K minus one sets of coefficients, because the probabilities have to add to one. That constraint is also why the baseline choice is free: any category can carry the zeros and the fit is the same.

Two diagnostics worth the space

Baseline invariance and the independence of irrelevant alternatives
CheckValueReading
Largest coefficient change3.9978the description is arbitrary
Largest probability change4.44e-16the model is not
Shift on dropping a category0.5%no sign of trouble
Accuracy over the largest class14.2 pointswhat the predictors added

The third row removes one category and refits on the survivors. The model assumes the odds between any two categories do not depend on what else was available, so under its own assumption the surviving coefficients should not move. A large shift is evidence the categories are substitutes for each other rather than independent alternatives.

With two categories this model is ordinary binary logistic regression, and the verification suite confirms the two agree to 1.0e-11. On a two-by-two table the coefficient is the log odds ratio in closed form.

If the categories have a genuine order, this model throws that information away and pays for it in precision — an ordinal model estimates far fewer parameters from the same rows. Use this one when the categories are alternatives rather than levels.

Baseline invariance shown Odds ratios per category Independence checked Accuracy against the base rate Reduces to logistic at K = 2

What this tool shows

Refitting the same data with a different baseline category moves the coefficients by up to 3.9978 and moves every one of the 720 fitted probabilities by 4.44e-16. The model has not changed at all. Only the description has. Multinomial coefficients are contrasts against a category somebody picked — usually whichever was coded 1 — and that is why “distance lowers the odds of cycling” is never a complete sentence here without naming what it is lowered against. The page prints both numbers on every run because the first is large and the second is zero.

  • Coefficients, standard errors and odds ratios for every category against the baseline
  • A measured demonstration that the baseline choice rewrites all of them and predicts the same thing
  • The independence assumption checked by dropping a category and refitting
  • Accuracy against the base rate of always guessing the largest category
  • Why the baseline row is zeros by construction rather than by estimation
  • The reduction to ordinary binary logistic regression at two categories
Baseline invariance Odds ratios per category Independence checked Accuracy vs base rate

A multinomial coefficient is a comparison, never an effect on its own.

Updated 13 September 2026 · Works in any browser, no installation

Multinomial logistic regression predicts which of several unordered categories an observation falls into, by estimating one set of coefficients for each category relative to a baseline. Those coefficients describe the odds of one category against the baseline, not the probability of that category, and the baseline is an arbitrary choice. Change it and every coefficient changes while the predicted probabilities stay identical — which is the single most useful thing to know before reading any multinomial output.

At a glance

Formula shown
For K categories, P(Y = c) = exp(x·β_c) / Σ_k exp(x·β_k), with β₁ fixed at zero so the probabilities are identified. That constraint is the baseline: one category carries zeros and everything else is measured against it. exp(β_c) is the odds ratio of category c against the baseline per unit of the predictor — never a probability, and never a comparison with any category other than the baseline.
Scenario support
Which transport mode a commuter picks, which brand a shopper buys, which treatment a clinician chooses, which of several outcomes a case ends in, and any choice among alternatives with no natural order.
Educational estimate
Planning support from the values you enter — not professional advice.

What a multinomial coefficient is not

The commute preset gives a coefficient of 0.1946 for bus and −0.5694 for bike, per kilometre. The natural reading is that distance makes the bus more likely and cycling less likely. That reading is not quite what the model said.

Both numbers are comparisons with the car, because the car happened to be coded 1. The first says distance raises the odds of bus against car by a factor of 1.215. The second says it lowers the odds of bike against car to 0.566. Neither says anything directly about the probability of bus or bike, and neither compares bus with bike.

The page makes that concrete by refitting with the last category as baseline instead of the first. The coefficients move by up to 3.9978. Every fitted probability moves by 4.44e-16 — zero, to machine precision. Two completely different tables of coefficients, describing exactly the same model, making exactly the same predictions.

That is worth seeing because the failure it prevents is so ordinary. Two papers on the same question with different baselines will report coefficients that look irreconcilable and are not. A reader comparing them without checking the baseline is comparing different quantities, and nothing in either table announces which category is carrying the zeros.

The practical remedy is to report predicted probabilities, or marginal effects, alongside the coefficients. Those are baseline-free: they are properties of the model rather than of the way it was written down, and the identity above is the proof.

The independence assumption

The model assumes the odds between any two categories do not depend on what other categories exist. Remove one alternative and the ratio between two surviving ones should be unchanged, which is a strong claim about how choices work.

The classic counterexample is a commuter choosing between a car and a red bus, each at even odds. Add a blue bus identical to the red one in every respect but colour. The model predicts the three options split evenly, so the car’s share falls from a half to a third. What should happen is that the two buses split the bus share between them and the car keeps its half — because the buses are substitutes for each other, not independent alternatives.

The diagnostic here removes one category, refits on the survivors, and reports how far the remaining coefficients moved. Under the assumption they should not move at all beyond sampling noise. A large shift says the categories are behaving like substitutes, and the usual remedies — nested logit, mixed logit, or grouping the substitutes into one category — all involve giving up the simple form.

Two honest caveats. A small shift is weak evidence rather than a clean pass, because the test has limited power at ordinary sample sizes. And dropping a category also drops the rows that chose it, so the comparison is made on a smaller sample; some movement is expected even when the assumption is perfectly true.

The price of assuming nothing

This model makes no assumption about the categories at all — no ordering, no spacing, no structure. That flexibility has a price, and the price is parameters. With K categories and p predictors it estimates (K − 1) × (p + 1) coefficients, so a five-category outcome with four predictors needs twenty.

Each of those is estimated from the rows in its own category. A category holding fifteen observations supports its coefficients about as well as a fifteen-row regression does — which is to say badly, with wide standard errors and unstable estimates. The category counts are printed beside the coefficients so that arithmetic is visible.

When the categories genuinely have an order, throwing it away is expensive. An ordinal model uses one coefficient per predictor instead of K − 1 of them, so it estimates far less from the same data and gets more precision for it. The right test is whether the order is real: severity and education levels have one, transport modes and brands do not.

Accuracy, and what it is worth

The accuracy figure is the share of rows whose highest predicted probability matches the observed category, and it is printed beside the base rate — the share you would get by always guessing the largest category and never looking at a predictor.

On the commute preset the model reaches 60.0% against a base rate of 45.8%, so the predictors are worth about fourteen points. That is the comparison that matters. An accuracy of 60% sounds modest until you know the alternative, and it sounds impressive on an outcome where one category holds 80% of the rows — where it would in fact be worse than guessing.

Pseudo R-squared is reported too, and it should be read as a relative measure rather than a share of variance explained. Values that would be alarming in a linear model are ordinary here; what it is good for is comparing nested models on the same data, not judging a single fit.

Reporting it

Name the baseline in the table header, not in a footnote. Every coefficient in the table is meaningless without it, and the demonstration above shows exactly how meaningless: the same model yields coefficients four units apart depending on a choice the reader cannot see.

Report predicted probabilities at representative values of the predictors alongside the coefficients. They answer the question people actually have, they are comparable across studies with different baselines, and they cannot be misread as effects on a single category.

Give the category counts, give accuracy against the base rate rather than alone, and say whether the independence assumption was checked. If the categories have an order you chose not to use, say why — that decision costs precision and should be a decision rather than an oversight.

Sources and methodology

References for the model and its central assumption.

Method. The likelihood is maximised by Newton-Raphson with the analytic gradient and Hessian of the multinomial log-likelihood and a backtracking line search; standard errors come from the inverse Hessian. The baseline identity is computed rather than asserted: the model is refitted with the category labels reversed, and the suite confirms the largest change in any fitted probability stays below 1e-7 while the coefficients move by more than 0.5 on every dataset. It further checks that with two categories the model reduces to binary logistic regression, agreeing to 1.0e-11, and that on a two-by-two table the coefficient equals the log odds ratio in closed form. That engine is verified on every change against 490 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Ordinal RegressionFit a proportional-odds model to an ordered outcome, with the separate binary fits at each cutpoint and a test of the assumption they rest on.
Logistic RegressionLogistic regression with odds ratios converted to risk ratios at your own event rate, a likelihood ratio test, AUC, and separation reported rather than hidden.
Chi-SquareGoodness of fit and tests of independence with every expected count and per-cell contribution shown — because the validity condition is about expected counts, not observed ones, and most calculators hide them.
Cramer's VThe effect size a chi-square test does not give you, with your own table rescaled six ways: the same 3x3 pattern gives V = 0.27136852 at n = 90 and at n = 1,800 while p falls from 0.0101 to 3.6e-56.
ROC Curve & AUCBuilds the curve from raw scores with every threshold enumerated, and computes the AUC twice — trapezoid and Mann-Whitney U — which agree to 1.11e-16 across 300 datasets.
Goodness of FitChi-square with per-cell contributions and standardised residuals, plus a measured answer to the “expected at least 5” rule — below the floor the test is CONSERVATIVE (3.27% at 2 per cell), not liberal.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. Coefficients are contrasts against an arbitrary baseline category and are not interpretable without naming it. The independence of irrelevant alternatives is a strong assumption; the diagnostic here has limited power and a small shift is weak evidence rather than confirmation. Sparse categories yield unstable coefficients regardless of total sample size.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published a multinomial fit with odds ratios and standard errors per category.
  2. Measured what the baseline choice does: coefficients move 3.9978, fitted probabilities move 4.44e-16.
  3. Checked the independence assumption by dropping a category and refitting on the survivors.
  4. Reported accuracy against the base rate of always guessing the largest category.
  5. Stated the parameter cost of discarding a genuine ordering.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.