7.6. Regression with Discrete Dependent Variable

Regression models for limited and qualitative dependent variables. The module currently allows the estimation of models with binary (Logit, Probit), nominal (MNLogit), or count (Poisson) data.

See Module Reference for commands and arguments.

7.6.1. Examples

# Load the data from Spector and Mazzeo (1980)
spector_data = sm.datasets.spector.load()
spector_data.exog = sm.add_constant(spector_data.exog)

# Logit Model
logit_mod = sm.Logit(spector_data.endog, spector_data.exog)
logit_res = logit_mod.fit()
print logit_res.summary()

Detailed examples can be found here:

7.6.2. Technical Documentation

Currently all models are estimated by Maximum Likelihood and assume independently and identically distributed errors.

All discrete regression models define the same methods and follow the same structure, which is similar to the regression results but with some methods specific to discrete models. Additionally some of them contain additional model specific methods and attributes.

7.6.2.1. References

General references for this class of models are:

A.C. Cameron and P.K. Trivedi.  `Regression Analysis of Count Data`.
    Cambridge, 1998

G.S. Madalla. `Limited-Dependent and Qualitative Variables in Econometrics`.
    Cambridge, 1983.

W. Greene. `Econometric Analysis`. Prentice Hall, 5th. edition. 2003.

7.6.3. Module Reference

The specific model classes are:

Logit(endog, exog, **kwargs) Binary choice logit model
Probit(endog, exog, **kwargs) Binary choice Probit model
MNLogit(endog, exog, **kwargs) Multinomial logit model
Poisson(endog, exog[, offset, exposure, missing]) Poisson model for count data
NegativeBinomial(endog, exog[, ...]) Negative Binomial Model for count data

The specific result classes are:

LogitResults(model, mlefit[, cov_type, ...]) A results class for Logit Model
ProbitResults(model, mlefit[, cov_type, ...]) A results class for Probit Model
CountResults(model, mlefit[, cov_type, ...]) A results class for count data
MultinomialResults(model, mlefit[, ...]) A results class for multinomial data
NegativeBinomialResults(model, mlefit[, ...]) A results class for NegativeBinomial 1 and 2

DiscreteModel is a superclass of all discrete regression models. The estimation results are returned as an instance of one of the subclasses of DiscreteResults. Each category of models, binary, count and multinomial, have their own intermediate level of model and results classes. This intermediate classes are mostly to facilitate the implementation of the methods and attributes defined by DiscreteModel and DiscreteResults.

DiscreteModel(endog, exog, **kwargs) Abstract class for discrete choice models.
DiscreteResults(model, mlefit[, cov_type, ...]) A results class for the discrete dependent variable models.
BinaryModel(endog, exog, **kwargs)
BinaryResults(model, mlefit[, cov_type, ...]) A results class for binary data
CountModel(endog, exog[, offset, exposure, ...])
MultinomialModel(endog, exog, **kwargs)