fmlogit

The fmlogit package in R

I code and maintain a fractional multinomial logit (fmlogit) estimation package in R. Updates will be posted on my Github page. Suggestions are very welcomed.

How to install fmlogit

Type the following code into your R console:

require(devtools)
install_github("f1kidd/fmlogit")
library(fmlogit)

What is fractional multinomial logit model?

We use the fmlogit model mainly to estimate shares of multiple choices. The model is distinct in that 1) each of the response lies between 0 and 1, and 2) the share of all responses adds up to one. Fractional multinomial responses arises naturally in various occasions. For example, a municipality allocates its budgets to multiple departments, and we are interested in the proportion of the budgets that each department receives. Or, there are multiple candidates in a presidential election, and we are interested in the percentage of support for each candidate in each state.

So, why do we even need fmlogit in R?

Don’t we already have an fmlogit module in Stata? Yes, and you are very welcome to check that out.

However, this package offers several advantages over Stata’s fmlogit module, namely,

1. Integration with the R Platform

Implementating the model in R offers the opportunity to integrate the whole empirical process. With the help of numerous R packages, everything can be accomplished in R from data processing, estimation, post-estimation, to final manuscript writing. This is a huge advantage over stata.

2. Post-estimation Improvements

The marginal effect estimation in this package is much faster than Stata’s fmlogit package. In this package user can specify which variable(s), and what effect to be calculated. This results in a huge gain in running time for the post-estimation commands.

Also, this package allows hypothesis testing for marginal and discrete effects while Stata does not. The standard error is calculated via Krinsky-Robb method, which allows empirical hypothesis testing without knowing the underlying distribution of the effects.

3. Estimation Flexibility

This package allows factor variable inputs, and automatically transform it into dummy variables. This is not (explicitly) allowed in Stata.

4. Extensions

This package also allows the user to calculate and infer from a vector of “willingness to pay” measures. The user can calculate the mean and the standard error of the effect on overall WTP increase, which is implicitly derived from the choice dynamics.

Interested?

Install and try it!!