Skip to content

Commit

Permalink
Test ancovan with new version of patsy
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Nov 16, 2018
1 parent 454ea0c commit b484842
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pingouin/tests/test_parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pingouin.tests._tests_pingouin import _TestPingouin
from pingouin.parametric import (ttest, anova, anova2, rm_anova, mixed_anova,
rm_anova2, ancova, welch_anova)
rm_anova2, ancova, welch_anova, ancovan)
from pingouin.datasets import read_dataset

# Generate random data for ANOVA
Expand Down Expand Up @@ -119,18 +119,18 @@ def test_ancova(self):
between='Method', export_filename='test_export.csv',
return_bw=True)
ancova(data=df, dv='Scores', covar=['Income'], between='Method')
# ancova(data=df, dv='Scores', covar=['Income', 'BMI'],
# between='Method')

# def test_ancovan(self):
# """Test function ancovan."""
# df = read_dataset('ancova')
# aov = ancovan(data=df, dv='Scores', covar=['Income', 'BMI'],
# between='Method')
# # Compare with statsmodels
# assert np.allclose(aov.loc[0, 'F'], 3.233)
# assert np.allclose(aov.loc[1, 'F'], 27.637)
# ancovan(data=df, dv='Scores', covar=['Income', 'BMI'],
# between='Method', export_filename='test_export.csv')
# ancovan(data=df, dv='Scores', covar=['Income'], between='Method')
# ancovan(data=df, dv='Scores', covar='Income', between='Method')
ancova(data=df, dv='Scores', covar=['Income', 'BMI'],
between='Method')

def test_ancovan(self):
"""Test function ancovan."""
df = read_dataset('ancova')
aov = ancovan(data=df, dv='Scores', covar=['Income', 'BMI'],
between='Method')
# Compare with statsmodels
assert np.allclose(aov.loc[0, 'F'], 3.233)
assert np.allclose(aov.loc[1, 'F'], 27.637)
ancovan(data=df, dv='Scores', covar=['Income', 'BMI'],
between='Method', export_filename='test_export.csv')
ancovan(data=df, dv='Scores', covar=['Income'], between='Method')
ancovan(data=df, dv='Scores', covar='Income', between='Method')

0 comments on commit b484842

Please sign in to comment.