Skip to content

Commit

Permalink
added 'method' argument to 'posthoc_wilcoxon' method (fixes #67), int…
Browse files Browse the repository at this point in the history
…roduced a lower limit for scipy, discarded support for python 3.7, 3.8
  • Loading branch information
maximtrp committed Feb 17, 2024
1 parent 2f4d977 commit 3d8f0a7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "scikit-posthocs"
dynamic = ["version"]
description = "Statistical post-hoc analysis and outlier detection algorithms"
readme = "DESCRIPTION.rst"
requires-python = ">=3.6"
requires-python = ">=3.9"
keywords = ["statistics", "stats", "posthoc", "anova", "data science"]
license.file = "LICENSE"
authors = [
Expand All @@ -22,9 +22,6 @@ classifiers = [
"Topic :: Scientific/Engineering :: Mathematics",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -34,7 +31,7 @@ urls.homepage = "https://github.com/maximtrp/scikit-posthocs"
urls.documentation = "https://scikit-posthocs.rtfd.io"
dependencies = [
"numpy",
"scipy",
"scipy>=1.9.0",
"statsmodels",
"pandas>=0.20.0",
"seaborn",
Expand Down
2 changes: 1 addition & 1 deletion scikit_posthocs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.8.2'
__version__ = '0.9.0'

from scikit_posthocs._global import global_simes_test, global_f_test
from scikit_posthocs._omnibus import test_osrt, test_durbin, test_mackwolfe
Expand Down
16 changes: 13 additions & 3 deletions scikit_posthocs/_posthocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1566,7 +1566,7 @@ def posthoc_dunnett(a: Union[list, np.ndarray, DataFrame],
group_col: str = None,
control: str = None,
sort: bool = False,
to_matrix: bool = True) -> Series | DataFrame:
to_matrix: bool = True) -> Union[Series, DataFrame]:
"""
Dunnett's test [1, 2, 3] for multiple comparisons against a control group, used after parametric
ANOVA. The control group is specified by the `control` parameter.
Expand All @@ -1590,6 +1590,7 @@ def posthoc_dunnett(a: Union[list, np.ndarray, DataFrame],
control : str, optional
Name of the control group within the `group_col` column. Values should
have a nominal scale (categorical). Must be specified if `a` is a pandas
DataFrame.
sort : bool, optional
Specifies whether to sort DataFrame by group_col or not. Recommended
Expand Down Expand Up @@ -1914,6 +1915,7 @@ def posthoc_wilcoxon(
a: Union[list, np.ndarray, DataFrame],
val_col: str = None,
group_col: str = None,
method: str = 'auto',
zero_method: str = 'wilcox',
correction: bool = False,
p_adjust: str = None,
Expand All @@ -1939,7 +1941,10 @@ def posthoc_wilcoxon(
(grouping or predictor variable). Values should have a nominal scale
(categorical). Must be specified if `a` is a pandas DataFrame object.
zero_method : string, {"pratt", "wilcox", "zsplit"}, optional
method : {"auto", "exact", "approx"}, optional
Method to calculate the p-value. Default is "auto".
zero_method : {"pratt", "wilcox", "zsplit"}, optional
"pratt": Pratt treatment, includes zero-differences in the ranking
process (more conservative)
"wilcox": Wilcox treatment, discards all zero-differences
Expand Down Expand Up @@ -1977,7 +1982,11 @@ def posthoc_wilcoxon(
Notes
-----
Refer to `scipy.stats.wilcoxon` reference page for further details.
Refer to `scipy.stats.wilcoxon` reference page for further details [1]_.
References
----------
.. [1] https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.wilcoxon.html
Examples
--------
Expand All @@ -2002,6 +2011,7 @@ def posthoc_wilcoxon(
xg.get_group(groups[i]),
xg.get_group(groups[j]),
zero_method=zero_method,
method=method,
correction=correction)[1]

if p_adjust:
Expand Down

0 comments on commit 3d8f0a7

Please sign in to comment.