# Regression - Multinomial Logit

The Multinomial Logit is a form of regression analysis that models a discrete and nominal dependent variable with more than two outcomes (Yes/No/Maybe, Red/Green/Blue, Brand A/Brand B/Brand C, etc.). It is also known as a multinomial logistic regression and multinomial logistic discriminant analysis.

The Multinomial Logit is a form of regression analysis that models a discrete and nominal dependent variable with more than two outcomes (Yes/No/Maybe, Red/Green/Blue, Brand A/Brand B/Brand C, etc.). It is also known as a multinomial logistic regression and multinomial logistic discriminant analysis.

Note: this model is not the same as the conditional logit model commonly used in choice modeling; see Choice Modeling - Hierarchical Bayes and Choice Modeling - Latent Class Analysis.

## Data format

The key requirement for a multinomial logit regression is that the dependent variable is discrete with more than two outcomes. In Displayr, the best data format for this type is “Nominal: Mutually exclusive categories”.

The independent variables can be continuous, categorical, or binary — just as with any regression model. However, it is recommended that the predictor variables be scaled to lie between [0,1] to improve the speed and convergence properties of the algorithm.

## Interpretation

Variable statistics measure the impact and significance of individual variables within a model, while overall statistics apply to the model as a whole. Both are shown in the multinomial logit output.

### Variable statistics

The format of the default summary output only shows the coefficient values. To see a more detailed output with standard errors, t-statistics, and p-values, select Multiple imputation in Inputs > Missing data.

Estimate the magnitude of the coefficient indicates the size of the change in the independent variable as the value of the dependent variable changes. A positive number indicates a direct relationship (y increases as x increases), and a negative number indicates an inverse relationship (y decreases as x increases).

The coefficient is colored and bolded if the variable is statistically significant at the 5% level.

Standard Error measures the accuracy of an estimate. The smaller the standard error, the more accurate the predictions.

t-statistic the estimate divided by the standard error. The magnitude (either positive or negative) indicates the significance of the variable. The values are highlighted based on their magnitude.

p-value expresses the t-statistic as a probability. A p-value under 0.05 means that the variable is statistically significant at the 5% level; a p-value under 0.01 means that the variable is statistically significant at the 1% level. P-values under 0.05 are shown in bold.

### Overall statistics

n the sample size of the model

R-squared & McFadden’s rho-squared assess the goodness of fit of the model. A larger number indicates that the model captures more of the variation in the dependent variable.

AIC Akaike information criterion is a measure of the quality of the model. When comparing similar models, the AIC can be used to identify the superior model.

## Example

The example below is a model that predicts a survey respondent’s preferred fast-food chain based on characteristics like age, gender, and work status.

### Create a Multinomial Logit Model in Displayr

1. Go to Insert > Regression > Multinomial Logit
2. Under Inputs > Outcome, select your dependent variable
3. Under Inputs > Predictor(s), select your independent variables

## Object Inspector Options

Outcome The variable to be predicted by the predictor variables.

Predictors The variable(s) to predict the outcome. The predictors should be roughly scaled to be in [0,1].

Algorithm The fitting algorithm. Defaults to Regression but may be changed to other machine learning methods.

Type: You can use this option to toggle between different types of regression models, but note that certain types are not appropriate for certain types of outcome variable. The other types are not appropriate for an unordered categorical outcome variable with more than two categories/levels. For an ordered categorical outcome, see Ordered Logit. If the outcome is binary (i.e. falls in one of two categories), see Binary Logit.

Linear See Regression - Linear Regression.
Binary Logit See Regression - Binary Logit.
Ordered Logit See Regression - Ordered Logit.
Multinomial Logit.
Poisson See Regression - Poisson Regression.
Quasi-Poisson See Regression - Quasi-Poisson Regression.
NBD See Regression - NBD Regression.

Robust standard errors Computes standard errors that are robust to violations of the assumption of constant variance (i.e., heteroscedasticity). See Robust Standard Errors. This is only available when Type is Linear.

Missing data See Missing Data Options.

Output

