Logo

statsmodels.discrete.discrete_model.MNLogit.from_formula

classmethod MNLogit.from_formula(formula, data, subset=None, *args, **kwargs)

Create a Model from a formula and dataframe.

Parameters :

formula : str or generic Formula object

The formula specifying the model

data : array-like

The data for the model. See Notes.

subset : array-like

An array-like object of booleans, integers, or index values that indicate the subset of df to use in the model. Assumes df is a pandas.DataFrame

args : extra arguments

These are passed to the model

kwargs : extra keyword arguments

These are passed to the model.

Returns :

model : Model instance

Notes

data must define __getitem__ with the keys in the formula terms args and kwargs are passed on to the model instantiation. E.g., a numpy structured or rec array, a dictionary, or a pandas DataFrame.

Previous topic

statsmodels.discrete.discrete_model.MNLogit.fit_regularized

Next topic

statsmodels.discrete.discrete_model.MNLogit.hessian

This Page