statsmodels.genmod.bayes_mixed_glm.BinomialBayesMixedGLM.from_formula#

classmethod BinomialBayesMixedGLM.from_formula(formula, vc_formulas, data, vcp_p=1, fe_p=2)[source]#

Fit a BinomialBayesMixedGLM using a formula.

Parameters:
formulastr

Formula for the endog and fixed effects terms (use ~ to separate dependent and independent expressions).

vc_formulasdict

vc_formulas[name] is a one-sided formula that creates one collection of random effects with a common variance parameter. If using categorical (factor) variables to produce variance components, note that generally 0 + … should be used so that an intercept is not included.

dataDataFrame

The data to which the formulas are applied.

vcp_pfloat, optional

The prior standard deviation for the logarithms of the standard deviations of the random effects.

fe_pfloat, optional

The prior standard deviation for the fixed effects parameters.

Returns:
BinomialBayesMixedGLM instance.