Summary The default; as shown in the example above.
Detail Typical R output, some additional information compared to Summary, but without the pretty formatting.
ANOVA Analysis of variance table containing the results of Chi-squared likelihood ratio tests for each predictor.

Correction The multiple comparisons correction applied when computing the p-values of the post-hoc comparisons.

Variable names Displays Variable Names in the output.

Absolute importance scores Whether the absolute value of Relative Importance Analysis scores should be displayed.

Auxiliary variables Variables to be used when imputing missing values (in addition to all the other variables in the model).

Weight. Where a weight has been set for the R Output, it will automatically applied when the model is estimated. By default, the weight is assumed to be a sampling weight, and the standard errors are estimated using Taylor series linearization (by contrast, in the Legacy Regression, weight calibration is used). See Weights, Effective Sample Size and Design Effects.

Filter The data is automatically filtered using any filters prior to estimating the model.

Crosstab Interaction Optional variable to test for interaction with other variables in the model. See Linear Regression for more details.

Stack data Whether the input data should be stacked before analysis. Stacking can be desirable when each individual in the data set has multiple cases and an aggregate model is desired. More information is available at Stacking Data FilesStacked Data. If this option is chosen then the Outcome needs to be a single Question that has a Multi type structure suitable for regression such as a Pick One - Multi, Pick Any or Number - MultiVariable Set that has a Multi type structure suitable for Multinomial Logit regression such as a Binary - Multi, Nominal - Multi or Numeric - Multi. Similarly, the Predictor(s) need to be a single Question that has a Grid type structure such as a Pick Any - Grid or a Number - GridVariable Set that has a Grid type structure such as a Binary - Grid or a Numeric - Grid. In the process of stacking, the data reductionData Reduction is inspected. Any constructed NETs are removed unless comprised of source values that are mutually exclusive to other codes, such as the result of merging two categories.

Random seed Seed used to initialize the (pseudo)random number generator for the model fitting algorithm. Different seeds may lead to slightly different answers, but should normally not make a large difference.

Additional options are available by editing the code.

### DIAGNOSTICS

Cook's distance plot Creates a line/rug plot showing Cook's Distance for each observation.

Cook's distance vs leverage plot Creates a scatterplot showing Cook's distance vs leverage for each observation.

Influence index plot Creates index plots of studentized residuals, hat values, and Cook's distance.

Multicollinearity (VIF) table Creates a table containing variance inflation factors (VIF) to diagnose multicollinearity.

Normal Q-Q plot Creates a normal Quantile-Quantile (QQ) plot to reveal departures of the residuals from normality.

Prediction-accuracy table Creates a table showing the observed and predicted values, as a heatmap.

Residual normality (Shapiro-Wilk) test Conducts a Shapiro-Wilk test of normality on the (deviance) residuals.

Residuals vs fitted plot Creates a scatterplot of residuals versus fitted values.

Residuals vs leverage plot Creates a plot of residuals versus leverage values.

Scale-location plot Creates a plot of the square root of the absolute standardized residuals by fitted values.

Serial correlation (Durbin-Watson) test Conducts a Durbin-Watson test of serial correlation (auto-correlation) on the residuals.

### SAVE VARIABLE(S)

Save fitted values Creates a new variable containing fitted values for each case in the data.

Save predicted probabilities Creates a new variable containing predicted probabilities of each response.

Save predicted values Creates a new variable containing predicted values for each case in the data.

Save residuals Creates a new variable containing residual values for each case in the data.

When using this feature you can obtain additional information that is stored by the R code which produces the output.

1. To do so, select Create > R Output.
2. In the R CODE, paste: item = YourReferenceName
3. Replace YourReferenceName with the reference name of your item. Find this in the Report tree or by selecting the item and then going to Properties > General > Name from the object inspector on the right.
4. Below the first line of code, you can paste in snippets from below or type in str(item) to see a list of available information.

For a more in depth discussion on extracting information from objects in R, checkout our blog post here.

Properties which may be of interest are:

• Summary outputs from the regression model:
item\$summary\$coefficients # summary regression outputs

## Acknowledgements

Uses the multinom function from the nnet R package. See also Regression - Generalized Linear Model.