fmlogit: Estimate Fractional Multinomial Logit Models

View source: R/fmlogit_main.R

fmlogitR Documentation

Estimate Fractional Multinomial Logit Models

Description

Used to estimate fractional multinomial logit models using quasi-maximum likelihood estimations following Papke and Wooldridge(1996).

Usage

fmlogit(y, X, beta0 = NULL, MLEmethod = "CG", maxit = 5e+05,
  abstol = 1e-05, cluster = NULL, reps = 1000, ...)

Arguments

y

the dependent variable (N*J). Can be a matrix or a named data frame. The first column of the matrix is automatically treated as the baseline.

X

independent variable (N*K). Can be a matrix or a named data frame. If there is no intercept term in the X, then an intercept term is automatically added.

beta0

Initial value for beta used in optimization. Uses a 1*K(J-1) vector. Default to a vector of zeros.

MLEmethod

Method of optimization. Goes into maxLik(method=MLEmethod)). Choose from "NR","BFGS","CG","BHHH","SANN",or "NM". Default to "CG", the conjugate gradients method. See Details.

maxit

Maximum number of iteration.

abstol

Tolerence.

cluster

A vector of cluster to be used for clustered standard error computation. Default to NULL, no cluster computed.

reps

Numbers of bootstrap replications to be computed for clustered standard errors.

...

additional parameters that goes into maxLik()

Details

The fractional multinomial model is the expansion of the multinomial logit to fractional responses. Unlike standard multinomial logit models, which only considers 0-1 respones, fractional multinomial model considers the case where the response variable is fractions that sums up to one. Examples of these type of data are, percentages of budget spent in education, defense, public health; fractions of a population that have middle school, high school, college, or post college education, etc.

This function follows Papke and Wooldridge(1996)'s paper, in which they proposed a quasi-maximum likelihood estimator for fractional response data. The likelihood function used here is a standard multinomial likelihood function, see http://maartenbuis.nl/software/likelihoodFmlogit.pdf for the likelihood used here. Robust standard errors are provided following Papke and Wooldridge(1996), in which they proposed an asymptotically consistent estimator of variance.

Maximization is done by calling maxLik. maxLik is a wrapper function for different maximization methods in R. This include most methods provided by maxLik, but also other methods such as BHHH(Berndt-Hall-Hall-Hausman).

MLE convergence can be a problem in R, especially if dataset is large with many explanatory variables. It is recommended to call CG(Conjugate Gradients) or BHHH(Berndt-Hall-Hall-Hausman). Conjugate gradients method is usually faster, but could lead to non-convergence under certain scenarios. BHHH is slower, but has better convergence performance.

Value

The function returns an object of class "fmlogit". Use effects, predict, residual, fitted to extract various useful features of the value returned by fmlogit.

An object of class "fmlogit" contains the following components:

estimates A list of matrices containing parameter estimates, standard errors, and hypothesis testing results.

baseline The baseline choice

likelihood The likelihood value

conv_code Convergence diagnostics code.

convergence Convergence messages.

count Provides dataset information

y The dependent variable data frame.

X The independent variable data frame. Augmented by factor dummy transformation , constant term added.

rowNo A vector of row numbers from the original X and y that is used for estimation.

coefficient Matrix of estimated coefficients. Augmented with the baseline coefficient (which is a vector of zeros).

vcov A list of matrices containing the robust variance covariance matrix for each choice variable.

cluster The vector of clusters.

reps Number of bootstrap replications for clustered standard error

References

Papke, L. E. and Wooldridge, J. M. (1996), Econometric methods for fractional response variables with an application to 401(k) plan participation rates. J. Appl. Econ., 11: 619-632.

Examples

data = spending
X = data[,2:5]
y = data[,6:11]
results1 = fmlogit(y,X)

f1kidd/fmlogit documentation built on June 26, 2022, 4:33 p.m.