mnrfit
Perform logistic regression for binomial responses or multiple ordinal responses.
Note: This function is currently a wrapper for the logistic_regression
function. It can only be used for fitting an ordinal logistic model and a
nominal model with 2 categories (which is an ordinal case). Hierarchical
models as well as nominal model with more than two classes are not currently
supported. This function is a work in progress.
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
numeric matrix the observations on predictor variables, where
corresponds to the number of observations and corresponds to
predictor variables. Y contains the response category labels and it
either be an categorical or numerical matrix (containing only 1s
and 0s) or an 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 parameterss specified Name-Value pair arguments.
| Name | Value | |
|---|---|---|
"model" | Specifies the type of model to fit.
Currently, only "ordinal" is fully supported. "nominal" is
only supported for 2 classes in Y. | |
"display" | A flag to enable/disable displaying
information about the fitted model. Default is "off". |
[B, dev, stats] = mnrfit (… also returns the
deviance of the fit, dev, and the structure stats for any of the
previous input arguments. stats currently only returns values for the
fields "beta", same as B, "coeffcorr", the estimated
correlation matrix for B, "covd", the estimated covariance
matrix for B, and "se", the standard errors of the coefficient
estimates B.
See also: logistic_regression
Source Code: mnrfit