Skip to content

Commit

Permalink
updates to docs and such for release 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
aschleg committed Aug 17, 2020
1 parent 7da147d commit bb4f096
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 0.3.1

This release is a quick fix for McNemar's test in the `contingency` module. There was some misleading literature in one
of the references which led to some incorrect changes in the previous release. This should be resolved now and an
update to the tests is coming up soon as well.

## Version 0.3.0

### New Additions:
Expand Down
22 changes: 22 additions & 0 deletions docs/source/generated/hypothetical.gof.ChiSquareTest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
hypothetical.gof.ChiSquareTest
==============================

.. currentmodule:: hypothetical.gof

.. autoclass:: ChiSquareTest


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~ChiSquareTest.__init__






22 changes: 22 additions & 0 deletions docs/source/generated/hypothetical.gof.JarqueBera.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
hypothetical.gof.JarqueBera
===========================

.. currentmodule:: hypothetical.gof

.. autoclass:: JarqueBera


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~JarqueBera.__init__






63 changes: 63 additions & 0 deletions docs/source/versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,69 @@
Version History
===============

Version 0.3.1
-------------

This release is a quick fix for McNemar's test in the `contingency` module. There was some misleading literature in one
of the references which led to some incorrect changes in the previous release. This should be resolved now and an
update to the tests is coming up soon as well.

Version 0.3.0
-------------

New Additions:
**************

Factor Analysis

* Factor Analysis
* Several algorithms for performing Factor Analysis are available, including principal components, principal
factors, and iterated principal factors.

Nonparametric

* Wald-Wolfowitz Two Sample Nonparametric Runs Test
* A nonparametric test for determining if two independent samples have been drawn from the same population or that they differ in any respect.

Analysis of Variance

* Tests for Homogenity of Variance
* Bartlett's Test for Homogenity of Variances
* Levene's Test for Homogenity of Variances
* Analysis of Variance
* Van Der Waerden's (normal scores) Test

Critical Values

* Critical Value Tables and Lookup Functions
* D critical value (used in the Kolomogorov-Smirnov Goodness-of-Fit test) table and lookup function have been added.

Updates and changes:
********************

Contingency

* Chi Square Test of Dependence
* Updates to methods in `ChiSquareContingency`.
* The previous measures of association method has been removed in favor of specific methods for each measure of association. These include:
* Cramer's $V$
* Phi Coefficient, $\phi$
* Contingency Coefficient, $C$
* Tschuprow's Coefficient, $T$ (new)
* The `test_summary` attribute of an initialized `ChiSquareContingency` class
now has separate key-value pairs for each computed association measure.
* McNemar's Test
* The test has been fixed to use the correct cells in the 2x2 contingency table.
* Continuity correction is now applied by default when performing the test. Setting the parameter `continuity=False`
will perform the non-continuity corrected version of the test.

Nonparametric

* Median Test
* A multiple comparisons posthoc test is now available.

* Many updates to documentation and docstrings.

Version 0.2.0
-------------

Expand Down
17 changes: 9 additions & 8 deletions hypothetical/contingency.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ class McNemarTest(object):
Examples
--------
>>> m = McNemarTest([[59, 6], [16, 80]])
>>> m = McNemarTest([[59, 6], [16, 80]], continuity=False)
>>> m.test_summary
{'Asymptotic z-statistic': 2.1320071635561044,
'Exact p-value': 0.052478790283203125,
Expand All @@ -589,7 +589,7 @@ class McNemarTest(object):
'Mid p-value': 0.034689664840698256,
'N': 161,
'continuity': False}
>>> m2 = McNemarTest([[59, 6], [16, 80]], continuity=True)
>>> m2 = McNemarTest([[59, 6], [16, 80]])
>>> m2.test_summary
{'Asymptotic z-statistic': 1.9188064472004938,
'Exact p-value': 0.052478790283203125,
Expand All @@ -611,8 +611,9 @@ class McNemarTest(object):
Gibbons, J. D., & Chakraborti, S. (2010). Nonparametric statistical inference. London: Chapman & Hall.
Siegel, S. (1956). Nonparametric statistics: For the behavioral sciences.
McGraw-Hill. ISBN 07-057348-4
Wikipedia contributors. (2018, April 29). McNemar's test. In Wikipedia, The Free Encyclopedia.
Retrieved 12:24, August 15, 2018,
from https://en.wikipedia.org/w/index.php?title=McNemar%27s_test&oldid=838855782
"""
def __init__(self, table, continuity=True):
Expand Down Expand Up @@ -668,9 +669,9 @@ def _mcnemar_test_stat(self):
"""
if not self.continuity:
x2 = (self.table[0, 0] - self.table[1, 1]) ** 2 / (self.table[0, 1] + self.table[1, 0])
x2 = (self.table[0, 1] - self.table[1, 0]) ** 2 / (self.table[0, 1] + self.table[1, 0])
else:
x2 = (np.absolute(self.table[0, 0] - self.table[1, 1]) - 1) ** 2 / (self.table[0, 0] + self.table[1, 1])
x2 = (np.absolute(self.table[0, 1] - self.table[1, 0]) - 1) ** 2 / (self.table[0, 1] + self.table[1, 0])

return x2

Expand Down Expand Up @@ -703,9 +704,9 @@ def _asymptotic_test(self):
"""
if not self.continuity:
z_asymptotic = (self.table[1, 0] - self.table[0, 1]) / np.sqrt(self.table[0, 1] + self.table[1, 0])
z_asymptotic = (self.table[0, 1] - self.table[1, 0]) / np.sqrt(self.table[0, 1] + self.table[1, 0])
else:
z_asymptotic = (np.absolute(self.table[1, 0] - self.table[0, 1]) - 1) / \
z_asymptotic = (np.absolute(self.table[0, 1] - self.table[1, 0]) - 1) / \
np.sqrt(self.table[0, 1] + self.table[1, 0])

return z_asymptotic
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='hypothetical',
version='0.3.0',
version='0.3.1',
author='Aaron Schlegel',
author_email='aaron@aaronschlegel.me',
description='Hypothesis testing and other testing methods',
Expand Down

0 comments on commit bb4f096

Please sign in to comment.