1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
.. currentmodule:: statsmodels.stats.anova
.. _anova:
ANOVA
=====
Analysis of Variance models containing anova_lm for ANOVA analysis with a
linear OLSModel, and AnovaRM for repeated measures ANOVA, within ANOVA for
balanced data.
Examples
--------
.. ipython:: python
import statsmodels.api as sm
from statsmodels.formula.api import ols
moore = sm.datasets.get_rdataset("Moore", "carData",
cache=True) # load data
data = moore.data
data = data.rename(columns={"partner.status":
"partner_status"}) # make name pythonic
moore_lm = ols('conformity ~ C(fcategory, Sum)*C(partner_status, Sum)',
data=data).fit()
table = sm.stats.anova_lm(moore_lm, typ=2) # Type 2 ANOVA DataFrame
print(table)
A more detailed example for `anova_lm` can be found here:
* `ANOVA <examples/notebooks/generated/interactions_anova.ipynb>`_
Module Reference
----------------
.. module:: statsmodels.stats.anova
:synopsis: Analysis of Variance
.. autosummary::
:toctree: generated/
anova_lm
AnovaRM
|