feat(stats): reviewer-proof correlation helpers + prisma correlate#2
Open
javiercuervo wants to merge 1 commit into
Open
feat(stats): reviewer-proof correlation helpers + prisma correlate#2javiercuervo wants to merge 1 commit into
javiercuervo wants to merge 1 commit into
Conversation
Add prisma.stats: fisher_ci, correlation_table (Pearson + Fisher-z CI + Spearman, overall and per stratum), partial_correlation, bootstrap_ci, missingness_compare (Mann-Whitney selection check), and mixed_model_icc (random-intercept clustering + ICC). New 'prisma correlate' CLI command. scipy becomes a core dependency; statsmodels is an optional [stats] extra. Extracted while hardening the statistical rigour of the 20-60-20 AI-permitted-assessment study (Cuervo, 2026, Universidade de Aveiro). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new
prisma.statssubpackage and aprisma correlateCLI command: correlation and robustness statistics designed so every estimate ships with what a sceptical reviewer asks for.fisher_ci(r, n)— Fisher z-transform 95% CI for a Pearson r.correlation_table(df, x, y, group=None)— Pearson r + Fisher-z CI and Spearman ρ, with n, overall and per stratum (the Pearson/Spearman gap flags outlier-driven associations).partial_correlation(df, x, y, covar)— first-order partial r(x,y|covar) (controls for confounders such as general ability).bootstrap_ci(df, x, y)— percentile bootstrap CI for small/fragile cells.missingness_compare(df, indicator, by)— selection-bias check (Mann-Whitney) between present vs missing rows.mixed_model_icc(df, outcome, predictor, group)— random-intercept model + ICC for clustered data (students nested in cohorts/courses); optionalstatsmodels.Why
Extracted while hardening the statistical rigour of the 20-60-20 AI-permitted-assessment study (Cuervo, 2026, Universidade de Aveiro) against an adversarial three-reviewer panel: within-stratum reporting, rank robustness, partial correlation for mechanical/ability overlap, bootstrap for small cells, missingness and clustering. Reusable for any education/SLR dataset.
Notes
scipyas a core dependency;statsmodelsis an optional[stats]extra (onlymixed_model_iccneeds it).prisma correlate --in data.csv --x A --y B [--group G] [--partial Z] [--bootstrap] [--out table.csv].tests/test_stats.py(5 cases); full suite passes (16/16). CHANGELOG updated.🤖 Generated with Claude Code