wmwm


Namewmwm JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/Yijin-Zeng/wmwm-python
SummaryA Python package performing Wilcoxon-Mann-Whitney test in the presence of missing data with controlled Type I error
upload_time2024-11-04 11:56:35
maintainerYijin Zeng
docs_urlNone
authorYijin Zeng
requires_python>=3.6
licenseMIT
keywords wilcoxon mann-whitney test missing data statistical analysis
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<!-- README.md is generated from README.Rmd. Please edit that file -->

# wmwm

<!-- badges: start -->
<!-- badges: end -->

This package performs the two-sample hypothesis test method proposed in 
(Zeng et al., 2024) for univariate data when data are not fully observed. 
This method is a theoretical extension of Wilcoxon-Mann-Whitney test in 
the presence of missing data, which controls the Type I error regardless 
of values of missing data.

Bounds of the Wilcoxon-Mann-Whitne test statistic and its p-value will be 
computed in the presence of missing data. The p-value of the test method 
proposed in (Zeng et al., 2024) is then returned as the maximum possible 
p-value of the Wilcoxon-Mann-Whitney test.

## Installation

``` sh
pip install wmwm
```

## Example

This is a basic example which shows you how to perform the test with
missing data:

``` python
import numpy as np
from wmwm import wmwm_test

#### Assume all samples are distinct.
X = np.array([6.2, 3.5, np.nan, 7.6, 9.2])
Y = np.array([0.2, 1.3, -0.5, -1.7])
## By default, when the sample sizes of both X and Y are smaller than 50,
## exact distribution will be used.
wmwm_test(X, Y, ties = False, alternative = 'two.sided')


## using normality approximation with continuity correction:
wmwm_test(X, Y, ties = False, alternative = 'two.sided', exact = False, correct = True)


#### Assume samples can be tied.
X = np.array([6, 9, np.nan, 7, 9])
Y = np.array([0, 1, 0, -1])
## When the samples can be tied, normality approximation will be used.
## By default, lower_boundary = -Inf, upper_boundary = Inf.
wmwm_test(X, Y, ties = True, alternative = 'two.sided')


## specifying lower_boundary and upper_boundary:
wmwm_test(X, Y, ties = True, alternative = 'two.sided', lower_boundary = -1, upper_boundary = 9)


```

## References

Zeng Y, Adams NM, Bodenham DA. On two-sample testing for data with
arbitrarily missing values. arXiv preprint arXiv:2403.15327. 2024 Mar
22.

Mann, Henry B., and Donald R. Whitney. “On a test of whether one of two
random variables is stochastically larger than the other.” The annals of
mathematical statistics (1947): 50-60.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Yijin-Zeng/wmwm-python",
    "name": "wmwm",
    "maintainer": "Yijin Zeng",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "yijinzeng20@gmail.com",
    "keywords": "Wilcoxon Mann-Whitney test, missing data, statistical analysis",
    "author": "Yijin Zeng",
    "author_email": "yijinzeng20@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/dd/6b/211ef173471bfa98f1bc757ddf7ef827ac5db1aa647310150575d69ca285/wmwm-0.0.1.tar.gz",
    "platform": null,
    "description": "\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n# wmwm\n\n<!-- badges: start -->\n<!-- badges: end -->\n\nThis package performs the two-sample hypothesis test method proposed in \n(Zeng et al., 2024) for univariate data when data are not fully observed. \nThis method is a theoretical extension of Wilcoxon-Mann-Whitney test in \nthe presence of missing data, which controls the Type I error regardless \nof values of missing data.\n\nBounds of the Wilcoxon-Mann-Whitne test statistic and its p-value will be \ncomputed in the presence of missing data. The p-value of the test method \nproposed in (Zeng et al., 2024) is then returned as the maximum possible \np-value of the Wilcoxon-Mann-Whitney test.\n\n## Installation\n\n``` sh\npip install wmwm\n```\n\n## Example\n\nThis is a basic example which shows you how to perform the test with\nmissing data:\n\n``` python\nimport numpy as np\nfrom wmwm import wmwm_test\n\n#### Assume all samples are distinct.\nX = np.array([6.2, 3.5, np.nan, 7.6, 9.2])\nY = np.array([0.2, 1.3, -0.5, -1.7])\n## By default, when the sample sizes of both X and Y are smaller than 50,\n## exact distribution will be used.\nwmwm_test(X, Y, ties = False, alternative = 'two.sided')\n\n\n## using normality approximation with continuity correction:\nwmwm_test(X, Y, ties = False, alternative = 'two.sided', exact = False, correct = True)\n\n\n#### Assume samples can be tied.\nX = np.array([6, 9, np.nan, 7, 9])\nY = np.array([0, 1, 0, -1])\n## When the samples can be tied, normality approximation will be used.\n## By default, lower_boundary = -Inf, upper_boundary = Inf.\nwmwm_test(X, Y, ties = True, alternative = 'two.sided')\n\n\n## specifying lower_boundary and upper_boundary:\nwmwm_test(X, Y, ties = True, alternative = 'two.sided', lower_boundary = -1, upper_boundary = 9)\n\n\n```\n\n## References\n\nZeng Y, Adams NM, Bodenham DA. On two-sample testing for data with\narbitrarily missing values. arXiv preprint arXiv:2403.15327. 2024 Mar\n22.\n\nMann, Henry B., and Donald R. Whitney. \u201cOn a test of whether one of two\nrandom variables is stochastically larger than the other.\u201d The annals of\nmathematical statistics (1947): 50-60.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python package performing Wilcoxon-Mann-Whitney test in the presence of missing data with controlled Type I error",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/Yijin-Zeng/wmwm-python"
    },
    "split_keywords": [
        "wilcoxon mann-whitney test",
        " missing data",
        " statistical analysis"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a07765e474593cb1007fe3a3996493ab0e92fd658d3568064a7f02494ce84b8a",
                "md5": "764c8482372aa448925bf812c749445b",
                "sha256": "5c38525ab400e7860e8c78e83273dcc903263460178f86842cdad898a6f3e249"
            },
            "downloads": -1,
            "filename": "wmwm-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "764c8482372aa448925bf812c749445b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10529,
            "upload_time": "2024-11-04T11:56:34",
            "upload_time_iso_8601": "2024-11-04T11:56:34.401633Z",
            "url": "https://files.pythonhosted.org/packages/a0/77/65e474593cb1007fe3a3996493ab0e92fd658d3568064a7f02494ce84b8a/wmwm-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dd6b211ef173471bfa98f1bc757ddf7ef827ac5db1aa647310150575d69ca285",
                "md5": "02b983573b4b8804a7d74f0939b99238",
                "sha256": "b71ed69069e3613118bb0e7924e1f0ec3255329dafac3eb094501540f20e1f0b"
            },
            "downloads": -1,
            "filename": "wmwm-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "02b983573b4b8804a7d74f0939b99238",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8608,
            "upload_time": "2024-11-04T11:56:35",
            "upload_time_iso_8601": "2024-11-04T11:56:35.764848Z",
            "url": "https://files.pythonhosted.org/packages/dd/6b/211ef173471bfa98f1bc757ddf7ef827ac5db1aa647310150575d69ca285/wmwm-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-04 11:56:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Yijin-Zeng",
    "github_project": "wmwm-python",
    "github_not_found": true,
    "lcname": "wmwm"
}
        
Elapsed time: 4.88544s