Hypothesis testing for multinomial logit models
Three hypothesis tests applicable to any MLE (Likelihood ratio test, Wald test, Rao score test) and the Hausman-McFadden test for IIA (independence of irrelevant alternatives) are provided.
lrtest(object, ...) waldtest(object, ...) scoretest(object, ...) ## S3 method for class 'mnlogit' lrtest(object, ...) ## S3 method for class 'mnlogit' scoretest(object, ...) ## S3 method for class 'mnlogit' waldtest(object, ...) hmftest(x, ...) ## S3 method for class 'formula' hmftest(x, alt.subset, ...) ## S3 method for class 'mnlogit' hmftest(x, z, ...)
object |
An fitted model which is an object of class |
... |
For |
x |
A fitted object of class |
z |
An object of class |
alt.subset |
A subset of alternatives to do testing on. |
An object of class htest, with elements:
statistic |
The value of the test statistic. |
parameter |
the value of the underlying test distribution's parameter. In this case, the numbe r of degrees of freedom of chi-squared distribution. |
data.name |
The data frame used. |
p.value |
Probability for accepting the null hypothesis. |
method |
The name of the hypothesis test. |
alternative |
Alternative hypothesis. |
Asad Hasan, Wang Zhiyu, Alireza S. Mahani
Code for the last two tests (Score and IIA test) is gratefully adapted from the CRAN package mlogit, while the first 2 tests are performed by functions in the CRAN package lmtest.
Croissant, Yves. Estimation of multinomial logit models in R: The mlogit Packages.
Achim Zeileis, Torsten Hothorn (2002) Diagnostic Checking in Regression Relationships, R News 2(3), 7-10.
library(mnlogit)
data(Fish, package = "mnlogit")
# Unconstrained model
fm <- formula(mode ~ price | income | catch)
fit <- mnlogit(fm, Fish)
# Constrained model - intercep dropped
fm.c <- formula(mode ~ price | income - 1 | catch)
fit.c <- mnlogit(fm.c, Fish)
## MLE hypothesis tests
lrtest(fit, fit.c)
waldtest(fit, fit.c)
scoretest(fit, fit.c)
## IIA test
alt.subset <- c("beach", "boat", "charter")
hmftest(fit, alt.subset)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.