statsage
The AI statistician. Give it a table and the columns to compare, it 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 you can paste into a manuscript.
It works completely offline with no account and no key. If you have the Claude or Codex CLI installed, or an Anthropic or OpenAI compatible API key, statsage uses your own model to polish the written narrative, and never lets it change a number.
Why
Picking the wrong test is one of the most common statistical mistakes in published research. statsage makes the safe choice automatically and, more importantly, shows its reasoning: every report includes the decision path, like "normality failed in group B and n is under 30, so Mann-Whitney U was chosen". You learn the statistics while getting the answer.
Install
pip install statsage
Excel input support: pip install statsage[excel]
Use from Python
import pandas as pd
import statsage
df = pd.read_csv("growth.csv")
result = statsage.analyze(df, outcome="od600", group="strain")
print(result.test_name, result.p, result.significant)
print(result.results_text)
result.save_report("report.html")
Paired designs and correlation:
statsage.analyze(df, outcome="score", group="timepoint", paired="subject")
statsage.analyze(df, x="dose", y="response")
Use from the command line
statsage growth.csv --outcome od600 --group strain
statsage growth.csv --outcome score --group timepoint --paired subject
statsage growth.csv --x dose --y response --out report.html
The report prints to the terminal as markdown and saves as a self-contained HTML file with the figure embedded, ready to share.
What it covers
- Two groups: Welch's t-test (the default, it does not assume equal variances), Student's t-test, Mann-Whitney U
- Paired designs: paired t-test, Wilcoxon signed-rank
- Three or more groups: one-way ANOVA with Tukey HSD, Welch's ANOVA with Games-Howell, Kruskal-Wallis with Dunn's test (Holm adjusted)
- Categorical data: chi-square, Fisher's exact test
- Correlation: Pearson, Spearman
- Assumption checks: Shapiro-Wilk or D'Agostino normality, Levene's test for variances, sample size rules, IQR outlier flags, expected cell counts
- Effect sizes with plain-language interpretation: Hedges' g, Cohen's dz, rank-biserial r, eta squared, epsilon squared, Cramer's V
Every report shows descriptives, each assumption check with its verdict, the reasoning path that led to the chosen test, post-hoc comparisons when relevant, warnings when something deserves a second look, and copy-paste methods and results text.
Bring your own model (optional)
statsage looks for a language model in this order and uses the first one it finds:
claudeCLI (an active Claude Code login)codexCLIANTHROPIC_API_KEYOPENAI_API_KEY(setOPENAI_BASE_URLfor any OpenAI compatible server)
Control it with --llm off, --llm claude, or the STATSAGE_LLM environment variable. The model only rewords the narrative text. If its rewrite drops or changes any number, statsage keeps the template text instead.
Figures
Box plots with individual points for group comparisons, paired line plots for repeated measures, grouped bars for counts, scatter with a fit line for correlation. Colorblind-safe Okabe-Ito palette, 300 dpi, exported inside the HTML report or separately with --figure out.png.
Author
Built by Paul Crinigan, AI Apps API. Part of the free science tools collection at learnhowtoscience.com.
MIT licensed.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file statsage-0.1.0.tar.gz.
File metadata
- Download URL: statsage-0.1.0.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b5f6b60206fd8d07a31cd663c51aad8354bd6c27d69f6522c3ec07faeecc8d1
|
|
| MD5 |
a328f34ff95aef085086d4e5c12bbc25
|
|
| BLAKE2b-256 |
6d0a3492c4f5b18f3812ed57a8676ba3531083c317c44d7e1ca55daf0adf83b9
|
File details
Details for the file statsage-0.1.0-py3-none-any.whl.
File metadata
- Download URL: statsage-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33303da8a24cb809d704c1a1589373380592fd7ca591a43541e21069db21f375
|
|
| MD5 |
6b0bc437b123279a7e3203bb880d35d6
|
|
| BLAKE2b-256 |
7c833c87001ab50a6eb1efd1410dd2a8ec335f6bfb4802e7c0531c41491b60eb
|