Learn R Programming

lmap (version 0.2.4)

mlr: Multinomial Logistic Regression

Description

The function mlr performs multinomial logistic regression for a nominal response variable and a set of predictor variables. It uses an MM algorithm

Usage

mlr(y, X, base = "largest", maxiter = 65536, dcrit = 1e-06)

Value

Xoriginal Matrix X from input

X Scaled X matrix

G class indicator matrix

ynames class names of response variable

xnames variable names of the predictors

mx means of the predictor variables

sdx standard deviations of the predictor variables

A matrix with regression coefficients

iter number of iterations

deviance value of the deviance at convergence

Arguments

y

An N vector of the responses (categorical).

X

An N by P matrix with predictor variables

base

The category that should be used as baseline. Can be NULL, in which case the colmeans are equal to zero. Can also be "largest", in which case the

maxiter

maximum number of iterations

dcrit

convergence criterion

Examples

Run this code
if (FALSE) {
data(dataExample_mru)
y = as.matrix(dataExample_mru[ , 1])
X = as.matrix(dataExample_mru[ , 2:6])
output = mlr(y = y, X = X, base = 1)
}

Run the code above in your browser using DataLab