Skip to main content

Statistical detection tools for screening published research

Project description

bullshit-detector

Statistical detection tools for screening published research.

"Bullshit is unavoidable whenever circumstances require someone to talk without knowing what they are talking about." — Harry Frankfurt, On Bullshit (2005)

What this is

A Python toolkit for systematically screening research papers for statistical red flags. Organized in four tiers, from quick API lookups to deep data analysis. Developed from petroleum geoscience applications but applicable to any field where correlations, p-values, and sample sizes are reported.

Tier What it checks What you need Time
0 — Paper screening Journal legitimacy, retractions, author credentials DOI, journal name Minutes
1 — Arithmetic p-value consistency, GRIM/GRIMMER tests Reported statistics Minutes
2 — Plausibility Spurious correlations, critical r, confidence intervals Summary stats (r, n, k) Minutes
3 — Data analysis Outlier leverage, distance correlation, reproducibility Raw/digitized data Hours

Installation

pip install bullshit-detector          # Core (Tiers 0–2)
pip install bullshit-detector[full]    # + Tier 3 tools (statsmodels, seaborn)
pip install bullshit-detector[batch]   # + statcheck for PDF batch scanning (GPL-3.0)
pip install bullshit-detector[dev]     # + pytest for development

Quick Start

Is the reported p-value correct?

from bullshit_detector.p_checker import check_p_value

check_p_value("t", 2.20, 28, reported_p=0.04)
# {'computed_p': 0.0362254847788378, 'reported_p': 0.04,
#  'consistent': True, 'decision_error': False, ...}

Reported p=0.04 is consistent with computed p=0.036 — within rounding tolerance.

Could this correlation be spurious?

from bullshit_detector.spurious import P_spurious

# r=0.60, n=5 observations, k=10 predictor variables tested
P_spurious(0.60, 5, 10)
# 0.9649622440458044

With r=0.60, n=5 observations, and k=10 variables tested, there is a 96.5% probability this correlation is spurious.

Has this paper been retracted?

from bullshit_detector.paper_screening import check_retraction

check_retraction("10.2147/DMSO.S27665")
# {'retracted': True, 'corrections': [], 'pubpeer_comments': 0,
#  'pubpeer_url': 'https://pubpeer.com/publications/10.2147-DMSO.S27665'}

retracted: True — the paper behind this DOI has been formally retracted. Do not cite or act on its findings. (This is the Vinson et al. 2012 green coffee extract paper, retracted in 2014 after an FTC investigation.)

Intellectual foundations

This project stands on the shoulders of:

  • Carl T. Bergstrom & Jevin D. WestCalling Bullshit: The Art of Skepticism in a Data-Driven World (Random House, 2020) and their University of Washington course. The paper-level screening module (Tier 0) directly implements their legitimacy framework.
  • Harry FrankfurtOn Bullshit (Princeton University Press, 2005). Established the philosophical foundation.
  • C.T. Kalkomey — "Potential risks when using seismic attributes as predictors of reservoir properties" (The Leading Edge, 1997). The spurious correlation probability formula.
  • N.J.L. Brown & J.A.J. Heathers — "The GRIM Test" (SPPS, 2017). Arithmetic consistency checking for means.
  • Aurélien Allard — "Analytic-GRIMMER" (2018). Extended GRIM to standard deviations. The Python port in this package is the first on PyPI.
  • Kristin Sainani — "How to Be a Statistical Detective" (PM&R, 2020). Pedagogical framework tying these tools together.
  • Thomas Speidel — GeoConvention 2018 R notebook. Variable selection methods (redundancy analysis, LASSO, sparse PCA, power analysis) on the Hunt dataset, complementing Niccoli's Python implementations. Inspired the redundancy and power modules.
  • Michèle Nuijten et al. — statcheck (Behavioral Research Methods, 2016). P-value recomputation methodology.

For AI assistants

The skills/ directory contains detection heuristics and decision trees for each module. If you're a coding assistant (Copilot, Claude Code, etc.), read skills/OVERVIEW.md first.

Acknowledgments

Kristin Sainani — her paper "How to Be a Statistical Detective" (PM&R, 2020, 12(2):211–215, DOI: 10.1002/pmrj.12305) inspired the Tier 1 arithmetic consistency approach and the overall "statistical detective" framing of this package. The p_checker module's pedagogical structure follows her framework of treating statistical anomalies as clues that warrant further investigation. More broadly, her detective framing runs through the entire package lineage: it directly inspired Matteo Niccoli's "Be a geoscience and data science detective" project (MyCarta blog, GitHub repo, TRANSFORM 2021 lightning talk), which is the primary source for the Tier 3 modules (leverage.py, reproducibility.py).

Thomas Speidel — his GeoConvention 2018 R notebook, Data Science Tools for Petroleum Exploration and Production, provided the methodology for the power analysis and redundancy modules (Tier 2). The original GeoConvention 2018 presentation was a collaboration between Matteo Niccoli and Thomas Speidel; Speidel's R implementations of power analysis and variable redundancy (Hmisc::redun), applied to the Hunt (2013) 21-well dataset, were translated into the Python power and redundancy modules in this package.

License

Apache-2.0. The optional statcheck dependency is GPL-3.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bullshit_detector-0.2.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bullshit_detector-0.2.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file bullshit_detector-0.2.0.tar.gz.

File metadata

  • Download URL: bullshit_detector-0.2.0.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bullshit_detector-0.2.0.tar.gz
Algorithm Hash digest
SHA256 98c74cee04a8d8fe7dc4fbf1a408bd2bc09dc80c5f4b35c568e49b78131dc7a4
MD5 42efd428b79f0f89c2fd38f5de7bcf58
BLAKE2b-256 58e3343ffdf2b41a8b89c04879e52621557b3f2a43b018dcdc2758b556619060

See more details on using hashes here.

File details

Details for the file bullshit_detector-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bullshit_detector-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 282def870c03d475690667e6b39a8f62d9e68c5ee5b28fa8741dacfa91b5d818
MD5 175779e7945d3a354c3aa8a82ce1abe2
BLAKE2b-256 369422e96b3b53d9d02b2c53eb8cebea255df949385e677ccdd077e8a534cc41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page