4.1.7.1.3. statsmodels.base.model.handle_formula_data

statsmodels.base.model.handle_formula_data(Y, X, formula, depth=0, missing='drop')[source]

Returns endog, exog, and the model specification from arrays and formula

Parameters:

Y : array-like

Either endog (the LHS) of a model specification or all of the data. Y must define __getitem__ for now.

X : array-like

Either exog or None. If all the data for the formula is provided in Y then you must explicitly set X to None.

formula : str or patsy.model_desc

You can pass a handler by import formula_handler and adding a key-value pair where the key is the formula object class and the value is a function that returns endog, exog, formula object

Returns:

endog : array-like

Should preserve the input type of Y,X

exog : array-like

Should preserve the input type of Y,X. Could be None.