Regression
Multinomial Logistic Regression
Models an unordered outcome with more than two categories from numeric predictors, contrasting every category against a chosen baseline.
Method summary
Multinomial logistic regression is for cases where a respondent picks one of several options that cannot be ranked against each other: which supermarket they prefer, which mode of transport they use, which channel they buy through. Squeezing such an outcome into one binary contrast erases the distinctions among the options, and treating the categories as ordered invents a sequence that is not there. Instead the model nominates one category as the baseline and compares each remaining category against it through its own equation, so a single run yields one fewer coefficient set than there are categories, each telling its own story. YouReply Analyze estimates this with the MNLogit class from statsmodels. The outcome is expected to hold between three and ten categories, and the baseline can be named in the parameter form; left empty, the first category takes that role. For every non-baseline category the output carries coefficients, standard errors, z values, p values, relative risk ratios and significance markers, accompanied by the log likelihood, a pseudo R squared, AIC, BIC and the case count. Where a predictor separates the outcome perfectly, the engine stops rather than pressing on, asking you to drop that predictor or to merge categories.
Which research questions does it answer?
- Do age and monthly spend predict which of three supermarket chains a respondent names as their main one?
- As price sensitivity changes, which subscription tier becomes more likely to be chosen?
- Do commute length and income explain whether someone travels to work by car, by public transport or on foot?
- Which numeric characteristics go with a respondent choosing one of four information channels?
When should you use it?
- When the outcome has three to ten categories with no theoretical ordering among them.
- When seeing how each category separates from the baseline individually tells you more than one summary contrast would.
- When a natural comparison category exists to serve as the baseline: the most common option, a control option, or the status quo.
- When every category holds enough respondents to support estimation, since an option ticked by a handful of people destabilises its own equation.
Required variable types
- Dependent variable: a column of unordered categories holding at least three and at most ten distinct values.
- Predictors: numeric columns. Several can be ticked in one run, and their coefficients come back separately for each contrast.
- The baseline is a parameter, and which category serves as the point of comparison follows from the research question.
- A categorical predictor has to be turned into dummy coding first with the derived column tool on the Variable tab.
Key assumptions
- Mutually exclusive categories
- Every respondent must fall into exactly one category. A question allowing several ticks breaks this, and forcing the answer into a single column no longer represents what the respondent actually did.
- Independence of irrelevant alternatives
- The model assumes that the relative preference between two categories is untouched by the presence of a third. Two options that are close substitutes sitting in the same list violate this and distort the contrasts.
- No perfect separation by a predictor
- If a predictor identifies one category without error, its coefficient runs off towards infinity and the estimate stops meaning anything. Usually this signals that the predictor overlaps with the definition of the outcome.
- Independent observations
- Each row must come from a separate respondent. Several choices made by the same person in different situations, entered here as individual rows, make the standard errors look smaller than they are.
- Enough cases per contrast
- A separate equation is estimated for every category, so the demand for cases grows with the category count. A rarely chosen category exaggerates its own coefficients.
How YouReply checks these assumptions
- Mutually exclusive categories: The engine requires between three and ten distinct values in the outcome column and halts outside that range. Whether the categories truly exclude one another is never examined, being a matter of how the data was designed.
- Independence of irrelevant alternatives: No test for this assumption is returned: no Hausman-McFadden style comparison and no routine that refits the model on a reduced option set. Where you suspect a problem, merging the near-substitute categories and rerunning to see whether the coefficients hold steady is the available route.
- No perfect separation by a predictor: There is an explicit guard for this in the engine: when perfect separation is detected the analysis stops and a message appears asking you to remove the offending predictor from the model or to merge categories. Finding which variable caused it means narrowing the predictor set and trying again.
- Independent observations: The panel does not check this assumption automatically; the researcher evaluates it.
- Enough cases per contrast: The panel computes no diagnostics at all here: adequacy of cases per category is not judged, no collinearity measure is produced and residuals are not inspected. Look at the category distribution on the Data tab and decide yourself whether thin options should be combined.
How the analysis is run
- 1Drop your file on the upload area and review the categories of the outcome column in the grid on the Data tab.
- 2On the Variable tab set the outcome to the nominal measurement level and give its codes value labels, which keeps the contrast names in the result tables readable.
- 3Spot the categories chosen very rarely. Merging one into a theoretically close neighbour is usually sounder than trying to estimate a ten-category model.
- 4Pick the method from the search box on the Analysis tab and read the data requirements box; with 'Only ones that fit my data' on, a dataset without a suitable categorical column leaves the method dimmed.
- 5Choose the outcome, the predictors and the baseline category in the parameter form. Leaving the baseline empty hands that role to the first category, which can turn the interpretation in a direction you did not intend.
- 6Run it. The result consists of one table per contrast plus the fit measures. No chart is produced for this method, so export the tables to Excel and reopen the run from the History tab when you need it.
Statistics and tables produced
- Coefficients per contrast
- A separate coefficient set for every non-baseline category. Each coefficient says how the pull towards that category rather than the baseline changes as the predictor grows.
- Standard errors
- The precision of each estimate. In the equations belonging to rarely chosen categories these grow markedly and should temper your confidence in the coefficient.
- z value and p value
- The coefficient over its standard error and the significance that follows. They are read contrast by contrast, and a predictor can reach significance for one category while missing it for another.
- Relative risk ratio
- The exponentiated coefficient. It gives the factor by which a one-unit rise in the predictor multiplies the rate of choosing that category rather than the baseline.
- Significance marker
- A flag set against the 0.05 level for each coefficient. Reading many contrasts together accumulates false positives, and these flags carry no correction for that.
- Log likelihood and pseudo R squared
- The likelihood the fit reached and an index summarising the gain over a model with no predictors. The pseudo R squared does not share the scale of R squared from linear regression.
- AIC and BIC
- Two information criteria for weighing models built on the same data with different predictor sets. They earn their keep here because the number of estimated coefficients climbs with every added category.
- Number of observations
- The row count entering the model. Reading it alongside the distribution of the outcome tells you how many cases each category contributed.
Effect size and confidence intervals
- Relative risk ratio
- It states the factor by which one more unit multiplies the rate of choosing a category rather than the baseline. At 1.80 the pull towards that category over the baseline nearly doubles; at 0.55 it falls to around half. The figure always belongs to a pair, and a different baseline produces different numbers from the same data, which is why the baseline has to be named in the reporting sentence.
- Pseudo R squared
- A summary of how much the likelihood improves on a model without predictors. Low values are the norm with many categories, and something between 0.10 and 0.20 can still accompany a useful model, but presenting it as a share of correct classifications is wrong.
Neither the coefficients nor the relative risk ratios come with intervals here; the tables carry point estimates, standard errors, z values and p values. The pseudo R squared has no interval either. For publication you would build the interval on the logit scale from the coefficient and its standard error, then exponentiate it. The absence stings particularly in this method, because the whole point is often to compare the effect of one predictor across categories, and two relative risk ratios cannot be shown to differ from point estimates alone.
Example research question and example result
The numbers below are a representative example, not data from a real study or a real user.
- Research question
- In an illustrative retail study, do age and monthly grocery spend predict which of three chains a respondent names as their main one?
- Variables
- Dependent variable: main chain chosen (Chain A, Chain B, Chain C) · Baseline category: Chain A · Predictor 1: age in years · Predictor 2: monthly grocery spend in thousands of lira
- Example result
- n = 540 respondents. For Chain B against Chain A, age had a coefficient of -0.04 (standard error 0.01, z = -4.00, p < .001, relative risk ratio 0.96) and spend 0.31 (standard error 0.09, z = 3.44, p = .001, relative risk ratio 1.36). For Chain C against Chain A, age gave 0.02 (standard error 0.01, z = 2.00, p = .046, relative risk ratio 1.02) and spend -0.12 (standard error 0.10, z = -1.20, p = .230, relative risk ratio 0.89). Pseudo R squared was 0.09, log likelihood -524.7, AIC 1061.4 and BIC 1087.2.
- Interpretation
- Higher spend pulls respondents towards Chain B over Chain A quite clearly: each additional thousand lira multiplies that rate by 1.36. Age works the other way, with Chain B losing ground to Chain A among older respondents. The Chain C picture is different: spend has no significant effect and age sits right at the margin, meaning those choosing Chain C are not set apart from Chain A customers by these two variables. The example shows why one summary contrast would not do, since the same predictor is strong in one comparison and inert in the other. Every figure is read against Chain A, and naming Chain B as the baseline would produce a different set. Because the panel does not test independence of irrelevant alternatives, this output says nothing about how substitutable the three chains are.
Real output on a sample dataset
The results below were produced by the analysis engine from this data file. Changing the variable changes the research question as well; every run was computed in advance, so the page sends no request to the engine.
General customer survey (synthetic)
A wide survey of three hundred respondents: two and three category grouping variables, continuous measures, a five point ordinal scale, a binary purchase outcome, a four category brand choice, three repeated measurements, paired binary questions, three raters, four price questions and deliberately empty cells.
- Rows
- 300
- Columns
- respondent_id, gender, education, region, age, income, satisfaction, service_score, price_score, quality_score, loyalty, nps_score, purchased, brand_choice, satisfaction_level, pre_score, post_score, measure_1, measure_2, measure_3, use_before, use_after, use_followup, rater_1, rater_2, rater_3, price_too_cheap, price_cheap, price_expensive, price_too_expensive, feedback_score, followup_rating
The data is synthetic: it comes from a fixed random seed, not from a real study. The values below were produced by the analysis engine from this file, so uploading the same file to the panel gives the same results.
Research question: Do price and quality perceptions predict choosing another brand instead of Brand A?
- Dependent variable
- brand_choice
- Independent variables
- price_score,quality_score
- Reference category
- Brand A
- dependent_var
- brand_choice
- Reference category
- Brand A
- Log likelihood
- -377.70
- Pseudo R squared (McFadden)
- 0.039
- Akaike information criterion (AIC)
- 773.40
- Bayesian information criterion (BIC)
- 806.73
- Valid observations
- 300
Comparisons against the reference
| Row | Intercept (constant) | price_score | quality_score |
|---|---|---|---|
| Brand B / Brand A | - | - | - |
| Brand C / Brand A | - | - | - |
| Brand D / Brand A | - | - | - |
Computation credits: scipy 1.18.0 · statsmodels 0.14.6 · scikit-learn 1.9.0 · numpy 2.5.1 · pandas 3.0.5 · semopy 2.3.11 · 89fc29a · Data seed: 20260914
How to report the result
In a multinomial logistic regression with Chain A as baseline, monthly spend predicted preference for Chain B (RRR = 1.36, p = .001) but not for Chain C (RRR = 0.89, p = .230), with pseudo R squared = .09 (n = 540).
An example sentence close to APA style; the numbers are representative.
When you should not use it
- No test of the independence of irrelevant alternatives is offered, so two options that substitute for each other leave no trace on the results screen.
- Coefficients and relative risk ratios arrive without intervals, which means the output cannot establish that effects differ between two contrasts.
- No regression diagnostics are computed: no collinearity measure, no residual inspection, no influence statistics.
- The number of estimated coefficients climbs quickly with the category count, and outcomes with more than ten categories are refused outright.
- Under perfect separation the analysis stops instead of returning a result, and because the message names no variable, the culprit has to be found by elimination.
- When the outcome categories are ordered, this model ignores that order and loses power by estimating more parameters than it needs.
What to use when the assumptions are not met
- Logistic RegressionWhy: When the question really reduces to separating one category from all the rest, a single equation estimates far fewer parameters.
- Ordinal Logistic RegressionWhy: When the categories carry a theoretical order, using that order buys a stronger estimate from fewer coefficients.
- Chi-Square Test of IndependenceWhy: When the predictors are categorical too and the question is only whether the choice is associated with some attribute, a cross-tabulation answers it directly.
- K-Means Cluster AnalysisWhy: When the aim is not to predict a recorded choice but to group respondents by their characteristics in the first place.
Frequently asked questions
- Is a relative risk ratio the same as an odds ratio?
- They are not the same, although the arithmetic behind them looks alike and they get confused easily. In the multinomial model each coefficient rests on the rate of choosing one category rather than the baseline, and exponentiating it gives the factor multiplying that rate, which is what the relative risk ratio names. The odds ratio in binary logistic regression concerns the odds of an event happening against it not happening. The practical difference is that every figure here belongs to a pair, and changing the baseline recomputes all of them. Your reporting sentence therefore has to name both the category being compared and the baseline, or the reader cannot attach the number to a comparison.
- How should I choose the baseline category?
- The choice leaves model fit untouched and only decides which contrasts read clearly. Three criteria cover most situations. Taking the most frequently chosen category keeps the standard errors small, which is generally the safest starting point. Where a theoretical reference exists, using it makes interpretation natural: the status quo, the control option, or the market-leading brand. The third criterion is your reader's expectation, meaning the category the field conventionally reports against. Leave the parameter empty and the first category becomes the reference, an ordering that comes from your data file rather than from any deliberate decision.
- The analysis stopped with a perfect separation message, what now?
- That message means one of the predictors identifies an outcome category without error, in which case the coefficient grows without bound and the estimate becomes meaningless. Almost always something in the construction of the data lies behind it: the predictor is part of how the outcome was defined, it is a field filled in for only one category, or a very thin category coincides with a single predictor value. The remedies split in two. Dropping the predictor is right when that variable is what produces the separation. When a sparse category is the source, merging it into a theoretically adjacent neighbour serves better. Identifying the responsible variable means removing predictors one at a time and retrying.
- How many respondents do I need?
- What governs this is not the total row count but the number of cases in the least-chosen category, because a separate equation against the baseline is estimated for every category. As a rough rule each contrast wants at least ten cases per predictor, and those cases have to sit in the smaller category. In a model with four categories and three predictors, a smallest category under thirty people will exaggerate the coefficients and swell the standard errors. The panel neither computes this ratio nor warns about it, so judge it from the category distribution yourself and reduce the number of categories if needed.
References
- Agresti, A. (2013). Categorical Data Analysis
- Hosmer, D. W., Lemeshow, S., & Sturdivant, R. X. (2013). Applied Logistic Regression
- Field, A. (2018). Discovering Statistics Using IBM SPSS Statistics
- statsmodels MNLogit documentation
Try it with your own data
The free plan includes 50 analysis runs a month and needs no card.