Create a Model from a formula and dataframe.
Parameters: | formula : str or generic Formula object
data : array-like
re_formula : string
subset : array-like
args : extra arguments
kwargs : extra keyword arguments
|
---|---|
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.
If re_formula is not provided, the default is a random intercept for each group.
This method currently does not correctly handle missing values, so missing values should be explicitly dropped from the DataFrame before calling this method.