mnrfit
statistics: B = mnrfit (X, Y)
statistics: B = mnrfit (X, Y, name, value)
statistics: [B, dev] = mnrfit (…)
statistics: [B, dev, stats] = mnrfit (…)
Fit a multinomial logistic regression model.
Nominal models are fitted with a baseline-category multinomial logit, using
the last category of Y as the reference. Ordinal models are fitted
with a cumulative link model and hierarchical models with a sequential
(continuation-ratio) link model, both honouring the 'link' option
below. Nominal models always use the logit link.
B = mnrfit (X, Y) returns a matrix, B, of
coefficient estimates for a multinomial logistic regression of the nominal
responses in Y on the predictors in X. X is an N×P
numeric matrix the observations on predictor variables, where N
corresponds to the number of observations and P corresponds to
predictor variables. Y contains the response category labels and it
either be an N×P categorical or numerical matrix (containing only 1s
and 0s) or an N×1 numeric vector with positive integer values, a cell
array of character vectors and a logical vector. Y can also be defined
as a character matrix with each row corresponding to an observation of
X.
B = mnrfit (X, Y, name, value) returns a
matrix, B, of coefficient estimates for a multinomial model fit with
additional parameters specified Name-Value pair arguments.
| Name | Value |
|---|---|
'model' | The type of model to fit: 'nominal'
(default) for a baseline-category model, 'ordinal' for a cumulative
model, or 'hierarchical' for a sequential (continuation-ratio) model. |
'link' | The link function for ordinal and hierarchical
models: 'logit' (default), 'probit', 'comploglog', or
'loglog'. Nominal models always use the logit link. |
'estdisp' | 'on' to estimate a dispersion
parameter, scaling the coefficient standard errors by it and testing the
coefficients against the t distribution, or 'off' (default)
for the theoretical dispersion of 1. |
'display' | A flag to enable/disable displaying
information about the fitted model. Default is 'off'. |
Source Code: mnrfit
[B, dev, stats] = mnrfit (…) also returns the
deviance of the fit, dev, and a structure stats with the fitted
coefficients 'beta' (same as B), their standard errors
'se', covariance matrix 'covb', correlation matrix
'coeffcorr', error degrees of freedom 'dfe', the coefficient
t statistics 't' and p-values 'p', the
dispersion parameters 's', 'sfit', and 'estdisp', and
the raw, Pearson, and deviance residuals 'resid', 'residp',
and 'residd'.
See also: mnrval, logistic_regression
Source Code: mnrfit