The Fault in our Stats
Alexi Turcotte, Neev Nirav Mehta
Abstract
Data analysts need to be careful when they apply statistical inference techniques to data, as misuse of statistical inference methods can lead an analyst to draw the wrong conclusions. They need to be careful because, in the general case, misuse of statistics does not result in obvious problems; the numbers returned often look reasonable, and programs with misuses of statistics do not crash. In this work, we propose a technique to quickly and statically check data science programs for compliance with statistics best practice rules, including checking all assumptions made by statistical methods, as well as correcting for the multiple comparison problem, or "data dredging". This technique is predicated on a novel statistics intermediate representation, called SIR, that encodes the details most salient to statistics. We implement this technique in a tool called stat-lint, the first statistics linter, and evaluate stat-lint on 90 Python data science notebooks, finding that only 14 fully check all obligations, only two apply any correction for multiple comparisons, none validate model residuals, and over two thirds of obligations go unchecked.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Related papers
- Expressing and Checking Statistical AssumptionsAlexi Turcotte, Zheyuan WuFSE 2025 · 1 citation
- DyLin: A Dynamic Linter for PythonAryaz Eghbali, Felix Burk, Michael PradelFSE 2025 · 1 citation
- Statistical Test for Feature Selection Pipelines by Selective InferenceTomohiro Shiraishi, Tatsuya Matsukawa, Shuichi Nishino, Ichiro TakeuchiICML 2025
- Data Leakage in Notebooks: Static Detection and Better ProcessesChenyang Yang, Rachel A. Brower-Sinning, Grace A. Lewis, Christian KästnerASE 2022 · 25 citations
- Towards Understanding Fine-Grained Programming Mistakes and Fixing Patterns in Data ScienceWei-Hao Chen, Jia Lin Cheoh, Manthan Keim, Sabine Brunswicker et al.FSE 2025 · 1 citation
