RidgeMultinomialRegression: Ridge Multinomial Logistic Regression

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/RidgeMultinomialRegression.R

Description

Function that calculates an object with the fitted multinomial logistic regression for a nominal variable. It compares with the null model, so that we will be able to compare which model fits better the variable.

Usage

1
2
RidgeMultinomialRegression(y, x, penalization = 0.2,
cte = TRUE, tol = 1e-04, maxiter = 200, showIter = FALSE)

Arguments

y

Dependent variable.

x

A matrix with the independent variables.

penalization

Penalization used in the diagonal matrix to avoid singularities.

cte

Should the model have a constant?

tol

Value to stop the process of iterations.

maxiter

Maximum number of iterations.

showIter

Should the iteration history be printed?.

Value

An object that has the following components:

fitted

Matrix with the fitted probabilities

cov

Covariance matrix among the estimates

Y

Indicator matrix for the dependent variable

beta

Estimated coefficients for the multinomial logistic regression

stderr

Standard error of the estimates

logLik

Logarithm of the likelihood

Deviance

Deviance of the model

AIC

Akaike information criterion indicator

BIC

Bayesian information criterion indicator

NullDeviance

Deviance of the null model

Difference

Difference between the two deviance values

df

Degrees of freedom

p

p-value asociated to the chi-squared estimate

CoxSnell

Cox and Snell pseudo R squared

Nagelkerke

Nagelkerke pseudo R squared

MacFaden

MacFaden pseudo R squared

PercentCorrect

Percentage of correct classifications

Author(s)

Julio Cesar Hernandez Sanchez, Jose Luis Vicente-Villardon

Maintainer: Julio Cesar Hernandez Sanchez <juliocesar_avila@usal.es>

References

Albert,A. & Anderson,J.A. (1984),On the existence of maximum likelihood estimates in logistic regression models, Biometrika 71(1), 1–10.

Bull, S.B., Mak, C. & Greenwood, C.M. (2002), A modified score function for multinomial logistic regression, Computational Statistics and dada Analysis 39, 57–74.

Firth, D.(1993), Bias reduction of maximum likelihood estimates, Biometrika 80(1), 27–38

Heinze, G. & Schemper, M. (2002), A solution to the problem of separation in logistic regression, Statistics in Medicine 21, 2109–2419

Le Cessie, S. & Van Houwelingen, J. (1992), Ridge estimators in logistic regression, Applied Statistics 41(1), 191–201.

See Also

polylogist

Examples

1
2
3
4
5
6
7
8
9
  
  data(HairColor)
  data = data.matrix(HairColor)
  G = NominalMatrix2Binary(data)
  mca=afc(G,dim=2)
  depVar = data[,1]
  rmr = RidgeMultinomialRegression(depVar,mca$RowCoordinates[,1:2],penalization=0.1)
  rmr
  

Example output

Loading required package: mirt
Loading required package: stats4
Loading required package: lattice
Loading required package: gmodels
Loading required package: MASS
$fitted
          [,1]       [,2]
[1,] 0.4489393 0.55106073
[2,] 0.6181331 0.38186685
[3,] 0.6048331 0.39516686
[4,] 0.8674095 0.13259047
[5,] 0.1524386 0.84756143
[6,] 0.2904237 0.70957629
[7,] 0.9398776 0.06012241

$cov
          [,1]      [,2]      [,3]
[1,] 0.7283273 0.1183096 0.1899474
[2,] 0.1183096 1.0690033 0.3295355
[3,] 0.1899474 0.3295355 1.6151088

$Y
     [,1] [,2]
[1,]    1    0
[2,]    1    0
[3,]    0    1
[4,]    1    0
[5,]    0    1
[6,]    0    1
[7,]    1    0

$beta
           [,1]      [,2]      [,3]
[1,] -0.3889562 -1.290287 -1.388102

$stderr
          [,1]     [,2]     [,3]
[1,] 0.8534209 1.033926 1.270869

$logLik
[1] -2.923095

$Deviance
[1] 5.84619

$AIC
[1] 11.84619

$BIC
[1] 11.68392

$NullDeviance
[1] 9.562392

$Difference
[1] 3.716202

$df
[1] 2

$p
[1] 0.1559685

$CoxSnell
[1] 0.4119163

$Nagelkerke
[1] 0.5529903

$MacFaden
[1] 0.3886268

$PercentCorrect
[1] 71.42857

attr(,"class")
[1] "polylogist"

NominalLogisticBiplot documentation built on May 2, 2019, 6:03 a.m.