Tests As Linear
Python port of "Common statistical tests are linear models" by Jonas Kristoffer Lindeløv.
Install / Use
npx skills add eigenfoo/tests-as-linearInstalls into whichever agent you are using.
README
Common statistical tests are linear models: Python port
A Python port of Jonas Kristoffer Lindeløv's post Common statistical tests are linear models (or: how to teach stats), which originally had accompanying code in R.
Notes on Python port
The original post used R's built-in functions to verify that the linear models
were indeed equivalent to the statistical tests (by showing that the p-values,
t-values, and other such statistics, were the same in either case). In this
Python port, we instead verify that scipy.stats functions and smf.ols output
agree.
The original R post had four appendices, each of which demonstrated (through numerical simulation) that a common statistical test was well-approximated by a linear model. These simulations have not been ported to Python (yet!). This is an outstanding issue. In the meantime, please refer to the original appendices upstream for the simulations.
Finally, certain statistical functions and tests are supported by neither
statsmodels or scipy, the two statistical Python libraries used in this
port. R code with no simple Python equivalent (mainly in sections 6 and 7,
"Three or more means" and "Proportions: Chi-square is a log-linear model") has
not been ported. Such code has been noted in yellow warning boxes.
Contributing
Please refer to the contributing guide for project structure information and development instructions.
License
This work is licensed under a Creative Commons Attribution 4.0 International
License. Please refer to
LICENSE.txt
for more details.
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
python-debugpy
385.5kDebug Python with pdb, breakpoint(), post-mortem inspection, and debugpy remote attach.
skill-creator
385.5kCreate, edit, audit, tidy, validate, or restructure AgentSkills and SKILL.md files.
claude-opus-4-5-migration
140.7kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
