This is a python implementation of the R package statcheck (ver. 1.4.0-beta.4) published by Michèle B. Nuijten [MicheleNuijten]. The original package can by found at her Github
page. The code relies heavily on Nuijten's work and is currently only a python implementation of the original package, with the goal of making it more accessible to the
python community. Both packages are published under the GNU General Public License v3.0. To ensure usability, all the original tests were recoded to the python version.
statcheck is a free, open source Python package that can be used to
automatically extract statistical null-hypothesis significant testing
(NHST) results from articles and recompute the p-values based on the
reported test statistic and degrees of freedom to detect possible
inconsistencies.
statcheck is mainly useful for:
- Self-checks: you can use
statcheckto make sure your manuscript doesn’t contain copy-paste errors or other inconsistencies before you submit it to a journal. - Peer review: editors and reviewers can use
statcheckto check submitted manuscripts for statistical inconsistencies. They can ask authors for a correction or clarification before publishing a manuscript. - Research:
statcheckcan be used to automatically extract statistical test results from articles that can then be analyzed. You can for instance investigate whether you can predict statistical inconsistencies (see e.g., Nuijten et al., 2017), or use it to analyze p-value distributions (see e.g., Hartgerink et al., 2016).
The algorithm behind statcheck consists of four basic steps:
- Convert pdf and html articles to plain text files.
- Search the text for instances of NHST results. Specifically,
statcheckcan recognize t-tests, F-tests, correlations, z-tests,-tests, and Q-tests (from meta-analyses) if they are reported completely (test statistic, degrees of freedom, and p-value) and in APA style.
- Recompute the p-value using the reported test statistic and degrees of freedom.
- Compare the reported and recomputed p-value. If the reported
p-value does not match the computed one, the result is marked as
an inconsistency (
Errorin the output). If the reported p-value is significant and the computed is not, or vice versa, the result is marked as a gross inconsistency (DecisionErrorin the output).
statcheck takes into account correct rounding of the test statistic,
and has the option to take into account one-tailed testing. See the
manual for details.
For detailed information about installing and using statcheck, see the
Documentation file in the github repository, or refer to the R documentation.
pip install statcheckfrom statcheck.checkdir import checkPDFdir
dir = 'path/to/pdf/directory'
Res, pRes = checkPDFdir(dir, subdir = False)
# Res is a pandas dataframe with the analysis of statistical results
Res
# pRes is a pandas dataframe with extracted p-values
pRespip install pytest
pytest tests/statcheck.io is a web-based interface for statcheck.
** Hubert Plisiecki **
---
@misc{MicheleNuijten,
author = {Michèle B. Nuijten},
title = {statcheck},
year = {2021},
url = {{https://github.com/MicheleNuijten/statcheck}}
}
---