Description Usage Arguments Details Value Author(s) References Examples

Test the IIA hypothesis (independence of irrelevant alternatives) for a multinomial logit model.

1 2 3 4 5 |

`x` |
an object of class |

`z` |
an object of class |

`alt.subset` |
a subset of alternatives, |

`...` |
further arguments passed to |

This is an implementation of the Hausman's consistency test for
multinomial logit models. If the independance of irrelevant
alternatives applies, the probability ratio of every two alternatives
depends only on the characteristics of these
alternatives. Consequentely, the results obtained on the estimation
with all the alternatives or only on a subset of them are consistent,
but more efficient in the first case. On the contrary, only the
results obtained from the estimation on a relevant subset are
consistent. To compute this test, one needs a model estimated with all
the alternatives and one model estimated on a subset of
alternatives. This can be done by providing two objects of class
`mlogit`

, one object of class `mlogit`

and a character
vector indicating the subset of alternatives, or a formula and a
subset of alternatives.

an object of class `"htest"`

.

Yves Croissant

Hausman, J.A. and D. McFadden (1984), A Specification Test for the
Multinomial Logit Model,
*Econometrica*, **52**, pp.1219–1240.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ```
## from Greene's Econometric Analysis p. 731
data("TravelMode",package="AER")
TravelMode <- mlogit.data(TravelMode,choice="choice",shape="long",
alt.var="mode",chid.var="individual")
## Create a variable of income only for the air mode
TravelMode$avinc <- with(TravelMode,(mode=='air')*income)
## Estimate the model on all alternatives, with car as the base level
## like in Greene's book.
#x <- mlogit(choice~wait+gcost+avinc,TravelMode,reflevel="car")
x <- mlogit(choice~wait+gcost+avinc,TravelMode)
## Estimate the same model for ground modes only (the variable avinc
## must be dropped because it is 0 for every observation
g <- mlogit(choice~wait+gcost,TravelMode,reflevel="car",
alt.subset=c("car","bus","train"))
## Compute the test
hmftest(x,g)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.