docs/source/gee.rst
.. currentmodule:: statsmodels.genmod.generalized_estimating_equations
.. _gee:
Generalized Estimating Equations estimate generalized linear models for
panel, cluster or repeated measures data when the observations are possibly
correlated withing a cluster but uncorrelated across clusters. It supports
estimation of the same one-parameter exponential families as Generalized
Linear models (GLM).
See Module Reference_ for commands and arguments.
The following illustrates a Poisson regression with exchangeable correlation within clusters using data on epilepsy seizures.
.. ipython:: python
import statsmodels.api as sm
import statsmodels.formula.api as smf
data = sm.datasets.get_rdataset('epil', package='MASS').data
fam = sm.families.Poisson()
ind = sm.cov_struct.Exchangeable()
mod = smf.gee("y ~ age + trt + base", "subject", data,
cov_struct=ind, family=fam)
res = mod.fit()
print(res.summary())
Several notebook examples of the use of GEE can be found on the Wiki:
Wiki notebooks for GEE <https://github.com/statsmodels/statsmodels/wiki/Examples#generalized-estimating-equations-gee>_
References ^^^^^^^^^^
.. module:: statsmodels.genmod.generalized_estimating_equations :synopsis: Generalized estimating equations
Model Class ^^^^^^^^^^^
.. autosummary:: :toctree: generated/
GEE NominalGEE OrdinalGEE
.. module:: statsmodels.genmod.qif :synopsis: Quadratic inference functions
.. currentmodule:: statsmodels.genmod.qif
.. autosummary:: :toctree: generated/
QIF
Results Classes ^^^^^^^^^^^^^^^
.. currentmodule:: statsmodels.genmod.generalized_estimating_equations
.. autosummary:: :toctree: generated/
GEEResults GEEMargins
.. currentmodule:: statsmodels.genmod.qif
.. autosummary:: :toctree: generated/
QIFResults
Dependence Structures ^^^^^^^^^^^^^^^^^^^^^
The dependence structures currently implemented are
.. module:: statsmodels.genmod.cov_struct :synopsis: Covariance structures for Generalized Estimating Equations (GEE)
.. currentmodule:: statsmodels.genmod.cov_struct
.. autosummary:: :toctree: generated/
CovStruct Autoregressive Exchangeable GlobalOddsRatio Independence Nested
Families ^^^^^^^^
The distribution families are the same as for GLM, currently implemented are
.. module:: statsmodels.genmod.families.family :synopsis: Generalized Linear Model (GLM) families
.. currentmodule:: statsmodels.genmod.families.family
.. autosummary:: :toctree: generated/
Family Binomial Gamma Gaussian InverseGaussian NegativeBinomial Poisson Tweedie
Link Functions ^^^^^^^^^^^^^^
The link functions are the same as for GLM, currently implemented are the following. Not all link functions are available for each distribution family. The list of available link functions can be obtained by
::
>>> sm.families.family.<familyname>.links
.. currentmodule:: statsmodels.genmod.families.links
.. autosummary:: :toctree: generated/
Link
CDFLink CLogLog Log Logit NegativeBinomial Power Cauchy Identity InversePower InverseSquared Probit