statsmodels.genmod.generalized_estimating_equations.GEEResults.get_margeff

GEEResults.get_margeff(at='overall', method='dydx', atexog=None, dummy=False, count=False)[source]

Get marginal effects of the fitted model.

Parameters
atstr, optional

Options are:

  • ‘overall’, The average of the marginal effects at each observation.

  • ‘mean’, The marginal effects at the mean of each regressor.

  • ‘median’, The marginal effects at the median of each regressor.

  • ‘zero’, The marginal effects at zero for each regressor.

  • ‘all’, The marginal effects at each observation. If at is ‘all’ only margeff will be available.

Note that if exog is specified, then marginal effects for all variables not specified by exog are calculated using the at option.

methodstr, optional

Options are:

  • ‘dydx’ - dy/dx - No transformation is made and marginal effects are returned. This is the default.

  • ‘eyex’ - estimate elasticities of variables in exog – d(lny)/d(lnx)

  • ‘dyex’ - estimate semi-elasticity – dy/d(lnx)

  • ‘eydx’ - estimate semi-elasticity – d(lny)/dx

Note that tranformations are done after each observation is calculated. Semi-elasticities for binary variables are computed using the midpoint method. ‘dyex’ and ‘eyex’ do not make sense for discrete variables.

atexogarray_like, optional

Optionally, you can provide the exogenous variables over which to get the marginal effects. This should be a dictionary with the key as the zero-indexed column number and the value of the dictionary. Default is None for all independent variables less the constant.

dummybool, optional

If False, treats binary variables (if present) as continuous. This is the default. Else if True, treats binary variables as changing from 0 to 1. Note that any variable that is either 0 or 1 is treated as binary. Each binary variable is treated separately for now.

countbool, optional

If False, treats count variables (if present) as continuous. This is the default. Else if True, the marginal effect is the change in probabilities when each observation is increased by one.

Returns
effectsndarray

the marginal effect corresponding to the input options

Notes

When using after Poisson, returns the expected number of events per period, assuming that the model is loglinear.