A Free Python Package That Picks Your Statistical Test And Shows Its Work

Leader 2 8 107
calendar_today agoschedule2 min read

Most of us end up writing analysis code over someone else's data at some point, and the statistics are where a developer is most likely to be quietly wrong. This is a small package that makes the correct choice for you and, more usefully, prints the reasoning so you can check it before anyone else does.

Why The Wrong Test Is Easy To Ship

A t-test on badly skewed data returns a p-value. So does an ANOVA with wildly unequal variances, and a chi-square with expected counts too small to trust. None of them raise. They return a float in the same format as a correct result, which is what makes this different from an ordinary bug. Nothing in the output tells you the assumptions it rests on were never checked.

Install And First Run

statsage is a free Python package. You give it a table and the columns you want to compare, and it does the rest: checks the assumptions, picks the correct statistical test, runs it with effect sizes and confidence intervals, draws a publication quality figure, and writes the methods paragraph and results sentence. It has a Python API and a command line entry point, so it drops into a notebook or a script either way.

It runs completely offline. No account, no API key, nothing phoning home, and it is MIT licensed on GitHub.

What It Covers

The usual comparisons are all there: independent samples t-test and Mann-Whitney U, paired t-test and Wilcoxon signed rank, one-way ANOVA and Kruskal-Wallis, chi-square and Fisher's exact test. Which one you get is decided by the assumption checks rather than by whichever function you happened to remember.

Why The Decision Path Matters

This is the part worth the install. Every report includes the reasoning in plain language, like normality failed in group B and n is under 30, so Mann-Whitney U was chosen. You get the answer and the justification together.

That matters for two reasons. You learn the rule while you use it, instead of outsourcing it permanently. And when a reviewer or a colleague asks why that test, you have a real answer sitting in the output rather than a shrug.

The Order Is The Whole Trick

Describe the data, check the assumptions, then choose the test. Most bad statistics in shipped analysis come from reversing those last two steps, and picking the test first is exactly the habit a tool like this breaks.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

Dashboard Operasional Armada Rental Mobil dengan Python + FastAPI

Masbadar - Mar 12

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

Attention-Free Score: How Domain Reports Show Which Pages Need Work

ApogeeWatcherverified - Sep 1

I Wrote a Script to Fix Audible's Unreadable PDF Filenames

snapsynapseverified - Apr 20

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelski - Mar 19
chevron_left
4k Points117 Badges
United Statest.co/5LlztlB5C5
97Posts
17Comments
18Connections
Our AI Apps are a self expanding AI SaaS ecosystem used to create the custom web application of your... Show more

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!