R: Fit Statistics and Specification Test for Multinomial...
mnlfit
R Documentation
Fit Statistics and Specification Test for Multinomial Logistic Regression
Description
Provides fit statistics (pseudo R-squared values) and the Fagerland, Hosmer and Bonfi (2008) specification test for Multinomial Logistic Regression models.
Usage
mnlfit(obj, permute = FALSE)
Arguments
obj
An object of class multinom
permute
Logical indicating whether to check all base categories for the Fagerland et. al. specification test.
Value
A list with elements:
result
Fit statistics.
permres
The results of the base category permutation exercise.
Author(s)
Dave Armstrong (UW-Milwaukee, Department of Political Science)
References
Fagerland M. W., D. W. Hosmer and A. M. Bonfi. 2008. ‘Multinomial goodness-of-fit tests for logistic regression models.’ Statistics in Medicine. 27(21): 4238-4253.
Examples
library(nnet)
data(france)
mnl.mod <- multinom(vote ~ age + male + retnat + lrself, data=france)
mnlfit(mnl.mod)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DAMisc)
Loading required package: car
Loading required package: effects
Attaching package: 'effects'
The following object is masked from 'package:car':
Prestige
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DAMisc/mnlfit.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mnlfit
> ### Title: Fit Statistics and Specification Test for Multinomial Logistic
> ### Regression
> ### Aliases: mnlfit print.mnlfit
>
> ### ** Examples
>
> library(nnet)
> data(france)
> mnl.mod <- multinom(vote ~ age + male + retnat + lrself, data=france)
# weights: 35 (24 variable)
initial value 872.315349
iter 10 value 655.272636
iter 20 value 559.902797
iter 30 value 551.176433
final value 551.169697
converged
> mnlfit(mnl.mod)
Fit Statistics
Estimate p-value
Fagerland, Hosmer and Bonfi 45.014 0.063
Count R2 0.598
Count R2 (Adj) 0.329
ML R2 0.599
McFadden R2 0.310
McFadden R2 (Adj) 0.274
Cragg-Uhler(Nagelkerke) R2 0.632
Warning message:
In mnlfit(mnl.mod) : 42% of expected counts < 5
>
>
>
>
>
> dev.off()
null device
1
>