Skip to content
How every number is checked

Validation report

Statistics validation report

Every statistical analysis, checked against a reference that does not share its code: certified data, published worked examples and independent software.

checks, every one passing
4,514
validation cases
235
areas of statistics
59

Checked against

  • Certified data

    NIST Statistical Reference Datasets with certified values.

  • Published examples

    Textbooks, original papers and R's documented examples.

  • Independent software

    SciPy, statsmodels and lifelines, or an independent algorithm.

  • Closed forms

    Values known exactly, such as identities and definitions.

  • Simulation

    Interval coverage and error rates over seeded data sets.

The full report

Open any section. Your browser's find opens the one that matches.

Kinds of reference

kindwhat it istypical tolerance
NISTCertified values from the NIST Statistical Reference Datasets (StRD): univariate summary statistics, one-way ANOVA, linear least squares. Fixtures in tests/fixtures/nist/, with source URLs and SHA-256 hashes in manifest.json.log relative error (LRE, the number of correct significant digits) above a threshold set by the dataset's difficulty
publishedA worked example with a published answer: textbooks, original papers, and the documented example output of R functions.half a unit in the last printed digit (for example 5e-5 for a value printed with 4 decimals)
cross-checkAn independent implementation: SciPy, statsmodels or lifelines, or an independent formula or algorithm written in the test file (Newton–Raphson for logistic regression, brute-force enumeration of exact null distributions, Box's epsilon formula, the Sun–Xu DeLong algorithm, exact rational arithmetic).1e-10 to 1e-12 relative for closed forms; 1e-4 to 1e-8 for iteratively fitted models; Monte Carlo error for randomized references
analyticA value known in closed form (trapezoid areas, quantile definitions, identities such as Tukey with 2 groups = Student's t test).exact or 1e-12
simulationCoverage of 95% confidence intervals and type I / family-wise error rates over 1,000–2,000 seeded data sets.3 binomial standard errors (plus 0.001)

LRE = −log10(|ours − certified| / |certified|), capped at 15. Double precision carries about 15–16 digits.

All randomness in the package and in the tests is seeded, so results are reproducible bit for bit.

Coverage map

AnalysisReferences
Descriptive statisticsdescriptiveseveral columns · describe_columnsNIST univariate (9 datasets); Hyndman & Fan quantile definitions; closed forms for geometric/harmonic mean and the order-statistic CI of the median; Joanes & Gill skewness/kurtosis formulas
Normality testsnormalityShapiro & Wilk (1965) example; D'Agostino–Pearson implemented from the published formulas and cross-checked with SciPy; Lilliefors D vs statsmodels and P vs Monte Carlo
Normality tests on differences and columnsNormality of paired differences · normality_differencesNormality tests (several columns) · normality_columnsIdentical (bit for bit) to normality on first − second and on each column
Fraction of total (parts of whole)fraction_of_totalExact fractions; Wilson and Clopper–Pearson intervals vs statsmodels proportion_confint
t testsUnpaired t test (Student or Welch) · t_test_unpairedPaired t test · t_test_pairedOne-sample t test · t_test_one_sampleStudent's sleep data (R t.test output: Student, Welch, paired); SciPy; noncentral-t CI by its defining equations; coverage simulations
t tests from summary dataUnpaired t test from mean, SD and n · t_test_summaryPaired t test from the mean, SD and n of the differences · t_test_paired_summaryThe raw-data t tests (Student, Welch, paired, one-sample, one-sided) fed their own mean, SD or SEM and n; SciPy ttest_ind_from_stats; R t.test on the sleep data
One-way ANOVA from mean, SD and none_way_anova_summaryR's PlantGrowth: anova(lm()) F and P and TukeyHSD differences, limits and adjusted P; the raw-data one_way_anova (Welch, Brown–Forsythe, Dunnett, Games–Howell); SciPy bartlett
Nested t test and one-way ANOVAt test · nested_t_testone-way ANOVA · nested_one_way_anovastatsmodels MixedLM (REML) on unbalanced data; the REML likelihood and GLS standard errors computed with dense matrices; balanced designs: the classical nested ANOVA, Student's t test and Tukey on subject means, statsmodels anova_lm for subjects within groups
One-way ANOVAone_way_anovaNIST ANOVA (11 datasets, all difficulties); statsmodels anova_oneway (Welch, Brown–Forsythe); error-rate simulation
Non-compartmental pharmacokinetics (NCA)pk_ncaR's PKNCA 0.12.1 on the 12 Theoph subjects and six constructed profiles (BLQ, short terminal phase, early stop, rising end, noisy terminal phase, no dose-time sample): every parameter to 1e-12 (min 14.6 digits); group summaries vs PKNCA::geomean/geocv and base R
ANCOVA: groups adjusted for a baseline (adjusted means)ancovaR 4.5.3 lm + emmeans 2.0.5 / car / sandwich / mvtnorm on MASS::anorexia (also HC3), MASS::cats, ChickWeight, carData::Baumann (2 covariates), MASS::birthwt (a factor): 473 checks to 1e-12 (Dunnett: exact multivariate t, 2.4e-5); repeated and clustered: mmrm 0.3.19 (fev_data ×2, ChickWeight) and lmer + emmeans (mlmRev::Exam, nlme::BodyWeight), 411 checks; planted-truth simulations
Tumour growth efficacy studytumour_growthR 4.5.3 on 8 public studies (TumGrowth TestLong, KOLB2008, TestOS; Xeva repdx P1–P5) and 849 PDXE curves (Gao et al. 2015): growth rates (lm), Welch (t.test), Fieller ratios (mratios::ttestratio), the log-volume mixed model (lmerTest, bobyqa as the engine), Gompertz (minpack.lm::nlsLM), log-rank (survival), mRECIST (Xeva's rule); 3,806 values, closed forms to 2e-13
Power and sample size: tumour-growth study by simulationpower_tumour_growthAn independent R simulation of the same model (20,000 studies × 4 settings, within 4 Monte Carlo SE); without removals, Student's noncentral t
Relative potency of dose-response curves (parallel-curve and parallel-line assays)relative_potencyR 4.5.3, drc 4.0.0 and minpack.lm on drc's S.alba (4PL and 3PL), spinach and G.aparine, and a parallel-line assay on spinach (lm + Fieller): ratio, delta and Fieller CIs vs drc EDcomp to 1e-4 (observed-Hessian covariance, the served default); log potency, SE and CI vs nlsLM (Gauss–Newton option) to 1e-6; parallelism F vs drc anova; equivalence CIs vs nlsLM; planted truth
Two-way and factorial ANOVATwo-way ANOVA · two_way_anovaFactorial (two- or three-way) ANOVA · factorial_anovaMontgomery's battery-life example; statsmodels anova_lm Type I/II/III on unbalanced 3×2 and 2×2×2 designs
Aligned rank transform ANOVA for factorial designsart_anovaR 4.5.3, ARTool 0.11.2 (car 3.1.5, emmeans 2.0.4, lme4 2.0.6, pbkrtest 0.5.5) on Higgins1990Table1, InteractionTestData, ToothGrowth, warpbreaks, ElkinABC (between; also unbalanced), Higgins1990Table5, HigginsABC, ElkinAB, ElkinABC (lmer, Kenward–Roger; Error() strata): F, df, P of every effect, ART-C contrasts with seven adjustments, the alignment check, the aligned responses and ranks; planted truth
Multiple comparisons after factorial ANOVAfactorial_comparisonsMarginal-mean contrast, SE and P vs statsmodels t_test on a cell-means model
Multiple comparisonsMultiple comparisons of group means · multiple_comparisonsAdjust a family of P values · adjust_p_valuesStudentized range vs Tukey/Harter tables and SciPy; Tukey vs SciPy tukey_hsd and statsmodels; Dunnett vs Dunnett's tables and SciPy dunnett; all P-value adjustments vs statsmodels multipletests; Benjamini & Hochberg (1995) example; identities for 2 groups; family-wise error simulations; R pairwise.t.test (Holm, Bonferroni); NIST/SEMATECH e-Handbook Tukey and unadjusted limits; rstatix Games–Howell; DescTools and multcomp Dunnett (two- and one-sided)
Repeated-measures ANOVARepeated-measures one-way ANOVA · repeated_measures_anovawithin and between factors · rm_anovaR mauchly.test/SSD example (Baron & Li data); R anova.mlm two-within and split-plot tables with Greenhouse–Geisser and Huynh–Feldt; Datanovia's rstatix worked example; statsmodels AnovaRM; Box's epsilon formula; hand formulas for the split-plot design; separate-error comparisons = paired t tests
Mixed-effects model for repeated measuresmixed_effects_anovanlme's published fits (Pinheiro & Bates 2000: ergoStool, Machines, PBIB); an independent REML/ML fit; ANOVA estimators for balanced data; equality with RM ANOVA for complete balanced data; statsmodels MixedLM formula interface with missing values
Nonparametric testsMann–Whitney test · mann_whitneyWilcoxon signed-rank test · wilcoxon_signed_rankKruskal–Wallis test with Dunn's comparisons · kruskal_wallisFriedman test · friedmanR documentation examples (Hollander & Wolfe data); SciPy (with ties); brute-force exact null distributions; Hodges–Lehmann definitions; Dunn z² = Kruskal–Wallis H for 2 groups; coverage simulations
CorrelationPearson, Spearman, Kendall · correlationmatrix · correlation_matrixR cor.test example (Pearson, Kendall, exact Spearman); SciPy; coverage simulation
Contingency tablesChi-square test of independence · chi_squareFisher's exact test · fisher_exactRelative risk, odds ratio and risk difference · two_by_twoMcNemar's test · mcnemarChi-square goodness of fit · chi_square_goodness_of_fitSensitivity, specificity, predictive values · diagnostic_accuracyR chisq.test, fisher.test, mcnemar.test, binom.test and prop.test examples (including a 4×4 Freeman–Halton test); SAS PROC FREQ examples 40.4 and 40.5; NIST/SEMATECH e-Handbook examples; Agresti's Physicians' Health Study; Koopman (1984); Newcombe (1998); SciPy; statsmodels Table2x2 and mcnemar; closed forms
Survival analysisKaplan–Meier survival curves · kaplan_meierCompare survival curves (log-rank, Gehan–Breslow–Wilcoxon) · compare_survivalCox proportional-hazards regression · cox_regressionFreireich 6-MP data (Kleinbaum & Klein tables, R survfit, survdiff, coxph); R survival 3.8-13 test and example output on aml, ovarian, lung and veteran; Therneau & Grambsch (2000) closed forms for tied deaths; lifelines; statsmodels survdiff; coverage simulation; the stratified Cox model (strata) vs R coxph(... + strata()) on lung, veteran (two stratum columns), pbc, rats (50 strata; cluster), colon and bladder (cluster): 338 values, coefficients to 1.1e-8, concordance and pair counts exact, cox.zph to 3e-9; planted truth (section below)
Restricted mean survival time and survival at chosen timesrmstR survRM2 1.0-4 rmst2 (RMST, SE, CI; difference and ratio with CI and P; its τ rule and default τ) and R survival 3.8-12 (survfit restricted mean; Kaplan–Meier survival, Greenwood SE and log-log CI at chosen times; the survival difference from those SEs) on survRM2's PBC example, veteran, lung, ovarian, aml, gehan, a seeded crossing-hazards table and a constructed table; the uncensored closed form (RMST = mean of min(T, τ), variance = population variance / n)
Diagnostics and agreementROC curve and AUC · roc_curveBland–Altman agreement · bland_altmanHanley & McNeil (1982); pROC 1.19.1 (AUC, DeLong variance and CI, every curve point); Bland & Altman (1986), including the CI of the bias; Mann–Whitney identity; Sun & Xu DeLong algorithm; coverage simulation
Intraclass correlation (ICC) for agreement of raters or methodsiccR 4.5.3, irr 0.85 (icc, ρ0 = 0 and 0.3) and psych 2.6.9 (ICC, lmer FALSE and TRUE) on irr::anxiety, irr::video, the Shrout & Fleiss (1979) table and lme4::Penicillin, complete and with cells removed (REML in the pinned runtime vs psych's lme4 fit): 500 values, closed forms to 1.6e-12, REML to 1.9e-9; BlandAltmanLeh for the two-method link; planted truth with CI coverage
Fleiss' kappa for agreement of three or more ratersfleiss_kappairr::kappam.fleiss (z, P, per category, exact) and irrCAC 1.4 (fleiss.kappa.raw, conger.kappa.raw, three weights, missing ratings) on irr::diagnoses, irr::anxiety, irrCAC::cac.raw4raters, cac.raw5obser and cac.raw.gender: 236 values to 3.2e-14; planted κ = θ² with Gwet-CI coverage and the null test's size (section below)
Cohen's kappa from two raters' labels (unweighted or weighted)weighted_kappairr::kappa2 (z, P) and psych::cohen.kappa (variances, full scale) on irr::anxiety, irr::diagnoses, irr::vision and irrCAC::cac.ben.gerry: 68 values to 2.0e-14; the full-scale pitfall (a level no rater used) shown against irr; planted truth (section below)
Linear regressionSimple linear regression · linear_regressionSimple linear regression of many data sets · linear_regression_datasetsCompare slopes and intercepts · compare_regressionsMultiple linear regression · multiple_linear_regressionNIST linear least squares (11 datasets including Longley, Filip, Wampler 1–5); statsmodels OLS (bands, nested F tests, Breusch–Pagan, VIF); SciPy linregress
Logistic and Poisson regressionLogistic regression · logistic_regressionPoisson regression · poisson_regressionChallenger O-ring data (Dalal et al. 1989); Dobson's Poisson example (R glm); independent Newton–Raphson; statsmodels discrete Poisson model
Principal component analysispcaEigen-decomposition of the correlation matrix; statsmodels PCA
Area under the curvearea_under_curveClosed-form areas; Monte Carlo SE
Outlier testsGrubbs' outlier test · grubbsROUT outlier detection · routNIST/SEMATECH e-Handbook Grubbs example; Motulsky & Brown (2006) Table 1; false-positive simulation
Power and sample sizet tests · power_t_testone-way ANOVA · power_anovatwo proportions · power_proportionsR power.t.test, power.anova.test, power.prop.test examples; the pwr 1.3-0 vignette; Cohen (1988); statsmodels power classes; Fleiss closed form
Relative expression from qPCR (ΔΔCt)delta_delta_ctThe independent Python reference in packages/integrations-py; SciPy ttest_ind and t.interval for the group statistics
P value from a test statisticp_valueClosed forms (t with 1 and 2 df, chi-square with 1 and 2 df, F(2, d2), the normal tail); critical values printed by R; quadrature of the densities, including fractional df
Which test? (recommendation)recommend_testScenario tests: 50 layouts with the expected recommendation

Assumption checks are tested separately: each check is made to fire on constructed data that violate the assumption (skewed data, unequal variances, non-sphericity, small expected counts, crossing survival curves, overdispersion, perfect separation, proportional bias, curvature, collinearity, heteroscedasticity, influential points, masking outliers) and to stay quiet on data that satisfy it.

Differences from other software, explained

  1. Mauchly's test P (Baron & Li data). R reports 0.04765; we report 0.04758. Both use Anderson's chi-square approximation with a second-order correction. R's code uses the number of original variables (6) in one term of the correction where the dimension of the contrasts (5) belongs; we use 5 throughout. With R's term we get 0.047652. W, the epsilons and all F tests agree with R exactly.

  2. Exact CI of the conditional odds ratio (tea tasting). R reports an upper limit of 621.93; ours is 626.24. At 626.24 the defining tail probability is exactly 0.025 (checked in the tests); at 621.93 it is 0.02517. R's value reflects its root-finding tolerance.

  3. NIST SmLs07–09 and NumAcc3/4. These datasets have 7–13 constant leading digits (for example 1000000000000.4). Their decimal values cannot be stored exactly in binary floating point, so any computation on double-precision input (which is what a JSON API receives) is limited to about 4 correct digits for SmLs07–09 and 8–9 for NumAcc3/4. The tests also compute the exact answer for the binary-rounded inputs with rational arithmetic: our results match it to 12–15 digits, so the algorithm itself loses nothing.

  4. NIST Filip, Wampler4 and Wampler5. These are deliberately ill-conditioned polynomial fits (Filip is degree 10). Column-scaled pivoted QR in double precision gives 7.6 (Filip), 8.8 (Wampler4) and 6.8 (Wampler5) correct digits for the coefficients; their standard deviations, the residual SD and R² have more. Many statistical packages fail Filip entirely.

  5. Power calculations. R's power.t.test counts only one tail of the two-sided rejection region by default (strict = FALSE); we count both. R's power.anova.test and power.prop.test stop their root search at a tolerance of about 1e-4. Both effects change only the 5th–7th digit.

  6. Lilliefors P values come from the Dallal–Wilkinson approximation (P < 0.1) or interpolation in a simulated table (statsmodels). Against a 40,000-sample Monte Carlo null distribution they are accurate to about 0.003 near P = 0.05 and about 0.015 near P = 0.2. Shapiro–Wilk is the recommended normality test.

  7. Spearman P values are exact (complete enumeration) for n ≤ 9 without ties, and use the t approximation otherwise. R uses an Edgeworth-series algorithm (AS 89) for 10 ≤ n < 1290, so P values can differ slightly in that range.

  8. Kaplan–Meier intervals default to the log-log transformation (as lifelines); R's survfit defaults to the log transformation. Both are available (ci_method), and both are tested.

  9. Mixed-effects F tests are Wald tests with between–within denominator degrees of freedom (not Kenward–Roger or Satterthwaite). With complete balanced data they reproduce repeated-measures ANOVA exactly.

  10. ROUT. The robust SD of the residuals is P68 × N/(N − K) with P68 the linearly interpolated 68.27th percentile of the absolute residuals. This is the form that reproduces every t ratio in Table 1 of Motulsky & Brown (2006); text extractions of that paper's Equation 1 are ambiguous about a square root.

  11. Nested designs. The group comparison uses the REML estimates, the generalised least-squares covariance (X'V⁻¹X)⁻¹ (as R's nlme and lme4 report it) and the containment df (subjects − groups). statsmodels' MixedLM reports standard errors from the Hessian of all parameters, which differ by about 1% on small data sets; the group means and variance components agree with it to its optimiser tolerance, and our REML likelihood is at least as high as its maximum.

  12. qPCR group statistics are computed on the samples' log2 relative quantities (−ΔΔCt for Livak) with an unpaired t test against the calibrator group (Welch by default), and back-transformed. Efficiencies are taken as exact: their uncertainty is not in the intervals.

  13. Summary-data tests cannot test normality, and their equal-variance checks use the F test of two variances or Bartlett's test (which need only the SDs) instead of Brown–Forsythe (which needs the values).

  14. Test of proportional hazards (cox_regression): the score test of R survival ≥ 3.0's cox.zph, one test per coefficient (terms = FALSE), time transform rank (R's default is km). It replaced the Grambsch–Therneau (1994) averaged-information approximation that lifelines and survival < 3.0 use, which differs by up to 3.7 in χ² on R's veteran data (age: P = 0.019 against 0.18). Matches R to 8–15 digits, Efron and Breslow ties (27 Oct 2026).

  15. Hosmer–Lemeshow groups are 10 groups of near-equal size by sorted fitted probability (ties keep row order). ResourceSelection's hoslem.test cuts at deciles instead; the two agree when n is a multiple of 10 without tied probabilities, and both are checked.

  16. Spearman and Kendall CIs use Fisher's z with a jackknife SE (default since 27 Oct 2026; rank_ci = "normal" keeps the Bonett–Wright and Fieller–Hartley–Pearson SEs). The normal-theory SEs hold only for monotone transforms of bivariate normal data and covered 88–94% under t and Clayton copulas.

  17. Bland–Altman limit CIs are exact noncentral-t intervals (Carkeet 2015; default since 27 Oct 2026; loa_ci = "approximate" gives Bland & Altman's 1999 SE, which covered 92–93.6% for n = 5–20).

  18. Cohen's d in Welch's t test is standardized by the average SD √((s1² + s2²)/2) with Bonett's (2008) CI (since 27 Oct 2026); with equal n it equals the pooled-SD d. The pooled-SD noncentral-t interval it replaced covered 71–100% with unequal n and SDs. Student's test keeps the pooled-SD d and its noncentral-t CI.

Not yet validated externally

  • The Bland & Altman (1986) paper's approximate limit-of-agreement intervals differ from ours (exact noncentral t) and are documented, not checked (section Validation suite).
  • Tukey and Dunnett comparisons after a nested ANOVA with unequal numbers of subjects or replicates use the model's unequal standard errors in the Tukey–Kramer and Dunnett formulas, which are then approximations (exact for balanced data, where they equal the analysis of the subject means).

Closed on 27 Oct 2026 (docs/VALIDATION.md, Part C): Hosmer–Lemeshow against ResourceSelection and an equal-count implementation in R; the test of proportional hazards against R survival's cox.zph; parallel analysis against paran (the same random matrices, 15 digits) and psych; coverage of the Spearman, Kendall, Bland–Altman and Welch-test Cohen's d intervals over 10,000 seeded data sets per condition. Known limits from those runs: Bland–Altman limits assume normal differences (83–99% coverage for t, skewed and uniform differences; the analysis checks the differences' normality); the jackknife rank-correlation intervals are conservative at n ≤ 20 (up to 98.5% for Kendall) and cover 93.3–93.6% under a heavy-tailed (t, 3 df) copula with r = 0.9 at n ≥ 50; Cohen's d in Welch tests covers 96–97% with 5 per group.

Published references and R output

The validation suite compares the package with the printed output of R and its packages (stats, survival, nlme, pwr, pROC, rstatix, DescTools, multcomp), SAS PROC FREQ, the NIST/SEMATECH e-Handbook and published papers. Data come from the cited sources, and the reference values are stored as the text the source printed.

  • Printed references are matched to half a unit of their last printed digit, the most a printed number can say. Counts and degrees of freedom are matched exactly.
  • Iterative references (R's uniroot, mvtnorm's quasi-Monte Carlo integration) get their own documented tolerance, and a second check confirms that our value solves the defining equation.
  • Independent implementations and closed forms written in the test files are matched to 1e-5 to 1e-12 relative, as stated per case.

Each check reports the digits of agreement, −log10(|ours − reference| / |reference|), capped at 15. A printed reference agrees only to the digits it prints, so the minimum digits of a case are low by construction; the pass rule is the tolerance, not the digits. Minimum digits are given as the run's summary stores them, rounded half up to one decimal. The table of every case, generated by the runner, closes this section.

Mixed-effects models

References.

  • Closed forms, and an independent REML and ML fit written in the test file (dense V = σ²(I + γZZ'), Brent's method).

What is checked. mixed_effects_anova fits a random intercept per subject, sum-to-zero fixed effects and Wald F tests with between–within denominator df. For these designs that is nlme's lme(y ~ factor, random = ~ 1 | subject).

casedatacheckedchecksmin digits
mixed_nlme_ergostoolergoStool, 9 subjects × 4 stool types (§1.2)SD of subject and residual; F and df; REML log-likelihood in Helmert and treatment coding; 4 cell means and their SE15/153.7
mixed_nlme_machinesMachines, 6 workers × 3 machines × 3 replicates (§1.3)SDs; intercept and treatment-coded effects; REML log-likelihood6/64.8
mixed_nlme_pbibSASmixed PBIB, 15 treatments in 15 blocks of 4 (§2.4)REML Wald F, P and df; ML log-likelihood5/53.1
mixed_reml_independentMachines and PBIBMachines variance components vs the ANOVA estimators; PBIB REML and ML variance components, Wald F and ML log-likelihood vs the independent fit9/910.0

Tolerances. nlme's values: half a unit of the last printed digit; df exact. Machines is balanced, so REML equals σ²_e = MS_error and σ²_worker = (MS_worker − MS_error)/9 exactly: rel ≤ 1e-7. PBIB against the independent fit: rel ≤ 1e-5 for the variance components and Wald F, rel ≤ 1e-9 for the ML log-likelihood.

Result. 35 of 35 checks pass. Against nlme the fewest digits are 3.1, on the PBIB F that nlme prints as 1.53 (ours 1.5312). Against the independent fit every quantity agrees to at least 10.0 digits.

Findings.

  • The REML log-likelihood contains −½·log|X'V⁻¹X|, so it depends on the coding of the fixed effects: with X_ours = X_R·T it differs by exactly log|det T|, which for ergoStool is log 24 against nlme's Helmert coding and log 4 against its treatment coding. The checks compute T from the design matrices; ML does not depend on coding.
  • Pinheiro & Bates's preferred Machines model adds a Worker:Machine random effect (fm2Machine), which a single random intercept cannot express, so fm1Machine is the model compared.
Repeated-measures ANOVA

References.

What is checked. rm_anova and repeated_measures_anova. The legacy suite already checks the one-factor F, the epsilons and Mauchly's W on reacttime (rm_anova_baron_li); these cases add the factorial and split-plot tables.

casedatacheckedchecksmin digits
rm_anova_reacttime_two_withinreacttime, deg (3) × noise (2) within subjectsF, df and P for deg, noise and deg × noise; Greenhouse–Geisser ε and P; Huynh–Feldt P; Mauchly's W and P for deg17/174.4
rm_anova_reacttime_split_plotreacttime, 6 conditions within × 2 groups between (subjects 1, 3, 5, 7, 9 vs 2, 4, 6, 8, 10)pooled Greenhouse–Geisser and Huynh–Feldt ε; F, df, P and both corrected P for condition and condition × group; error df12/123.9
rm_anova_selfesteem_datanoviaselfesteem, 10 subjects × 3 timesF, df, P; Mauchly's W and P; both ε with corrected df and P; means and SDs; 3 paired t tests with separate error terms (t, df, P, Bonferroni P)31/312.5

Tolerances. Half a unit of the last printed digit; df exact. R prints the split-plot condition P values as 0.00000, so they are checked to ±5e-6.

Result. 60 of 60 checks pass. Against R the fewest digits are 3.9, on the condition × group F that R prints as 0.2743. The Datanovia page prints most values to 3 significant figures; its printed values agree to 2.5–6.3 digits, the lowest on the Bonferroni P for t1 vs t3, printed as 1.00e-6 (ours 1.0031e-6).

Findings.

  • R prints the Huynh–Feldt ε uncapped (1.2176 for deg, 1.118 for deg × noise) but computes its Huynh–Feldt P with ε truncated at 1. We report ε capped at 1, so these epsilons are compared through the P values.
  • rstatix also prints generalised η² (0.829). We report partial η², a different statistic, so it is not compared.
Post-hoc comparisons

References.

  • R Core Team, stats-Ex.Rout.save (as above): pairwise.t.test on airquality.
  • Signorell A et al., R package DescTools: reference documentation of DunnettTest, example output (Hollander & Wolfe 1973 p. 116 data;
  • Hothorn T, Bretz F, Westfall P, R package multcomp: documented example output (multcomp-Ex.Rout.save), recovery data (Westfall et al. 1999, p.

What is checked. multiple_comparisons, t_test_unpaired with adjust_p_values, and dunnett_critical.

casedatacheckedchecksmin digits
posthoc_pairwise_t_airqualityairquality Ozone by month (37 missing values dropped)adjusted P for all 10 pairs: pooled SD with Holm and with Bonferroni; Welch t tests with Holm30/301.6
posthoc_tukey_lsd_nist_handbooke-Handbook, 4 treatments × 5Tukey 95% limits for 6 pairs; unadjusted 95% limits for the first 3 treatments; pooled variances20/201.7
posthoc_games_howell_rstatixToothGrowth len by dose: all, OJ only, VC onlydifference, 95% limits and adjusted P for 3 pairs in each36/362.5
posthoc_dunnett_desctoolsHollander & Wolfe p. 116 (control 1); airquality, control May at 95% and control August at 90%difference, limits and adjusted P for 10 comparisons with the control40/400.7
posthoc_dunnett_one_sided_multcomprecovery, one-sided (less than control) at 90%Dunnett quantile; 3 estimates; 3 upper limits, each against two multcomp runs11/112.1

Tolerances. Printed values (R, e-Handbook, rstatix, and the DescTools and multcomp estimates): half a unit of the last printed digit; one Games–Howell P that rstatix prints as 0 is checked as ≤ 1e-9 (ours 1.3e-13); the e-Handbook's unadjusted intervals: 0.002 absolute (see Findings). DescTools and multcomp use mvtnorm's randomized quasi-Monte Carlo integration (absolute error about 1e-3 on P values, about 1e-4 relative on quantiles); ours is deterministic quadrature. DescTools interval ends therefore get 0.1% of the half-width (0.001–0.028) and its adjusted P 1e-3; the multcomp quantile gets 5e-4 and its upper limits 1e-3, against both runs.

Result. 137 of 137 checks pass. The low digit counts come from how the references print or integrate. R prints the airquality P values to 5 decimals: 1.6 digits on 0.00019 (ours 0.000195). The e-Handbook prints a Tukey limit as 0.13: 1.7 digits (ours 0.1326). DescTools prints the May–August adjusted P as 9.5e-05: 0.7 digits (ours 7.68e-05, a difference of 1.8e-5 against mvtnorm's 1e-3); with August as control it prints 6.7e-05 for the same pair, and ours is 7.68e-05 in both. multcomp's b3 − b0 upper limit lies near 0: 2.1 digits (ours −0.03597; runs −0.03624, −0.03594).

Findings.

  • The e-Handbook computes its unadjusted intervals from rounded intermediates (t = 2.179, SE = 0.763), which moves the third decimal by up to 0.0012.
  • multcomp printed the same one-sided quantile as 1.8428 and 1.8431 in two runs; ours is 1.843074.
  • rstatix reports group2 − group1 and we report group1 − group2, so signs and interval ends are swapped first.
Survival

References.

  • closed forms derived in the test.
casedatacheckedchecksmin digits
survival_aml_raml (Miller 1981), Maintained vs NonmaintainedKaplan–Meier (KM) rows at every death time (n at risk, events, S(t), SE, 95% CI); medians and CI limits; log-rank observed, expected, χ², df; Cox with Breslow and with Efron ties (coefficient, HR, SE, z, P, likelihood-ratio χ², df, P)120/1202.6
survival_logrank_empty_group_raml plus a third group of 7 early censoringslog-rank χ² and df; expected deaths in the third group3/33.0
survival_ovarian_km_rovarian (Edmonson et al. 1979), all and by treatmentKM rows; log-rank observed and expected; χ² against R's Cox score test with Breslow ties; P150/1502.8
survival_ovarian_cox_rovarian8 Cox models with 1–3 of age, resid.ds, rx, ecog.ps: coefficient rows and likelihood-ratio test104/1042.6
survival_lung_rlung (NCCTG, Loprinzi et al. 1994)KM n, events, median and its CI by ECOG score; Cox age + sex: coefficient rows, HR CIs, n, events, concordance, likelihood-ratio χ²37/373.2
survival_veteran_cox_rveteran (Kalbfleisch & Prentice 1980)Cox karno + age + trt: the karno coefficient, printed to 9 decimals1/18.3
survival_cox_ties_closed_formTherneau & Grambsch data set 1 (two deaths tied at time 6)Breslow and Efron β, SE, log partial likelihood and likelihood-ratio χ² vs closed forms; R's predict(..., se.fit) = 0.5·SE; R's printed Efron β11/116.5

Tolerances. R's printed values: half a unit of the last printed digit; counts, medians, median CI limits and df: exact; closed forms: rel ≤ 1e-9 (β, SE, log partial likelihood) and rel ≤ 1e-8 (likelihood-ratio χ²). Pinned to R: log KM intervals (ci_method="log"; our default is log-log), Efron ties unless the reference used Breslow, lung's status recoded from 1/2 to 0/1. R's exact partial likelihood (method = "exact") is not offered, so not compared.

Result. 426 of 426 checks pass. In the five R cases other than veteran, the fewest digits fall on a value R prints to 2 or 3 significant figures: an aml KM lower limit of 0.0153 (ours 0.015257, 2.55 digits), a log-rank χ² of 3.4, an ovarian KM limit of 0.326 and P values of 0.00116 and 0.00218. The veteran coefficient agrees to 8.3 digits, the closed forms to 15, and R's Efron β, rounded to 6 decimals, to 6.5.

Findings.

  • Bug found and fixed: compare_survival counted a group with no one at risk at any death in the degrees of freedom (df 2, P 0.183 instead of df 1, P 0.065; R prints 0.07). Groups with no expected deaths are now left out of the test and its df, as in R. R prints these P values to one significant digit, so the χ² and df are compared.
  • R reports the KM interval as NA where the curve drops to 0 (Greenwood's variance is undefined after the last subject at risk dies), so it gives no upper limit for the aml Nonmaintained median (23; 8 to NA). We report the band there as [0, 0], as lifelines does, which gives an upper limit of 45; that limit is not compared. For the single lung subject with ph.ecog = 3, R gives no CI and we give [118, 118]; only the median (118) is compared.
  • ovarian has no tied death times, so Breslow and Efron coincide.
Restricted mean survival time (v24)

References.

  • GPL-2: used only as an external reference from the R script, its computed numbers stored in the fixture. The package's RMST is written from the published definitions; survRM2's code was not read, copied or ported.
  • Therneau T, survival 3.8-12: summary(survfit(...), rmean = τ) and summary(survfit(..., conf.type = "log-log"), times = ...).
  • Definitions: Royston & Parmar (2013), BMC Med Res Methodol 13:152; Uno et al. (2014), J Clin Oncol 32:2380–2385; Klein & Moeschberger (2003), Survival Analysis, §4.5 (the variance); Klein, Logan, Harhoff & Andersen (2007), Stat Med 26:4505–4519 (survival at a fixed time).
casedatacheckedchecksmin digits
rmst_r_survrm2_realsurvRM2's PBC example (τ = 10, and the default τ), veteran trt (τ = 365, crossing curves; and the default τ = 999), lung sex (τ = 730; 90% level at τ = 365), ovarian rx (τ = 730), aml x and gehan treat (default τ)per group RMST, SE and CI; per contrast the RMST difference and ratio with CI and P; τ180/18013.5
rmst_r_survrm2_crossing_and_edgesthe seeded crossing-hazards table (τ = 20, and the default τ = 39.03); a constructed table with events at τ = 8 and a curve that reaches 0 at τas above60/6014.5
rmst_r_survrm2_four_groupsveteran celltype (4 groups, τ = 180)as above; 3 contrasts, each against squamous46/4614.1
rmst_r_survfit_rmeanall 13 data setsper group RMST and SE vs survival's rmean and se(rmean)56/5615.0
rmst_r_survival_at_timesthe 12 data sets with chosen timesper group n at risk, KM survival, Greenwood SE, log-log CI; per contrast the survival difference, SE, CI, P540/54012.5
rmst_r_tau_rulePBC τ = 13 and τ just above the limit (refused by both); veteran τ = 600 (accepted by both)refusal or acceptance as R decides6/6–

The survival difference at a time uses survfit's Greenwood SE of each group, d ± z·√(se1² + se2²), a normal approximation, not truncated to [−1, 1]. Where a curve has reached 0, Greenwood's SE is undefined (R: NA), and the difference has no CI or P (a warning says so).

The τ rule. survRM2 refuses τ above the largest observed time of a group whose last subject was censored, but accepts τ beyond a group whose curve reached 0 (every subject at risk at its largest time had the event, so its survival is 0 after it), up to the longest follow-up of any group; its default τ is that limit. This was established by running rmst2 on constructed tables (the rule its error message states covers only the first part). The rule is kept on purpose (OLB-070): a group whose Kaplan–Meier curve has reached 0 has S(t) = 0 determined from then on, so its RMST to any τ up to the longest follow-up is well defined; the restriction is needed only where a curve is undefined, after a group's last censored time. Matching the reference of record is also the parity contract. rmst uses the same rule and the same default, and checks it in rmst_r_tau_rule;

Result. 888 of 888 checks pass (tolerance rel ≤ 1e-9; survival and τ rel ≤ 1e-12). Every RMST, SE and CI agrees with survRM2 to 15 digits, every difference and ratio and its CI to 14.2 or more, and every P to 13.5 or more (lung at the 90% level, P = 0.000207); survRM2 and survival's own restricted mean agree with ours to 15. The fewest digits, 12.5, fall on a survival-difference CI limit close to 0 (veteran at day 90: 0.00108), where an absolute difference of 3e-16 is a large relative one.

Contingency tables

References.

  • R Core Team, stats-Ex.Rout.save (as above): chisq.test, fisher.test, mcnemar.test, binom.test and prop.test.
  • SAS Institute Inc.

What is checked. chi_square_test, chi_square_goodness_of_fit, fisher_exact, mcnemar, two_by_two and fraction_of_total, on examples and quantities the legacy suite does not cover.

casedatacheckedchecksmin digits
contingency_r_chisq_examplesAgresti party × gender; a 2×2 table (12, 5, 7, 7); 3 goodness-of-fit tests; Fleiss smokers (4 proportions)6 expected counts and 6 standardized residuals; Yates P; χ², df and P26/264.0
contingency_r_fisher_convictionsFisher's twin convictionsone- and two-sided P; conditional MLE odds ratio; exact 95% and 99% limits14/144.4
contingency_r_mcnemar_binom_propAgresti presidential approval; 682/925 (Conover); 52/100McNemar χ² and P; Clopper–Pearson and Wilson 95% limits7/74.0
contingency_sas_freq_examplesSAS diet/heart-disease 2×2 table; 341/762Pearson, likelihood-ratio and continuity-adjusted χ² and P; φ; Cramér's V; Fisher P left, right and two-sided; odds ratio with Woolf and exact limits; both risk ratios with limits; Clopper–Pearson and Wilson 90% limits27/272.8
contingency_nist_handbookwafer defects 3×4; diode lots 2×5; 4/20; 26/200χ², df, P and expected counts; exact 90% limits; one-sided Wilson 95% lower limit18/183.1

Tolerances. Printed values: half a unit of the last printed digit; df exact. R finds the conditional MLE odds ratio and its exact limits with uniroot at tolerance 1.220703e-4, so its digits beyond that are not exact: ours are bound checks, |ours − R| ≤ 1.220703e-4 (no digits claimed), plus their defining equations (tail probability at each limit = α/2 to 1e-10; E[X | OR] = observed count at the MLE to 1e-9). The e-Handbook's exact upper limit for 4/20: 2e-6 absolute (see Findings); the binomial tails at both exact limits equal α/2 to 1e-12. Variants follow each reference's labels: Yates' correction, sidedness, Woolf, exact or Katz log limits, Wilson without correction.

Result. 92 of 92 checks pass. The fewest digits are 2.8, on the SAS Pearson P printed as 0.0259 (ours 0.025944). Our Fisher MLE and limits lie within 1.5e-5 of R's printed values, and the tail probabilities at our limits equal α/2 to at least 13 digits.

Findings.

  • The e-Handbook prints the exact 90% upper limit for 4/20 as 0.401029; the exact root is 0.40102812, one unit lower in the 6th decimal. Ours is 0.4010281, and its binomial tail equals α/2 to 1e-12.
  • The e-Handbook's wafer table prints 22.9 for the expected count in row 2, column A, where its text uses 22.99. Rows 1 and 3 are compared.
Power and sample size

References.

  • Champely S et al., pwr: Basic Functions for Power Analysis, version 1.3-0;
  • R Core Team, stats-Ex.Rout.save (as above): power.t.test, power.anova.test and power.prop.test.

What is checked. power_t_test, power_anova and power_proportions, solving for power, n or p2.

casedatacheckedchecksmin digits
power_pwr_vignettepwr vignette examplespower or n for two-sample, one-sample, paired and unequal-n t tests; n or power for two proportions (Cohen's h, equal and unequal n); n for one-way ANOVA with k = 314/146.5
power_r_stats_examplesR's examplesone-sided t: n; ANOVA: power at n = 5 and n from group means; power.prop.test: power, detectable p2, n for 0.5 vs 0.501, and R's n for 0.55 vs 0.50 as printed in the pwr vignette10/107.2

Tolerances. Printed values: half a unit of the last printed digit. R and pwr solve for n or p2 with uniroot at tolerance 1.220703e-4; where they print more digits than that, the check is |ours − printed| ≤ 1.220703e-4, and a second check confirms that ours is the exact root: the power at our n or p2 equals the target to 1e-10. R's n for 0.55 vs 0.50 is checked as power at R's n, minus the tail R leaves out, = 0.8 to 1e-7.

Result. 24 of 24 checks pass. The fewest digits on a printed value are 6.5 (pwr's n = 142.2462). Our solved n and p2 lie 7.6e-6 to 1.6e-5 from the values R and pwr print, and the power at each equals the target to 1e-10.

Findings.

  • Two-sided tests count both rejection tails, as pwr does; R's power.prop.test (strict = FALSE) counts only the upper tail. The omitted lower tail is 1.3e-6 at n = 50 (0.5 vs 0.75) and 9.4e-7 at n ≈ 1565 (0.55 vs 0.50), where it moves n by 0.004. Adding it, from R's own formula, to R's printed values reproduces ours to the printed digit.
  • pwr's printed n for k = 3, f = 0.25 (94.48714) is 7.6e-6 above the exact root (94.487132).
ROC curves

References. Robin X, Turck N, Hainard A, et al. (2011), pROC: an open-source package for R and S+ to analyze and compare ROC curves, BMC Bioinformatics 12:77; pROC 1.19.1 test-suite expectations and printed output, aSAH data (Turck et al.

What is checked. roc_curve on aSAH: 72 'Good' outcomes are the controls and 41 'Poor' outcomes the cases, with higher values indicating a case (pROC's direction "<"). The ordered factor wfns is used as its codes 1–5, as in pROC.

casedatacheckedchecksmin digits
roc_proc_auc_delongaSAH: wfns, ndka, s100bgroup sizes; AUC; DeLong variance; DeLong 95% CI of ndka for all patients and for women17/174.4
roc_proc_coords_s100baSAH: s100ball 51 curve points (thresholds, sensitivities, specificities); Youden-optimal threshold 0.205 with its sensitivity and specificity7/715.0

Tolerances. pROC stores its test-suite expectations to 15 digits: AUC rel ≤ 1e-13; DeLong variance and CI rel ≤ 1e-12; the women-only values, given to 10 decimals, rel ≤ 1e-10 (AUC) and 1e-9 (limits); curve points: largest difference ≤ 1e-15; optimal threshold rel ≤ 1e-12, its sensitivity and specificity rel ≤ 1e-15. The s100b AUC comes from printed output (0.7314) and is checked to half a unit. Group sizes and the number of points: exact.

Result. 24 of 24 checks pass. Every interior threshold and every sensitivity and specificity of the s100b curve equals pROC's (largest difference 0). The AUCs, DeLong variances and the ndka CI agree to 14.6–15 digits, the women-only values to 10.2–11.1. The fewest digits, 4.4, are on the s100b AUC that pROC prints as 0.7314 (ours 0.731369).

Findings.

  • pROC's end thresholds are −Inf and +Inf; ours are the smallest value − 1 and the largest value + 1, which classify identically. Thresholds are compared for the 49 interior points, sensitivity and specificity for all 51.
Bland–Altman

References. Bland JM, Altman DG (1986), Statistical methods for assessing agreement between two methods of clinical measurement, Lancet i:307–310 (text and Table 1 as hosted by J. M.

What is checked. bland_altman with limits at mean ± 2 SD, as in the paper. The legacy suite (bland_altman_1986) checks the bias, SD and limits of agreement; this case adds the SE and CI of the bias.

casedatacheckedchecksmin digits
bland_altman_1986_bias_ciPEFR, Wright − mini Wright, first readings, n = 17 (Table 1)t(0.975, 16); SE of the bias; 95% CI of the bias4/42.7

Tolerances. t and the SE: half a unit of the printed digit (2.12 and 9.4); our SE is recovered from our CI as (upper − bias)/t(0.975, 16). CI ends: 0.1 absolute, because the paper computes them from rounded values (d = −2.1, SE = 9.4, t = 2.12), which moves its ends by up to 0.05.

Result. 4 of 4 checks pass. Ours: t = 2.1199, SE 9.402, CI −22.05 to 17.81; the paper: 2.12, 9.4, −22.0 to 17.8. The fewest digits, 2.7, are on the lower CI end, which the paper prints to 3 significant figures.

Findings. Documented, not checked: for the CI of the limits of agreement the 1986 paper uses the approximate SE √(3s²/n) = 16.3, giving −114.3 to −45.1 and 40.9 to 110.1. We use the Bland & Altman (1999) SE s·√(1/n + k²/(2(n − 1))) = 16.6, giving −114.9 to −44.4 and 40.2 to 110.6.

Other areas in the suite
  • Regression and ANOVA tables. R's anova(lm()) and summary(lm()) output on R's own data sets (chickwts, InsectSprays, warpbreaks, LifeCycleSavings, Formaldehyde, attitude, stackloss, swiss, trees), and lmtest::bptest for Breusch–Pagan.
  • Correlation. R's cor.test examples (one-sided Pearson and Spearman on the tuna data, two-sided Pearson on USJudgeRatings).
  • qPCR. Livak & Schmittgen (2001), Pfaffl (2001) and Yuan et al. (2006): ΔΔCt, efficiency-corrected ratios, standard curves and the tests on ΔCt.
  • Properties and simulation. Type I error and family-wise error rates, CI coverage of regression, GLM and survival intervals, power formulas against simulation, and invariance under unit scaling, row order and equivalent forms.
  • Robustness. Missing values, constant data, ties, separation, singular designs, too few observations, zero cells, extreme scales, large n and large tables. Each analysis gives the right answer or a clear reason, never a crash.
Robustness: the range of values

run_analysis refuses any finite number whose magnitude lies outside 1e−150 to 1e150 (registry.VALUE_RANGE; zero is allowed, and missing values, including NaN and ±inf, are dropped by each analysis as before). The error names the value and says what to do, for example: "values[2] is 1e+300, outside the range the statistics are computed in: magnitudes from 1e-150 to 1e150, or 0. Squares of such numbers overflow double precision. Rescale the data, for example by changing the unit, and run the analysis again." P values (adjust_p_values, where 1e−300 is legitimate) and a single test statistic (p_value) are exempt. Counts in contingency tables and Poisson regression are limited to 1e15 (whole numbers stay exact in double precision up to 2^53, about 9e15).

Why: with values near ±1e300 (beyond the square root of the largest double), twelve analyses overflowed to HTTP 500 through the engine, others returned silently degraded numbers (statistics lost, P values changed), and t_test_one_sample at 1e308 never returned (its noncentral-t bracket doubled forever on an infinite t; the bracket now stops after 1,100 doublings). Inside the range, every analysis computes: skewness, kurtosis, D'Agostino–Pearson, Pearson's r (√Sxx·√Syy instead of √(Sxx·Syy)), Breusch–Pagan and Welch's degrees of freedom work on numbers rescaled by a power of two (exact), so their fourth powers neither overflow nor underflow. The engine's sweep (robustness_stats_api_sweep, 728 requests over 56 analyses) checks the same through HTTP: 200 with strict JSON or 422, never 500.

Every case in this suite

In this run the statistics package passes 4,514 of 4,514 checks in 235 cases: 886 of 886 in the 106 cases of the reference suite (Results, below) and 3,628 of 3,628 in the 129 cases of the validation suite listed here. The figures for every package are in the run's summary and the engine report.

Digits of agreement = −log10(|ours − reference| / |reference|), capped at 15. A printed reference can agree only to the digits it prints, so its minimum is low by construction.

areatopiccasereferenceschecks passedtolerancemin digits
StatisticsAssay qualityassay_quality_definitionszhang-1999-z-factor, zhang-2007-2008-ssmd, closed-form30 of 30behaviour holds; rel ≤ 1e-1215.0
StatisticsAssay qualityplate_uniformity_statsmodels_scipystatsmodels, scipy20 of 20behaviour holds; rel ≤ 1e-08; rel ≤ 1e-09; …12.9
StatisticsBland–Altmanbland_altman_1986_bias_cibland-altman-19864 of 4half a unit of the printed digit; abs ≤ 0.12.7
StatisticsClusteringclustering_hierarchical_naiveclosed-form280 of 280rel ≤ 1e-1015.0
StatisticsClusteringclustering_hierarchical_rr-stats-ex13 of 13half a unit of the printed digit; exact7.6
StatisticsClusteringclustering_kmeans_published_exhaustivedatanovia-kmeans-usarrests, closed-form23 of 23half a unit of the printed digit; behaviour holds; rel ≤ 1e-10; …6.8
StatisticsContingency tablesbinomial_r_binom_testr-stats-ex4 of 4half a unit of the printed digit4.7
StatisticsContingency tablescontingency_nist_handbooknist-sematech-handbook18 of 18half a unit of the printed digit; abs ≤ 1e-12; abs ≤ 2e-06; …3.1
StatisticsContingency tablescontingency_r_chisq_examplesr-stats-ex26 of 26half a unit of the printed digit; exact4.0
StatisticsContingency tablescontingency_r_fisher_convictionsr-stats-ex14 of 14half a unit of the printed digit; abs ≤ 1e-09; abs ≤ 1e-10; …4.4
StatisticsContingency tablescontingency_r_mcnemar_binom_propr-stats-ex7 of 7half a unit of the printed digit4.0
StatisticsContingency tablescontingency_sas_freq_examplessas-stat-14.1-freq27 of 27half a unit of the printed digit2.8
StatisticsContingency tableskappa_statsmodelsstatsmodels, closed-form27 of 27rel ≤ 1e-10; rel ≤ 1e-12; rel ≤ 1e-14; …14.0
StatisticsContingency tablestrend_r_prop_trend_testr-stats-ex5 of 5half a unit of the printed digit4.3
StatisticsCorrelationcorrelation_cor_test_rr-stats-ex15 of 15half a unit of the printed digit; exact4.2
StatisticsCorrelationpartial_correlation_residual_methodstatsmodels12 of 12rel ≤ 0; rel ≤ 1e-09; rel ≤ 1e-10; …14.9
StatisticsCorrelationpartial_correlation_wikipediawikipedia-partial-correlation2 of 2half a unit of the printed digit7.3
StatisticsEffect sizeseffect_sizes_closed_formsclosed-form10 of 10rel ≤ 1e-09; rel ≤ 1e-1215.0
StatisticsEffect sizeseffect_sizes_lakens_2013lakens-2013-effect-sizes14 of 14half a unit of the printed digit0.8
StatisticsEffect sizeseffect_sizes_noncentral_cisnoncentral-f-series, noncentral-chi2-series19 of 19rel ≤ 0; rel ≤ 1e-0611.7
StatisticsEquivalence testsequivalence_bounds_in_d_unitsclosed-form7 of 7rel ≤ 1e-1215.0
StatisticsEquivalence testsequivalence_statsmodelsstatsmodels36 of 36rel ≤ 1e-1014.1
StatisticsEquivalence testsequivalence_toster_sleeptoster-vignette19 of 19half a unit of the printed digit; behaviour holds; exact1.3
StatisticsFrequency distributionsfrequency_edges_numpynumpy-histogram28 of 28exact15.0
StatisticsFrequency distributionsfrequency_nist_pidigitsnist-strd-univ16 of 16digits ≥ 12; exact; rel ≤ 1e-1215.0
StatisticsIndependent reference auditwave2_independent_r_valuesr-wave2397 of 397rel ≤ 0; rel ≤ 0.0001; rel ≤ 1e-05; …6.8
StatisticsLinear regressionregression_influence_r_lifecyclesavingsr-stats-ex-influence309 of 309half a unit of the printed digit; behaviour holds; exact0.3
StatisticsLinear regressionregression_influence_statsmodelsstatsmodels20 of 20behaviour holds; rel ≤ 1e-09; rel ≤ 1e-10; …10.3
StatisticsLinear regressionregression_r_datasets_summariesr-datasets-ex166 of 166half a unit of the printed digit; exact; ≤ reference + 02.7
StatisticsLinear regressionregression_r_lifecyclesavingsr-stats-ex41 of 41half a unit of the printed digit; exact3.2
StatisticsLogistic regressionhosmer_lemeshow_r_birthwtr-resourceselection-hoslem3 of 3exact; rel ≤ 1e-069.0
StatisticsLogistic regressionhosmer_lemeshow_r_pimar-resourceselection-hoslem6 of 6exact; rel ≤ 1e-0615.0
StatisticsMethod comparisonmethod_comparison_deming_known_sdsr-deming-tests4 of 4half a unit of the printed digit; behaviour holds; rel ≤ 2e-052.8
StatisticsMethod comparisonmethod_comparison_deming_mcrr-mcr-unit-tests12 of 12half a unit of the printed digit; exact; rel ≤ 1e-06; …6.3
StatisticsMethod comparisonmethod_comparison_deming_odrscipy6 of 6behaviour holds; rel ≤ 1e-05; rel ≤ 1e-067.0
StatisticsMethod comparisonmethod_comparison_passing_bablok_bruteforcer-deming-tests, closed-form18 of 18abs ≤ 1.29e-09; abs ≤ 1.35e-09; abs ≤ 1e-09; …14.6
StatisticsMethod comparisonmethod_comparison_passing_bablok_calanasr-mcr-unit-tests42 of 42rel ≤ 1e-11; rel ≤ 1e-1213.1
StatisticsMethod comparisonmethod_comparison_passing_bablok_exactr-deming-tests4 of 4abs ≤ 1e-1214.3
StatisticsMethod validationaccuracy_recovery_statsmodelsstatsmodels15 of 15rel ≤ 1e-09; rel ≤ 1e-12; rel ≤ 1e-1313.6
StatisticsMethod validationlinearity_formaldehyde_rr-datasets-ex12 of 12half a unit of the printed digit; behaviour holds3.4
StatisticsMethod validationlinearity_lack_of_fit_mandel_statsmodelsstatsmodels8 of 8behaviour holds; exact; rel ≤ 1e-09; …13.4
StatisticsMethod validationlod_loq_formaldehyde_epar-datasets-ex, epa-40cfr136-appendix-b41 of 41half a unit of the printed digit; rel ≤ 0.0002; rel ≤ 1e-143.7
StatisticsMethod validationprecision_confidence_limits_sasr-vca-sas-references20 of 20half a unit of the printed digit; rel ≤ 1e-154.8
StatisticsMethod validationprecision_variance_components_sasr-vca-sas-references72 of 72half a unit of the printed digit3.5
StatisticsMixed-effects modelmixed_nlme_ergostoolnlme-pinheiro-bates-scripts15 of 15half a unit of the printed digit; exact3.7
StatisticsMixed-effects modelmixed_nlme_machinesnlme-pinheiro-bates-scripts6 of 6half a unit of the printed digit4.8
StatisticsMixed-effects modelmixed_nlme_pbibnlme-pinheiro-bates-scripts5 of 5half a unit of the printed digit; exact3.1
StatisticsMixed-effects modelmixed_reml_independentclosed-form9 of 9rel ≤ 1e-05; rel ≤ 1e-07; rel ≤ 1e-097.4
StatisticsMixed-effects modelsmixed_lsmeans_complete_dataclosed-form65 of 65rel ≤ 0; rel ≤ 0.0001; rel ≤ 1e-05; …10.1
StatisticsMultiple comparisonsposthoc_compact_letter_displayclosed-form3 of 3behaviour holds; exact15.0
StatisticsMultiple comparisonsposthoc_dunnett_desctoolsdesctools-dunnett40 of 40half a unit of the printed digit; abs ≤ 0.001; abs ≤ 0.00101; …0.7
StatisticsMultiple comparisonsposthoc_dunnett_one_sided_multcompmultcomp-ex11 of 11half a unit of the printed digit; abs ≤ 0.0005; abs ≤ 0.0012.1
StatisticsMultiple comparisonsposthoc_games_howell_rstatixrstatix-games-howell36 of 36half a unit of the printed digit; ≤ reference + 02.5
StatisticsMultiple comparisonsposthoc_pairwise_t_airqualityr-stats-ex30 of 30half a unit of the printed digit1.6
StatisticsMultiple comparisonsposthoc_tukey_lsd_nist_handbooknist-sematech-handbook20 of 20half a unit of the printed digit; abs ≤ 0.0021.7
StatisticsMultiple comparisonsposthoc_unequal_variances_t3_t2scipy, closed-form36 of 36rel ≤ 1e-08; rel ≤ 1e-09; rel ≤ 1e-1010.6
StatisticsMultiple t testsfdr_two_stage_bkystatsmodels2 of 2behaviour holds; exact15.0
StatisticsMultiple t testsmultiple_t_adjustments_statsmodelsstatsmodels12 of 12exact; rel ≤ 1e-0915.0
StatisticsMultiple t testsmultiple_t_rows_vs_rtoster-vignette7 of 7half a unit of the printed digit; exact; rel ≤ 1e-121.3
StatisticsNormalityqq_r_ppointsr-stats-ex, closed-form20 of 20half a unit of the printed digit; exact; rel ≤ 1e-126.8
StatisticsOne-way ANOVAanova_linear_trendscipy, closed-form6 of 6rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-11; …15.0
StatisticsOne-way ANOVAanova_r_one_way_tablesr-datasets-ex22 of 22half a unit of the printed digit; exact2.9
StatisticsPCAparallel_analysis_paran_same_drawsr-paran-1.5.610 of 10digits ≥ 12; exact14.7
StatisticsPCAparallel_analysis_r_mtcarsr-paran-1.5.6, r-psych-2.6.935 of 35abs ≤ 0.00736; abs ≤ 0.00779; abs ≤ 0.00804; …2.1
StatisticsPCAparallel_analysis_r_state_x77r-paran-1.5.6, r-psych-2.6.926 of 26abs ≤ 0.00557; abs ≤ 0.00621; abs ≤ 0.00649; …2.4
StatisticsPower and sample sizepower_correlation_regression_pwrr-pwr-1.3-0, r-stats-ex9 of 9half a unit of the printed digit; abs ≤ 0.000122; abs ≤ 1e-066.8
StatisticsPower and sample sizepower_pwr_vignetter-pwr-1.3-014 of 14half a unit of the printed digit; abs ≤ 1e-10; ≤ reference + 06.5
StatisticsPower and sample sizepower_r_stats_examplesr-stats-ex, r-pwr-1.3-010 of 10half a unit of the printed digit; abs ≤ 1e-07; abs ≤ 1e-10; …7.2
StatisticsPower and sample sizepower_survival_mcnemar_rank_closed_formsschoenfeld-freedman-logrank, closed-form17 of 17rel ≤ 0.0001; rel ≤ 1e-05; rel ≤ 1e-08; …5.6
StatisticsROC curvesroc_proc_auc_delongr-proc-1.19.117 of 17half a unit of the printed digit; exact; rel ≤ 1e-09; …4.4
StatisticsROC curvesroc_proc_coords_s100br-proc-1.19.17 of 7abs ≤ 1e-15; exact; rel ≤ 1e-12; …15.0
StatisticsRegression diagnosticsregression_breusch_pagan_lmtestlmtest-ex6 of 6half a unit of the printed digit; exact3.6
StatisticsRepeated-measures ANOVArm_anova_reacttime_split_plotr-stats-ex12 of 12half a unit of the printed digit; exact3.9
StatisticsRepeated-measures ANOVArm_anova_reacttime_two_withinr-stats-ex17 of 17half a unit of the printed digit; exact4.4
StatisticsRepeated-measures ANOVArm_anova_selfesteem_datanoviadatanovia-rm-anova31 of 31half a unit of the printed digit; exact2.5
StatisticsRepeated-measures ANOVArm_comparisons_reacttime_two_withinr-stats-ex, scipy, closed-form20 of 20half a unit of the printed digit; rel ≤ 1e-09; rel ≤ 1e-10; …4.4
StatisticsRepeated-measures ANOVArm_comparisons_selfesteem_paired_bonferronidatanovia-rm-anova12 of 12half a unit of the printed digit; exact2.5
StatisticsRepeated-measures ANOVArm_comparisons_split_plotstatsmodels, scipy18 of 18rel ≤ 0; rel ≤ 1e-06; rel ≤ 1e-09; …14.5
StatisticsSurvivalcox_zph_r_lungr-survival-3.8-12-cox-zph20 of 20exact; rel ≤ 1e-068.5
StatisticsSurvivalcox_zph_r_ovarianr-survival-3.8-12-cox-zph10 of 10exact; rel ≤ 1e-0613.5
StatisticsSurvivalcox_zph_r_veteranr-survival-3.8-12-cox-zph52 of 52behaviour holds; exact; rel ≤ 1e-067.3
StatisticsSurvivalsurvival_aml_rr-survival-3.8-13120 of 120half a unit of the printed digit; behaviour holds; exact2.6
StatisticsSurvivalsurvival_cox_ties_closed_formtherneau-grambsch-2000-appendix, r-survival-3.8-13, closed-form11 of 11half a unit of the printed digit; rel ≤ 1e-08; rel ≤ 1e-096.5
StatisticsSurvivalsurvival_logrank_empty_group_rr-survival-3.8-133 of 3half a unit of the printed digit; exact3.0
StatisticsSurvivalsurvival_lung_rr-survival-3.8-1337 of 37half a unit of the printed digit; exact3.2
StatisticsSurvivalsurvival_ovarian_cox_rr-survival-3.8-13104 of 104half a unit of the printed digit; exact2.6
StatisticsSurvivalsurvival_ovarian_km_rr-survival-3.8-13150 of 150half a unit of the printed digit; exact2.8
StatisticsSurvivalsurvival_veteran_cox_rr-survival-3.8-131 of 1half a unit of the printed digit8.3
StatisticsTwo-way ANOVAanova_r_warpbreaks_two_wayr-datasets-ex, r-stats-ex36 of 36half a unit of the printed digit; exact2.8
StatisticsTwo-way ANOVAfactorial_cell_comparisonsscipy, statsmodels64 of 64rel ≤ 0; rel ≤ 1e-05; rel ≤ 1e-06; …12.9
StatisticsTwo-way ANOVAfactorial_effect_sizes_statsmodelsstatsmodels, noncentral-f-series21 of 21rel ≤ 0; rel ≤ 1e-06; rel ≤ 1e-08; …11.7
StatisticsTwo-way ANOVAfactorial_lsmeans_statsmodelsstatsmodels96 of 96rel ≤ 1e-09; rel ≤ 1e-1014.9
StatisticsTwo-way ANOVAfactorial_r_tukeyhsd_additive_warpbreaksr-stats-ex13 of 13half a unit of the printed digit; rel ≤ 05.0
IntegrationsqPCR (ΔΔCt)qpcr_livak2001_figure2_time_courselivak-schmittgen-20019 of 9rel ≤ 0.1491.1
IntegrationsqPCR (ΔΔCt)qpcr_livak2001_table1_separate_wellslivak-schmittgen-200124 of 24half a unit of the printed digit1.1
IntegrationsqPCR (ΔΔCt)qpcr_livak2001_table2_same_welllivak-schmittgen-200114 of 14half a unit of the printed digit1.8
IntegrationsqPCR (ΔΔCt)qpcr_pfaffl2001_efficiency_correctedpfaffl-200112 of 12rel ≤ 0.0116; rel ≤ 0.0117; rel ≤ 0.0121; …2.3
IntegrationsqPCR (ΔΔCt)qpcr_yuan2006_ttest_on_delta_ctyuan-200641 of 41half a unit of the printed digit; exact; ≤ reference + 03.4
IntegrationsqPCR (ΔΔCt)qpcr_yuan2006_wilcoxon_on_delta_ctyuan-20066 of 6half a unit of the printed digit; exact3.9
IntegrationsqPCR standard curves and efficiencyqpcr_yuan2006_gene_by_treatment_and_equal_slopesyuan-200612 of 12half a unit of the printed digit; exact; rel ≤ 2e-062.7
IntegrationsqPCR standard curves and efficiencyqpcr_yuan2006_standard_curvesyuan-200661 of 61half a unit of the printed digit; exact3.5
Properties and simulationCI coveragesim_coverage_bland_altman_loaseeded-simulation, closed-form4 of 4abs ≤ 0.02271.9
Properties and simulationCI coveragesim_coverage_glmseeded-simulation3 of 3abs ≤ 0.05621.5
Properties and simulationCI coveragesim_coverage_kendall_ciseeded-simulation, closed-form4 of 4≤ reference + 0.0307; ≥ reference − 0.0357–
Properties and simulationCI coveragesim_coverage_linear_regressionseeded-simulation3 of 3abs ≤ 0.02271.9
Properties and simulationCI coveragesim_coverage_spearman_ciseeded-simulation, closed-form4 of 4≤ reference + 0.0307; ≥ reference − 0.0357–
Properties and simulationCI coveragesim_coverage_survivalseeded-simulation5 of 5abs ≤ 0.0307; abs ≤ 0.0357; abs ≤ 0.05621.8
Properties and simulationCI coveragesim_coverage_welch_cohens_dseeded-simulation, closed-form2 of 2abs ≤ 0.03071.9
Properties and simulationFamily-wise errorsim_fwe_posthoc_unequal_nseeded-simulation4 of 4abs ≤ 0.0427; abs ≤ 0.0527; ≤ reference + 0.03970.6
Properties and simulationInvarianceinvariance_equivalent_formsclosed-form19 of 19exact; rel ≤ 1e-06; rel ≤ 1e-07; …13.9
Properties and simulationInvarianceinvariance_row_and_label_orderclosed-form12 of 12rel ≤ 1e-06; rel ≤ 1e-07; rel ≤ 1e-1215.0
Properties and simulationInvarianceinvariance_unit_scalingclosed-form11 of 11rel ≤ 1e-07; rel ≤ 1e-08; rel ≤ 1e-09; …12.5
Properties and simulationInvarianceinvariance_vs_scipy_after_transformationclosed-form, scipy3 of 3rel ≤ 1e-10; rel ≤ 1e-1215.0
Properties and simulationPowerpower_null_and_identitiesclosed-form9 of 9rel ≤ 1e-06; rel ≤ 1e-0913.5
Properties and simulationPowersim_power_formulasseeded-simulation5 of 5abs ≤ 0.0485; abs ≤ 0.049; abs ≤ 0.0491; …1.2
Properties and simulationType I errorsim_type1_contingencyseeded-simulation4 of 4abs ≤ 0.0307; ≤ reference + 0.02271.1
Properties and simulationType I errorsim_type1_one_wayseeded-simulation3 of 3abs ≤ 0.0227; abs ≤ 0.03070.5
Properties and simulationType I errorsim_type1_repeated_measuresseeded-simulation5 of 5abs ≤ 0.0227; abs ≤ 0.0407; abs ≤ 0.0508; …0.6
RobustnessConstant datarobustness_constant_and_zero_variancescipy, closed-form27 of 27behaviour holds; rel ≤ 1e-1215.0
RobustnessExtreme scalesrobustness_extreme_scalesclosed-form15 of 15digits ≥ 10; digits ≥ 12; digits ≥ 4; …4.9
RobustnessInput validationrobustness_input_validationclosed-form17 of 17behaviour holds–
RobustnessLarge nrobustness_large_nscipy, lifelines9 of 9rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-11; …14.3
RobustnessLarge tablesrobustness_exact_test_limitsscipy6 of 6behaviour holds; rel ≤ 0.001; rel ≤ 1e-12; …3.1
RobustnessMissing valuesrobustness_missing_valuesscipy, closed-form17 of 17behaviour holds; exact; rel ≤ 1e-1214.4
RobustnessSeparationrobustness_separationclosed-form7 of 7behaviour holds–
RobustnessSingular designsrobustness_singular_designsclosed-form5 of 5behaviour holds–
RobustnessTiesrobustness_ties_vs_scipyscipy9 of 9rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-1215.0
RobustnessToo few observationsrobustness_too_few_observationsclosed-form14 of 14behaviour holds–
RobustnessZero cellsrobustness_contingency_zero_cellsscipy, statsmodels, closed-form7 of 7behaviour holds; exact; rel ≤ 1e-10; …14.8

References cited above:

Every reference case, with its result

Generated 2026-10-21 with Python 3.12.13; numpy 2.5.4, scipy 1.18.1, statsmodels 0.15.0, lifelines 0.30.3, pydantic 2.14.1.

884 of 884 checks passed in 106 reference cases.

areacasescheckspassedkinds
Descriptive statistics135151NIST, analytic, cross-check
Normality43333analytic, cross-check, published
t tests32424analytic, cross-check, published
One-way ANOVA12117117NIST, cross-check
Two-way ANOVA33030cross-check, published
Multiple comparisons74949analytic, cross-check, published
Repeated-measures ANOVA42323analytic, cross-check, published
Mixed-effects model144cross-check
Nonparametric tests42020analytic, cross-check, published
Correlation21414cross-check, published
Contingency tables53939analytic, cross-check, published
Survival44040cross-check, published
ROC curves244cross-check, published
Bland–Altman144published
Linear regression14168168NIST, cross-check
Logistic regression21212cross-check, published
Poisson regression21010cross-check, published
PCA11010cross-check
Area under curve288analytic, cross-check
Outliers21111published
Power and sample size21414cross-check, published
Simulation51414simulation
Other188analytic
P values from test statistics35050analytic, cross-check, published
Summary-data tests25555cross-check, published
Nested designs22929cross-check
Parts of whole11717cross-check
qPCR (ΔΔCt)22626cross-check
Descriptive statistics
nist_univariate_PiDigits (NIST, pass)

Reference: NIST StRD univariate 'PiDigits' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)4.53484.5348LRE 15.0LRE ≥ 14✓
SD (vs certified)2.867339062.86733906LRE 15.0LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)2.867339062.86733906LRE 15.0LRE ≥ 13✓
nist_univariate_Lottery (NIST, pass)

Reference: NIST StRD univariate 'Lottery' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)518.9587156518.9587156LRE 15.0LRE ≥ 14✓
SD (vs certified)291.6997275291.6997275LRE 15.0LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)291.6997275291.6997275LRE 15.0LRE ≥ 13✓
nist_univariate_Lew (NIST, pass)

Reference: NIST StRD univariate 'Lew' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)-177.435-177.435LRE 15.0LRE ≥ 14✓
SD (vs certified)277.332168277.332168LRE 15.0LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)277.332168277.332168LRE 15.0LRE ≥ 13✓
nist_univariate_Mavro (NIST, pass)

Reference: NIST StRD univariate 'Mavro' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)2.0018562.001856LRE 15.0LRE ≥ 14✓
SD (vs certified)0.0004291234540.000429123454LRE 13.1LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)0.0004291234540.000429123454LRE 15.0LRE ≥ 13✓
nist_univariate_Michelso (NIST, pass)

Reference: NIST StRD univariate 'Michelso' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)299.8524299.8524LRE 15.0LRE ≥ 14✓
SD (vs certified)0.079010547820.07901054782LRE 13.8LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)0.079010547820.07901054782LRE 15.0LRE ≥ 13✓
nist_univariate_NumAcc1 (NIST, pass)

Reference: NIST StRD univariate 'NumAcc1' (lower difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)1000000210000002LRE 15.0LRE ≥ 14✓
SD (vs certified)11LRE 15.0LRE ≥ 13✓
SD (vs exact rational result for the binary inputs)11LRE 15.0LRE ≥ 13✓
nist_univariate_NumAcc2 (NIST, pass)

Reference: NIST StRD univariate 'NumAcc2' (average difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)1.21.2LRE 15.0LRE ≥ 14✓
SD (vs certified)0.10.1LRE 15.0LRE ≥ 9✓
SD (vs exact rational result for the binary inputs)0.10.1LRE 15.0LRE ≥ 13✓
nist_univariate_NumAcc3 (NIST, pass)

Reference: NIST StRD univariate 'NumAcc3' (average difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)1000000.21000000.2LRE 15.0LRE ≥ 14✓
SD (vs certified)0.10.1LRE 9.5LRE ≥ 9✓
SD (vs exact rational result for the binary inputs)0.10.1LRE 15.0LRE ≥ 13✓
nist_univariate_NumAcc4 (NIST, pass)

Reference: NIST StRD univariate 'NumAcc4' (higher difficulty).

Note: Values like 10000000.2 are not exactly representable in binary; the last check isolates algorithm error from input rounding.

quantityoursreferenceerrortolerance
mean (vs certified)10000000.210000000.2LRE 15.0LRE ≥ 14✓
SD (vs certified)0.10000000060.1LRE 8.3LRE ≥ 8✓
SD (vs exact rational result for the binary inputs)0.10000000060.1000000006LRE 15.0LRE ≥ 13✓
quantiles_hyndman_fan (analytic, pass)

Reference: Hyndman & Fan (1996) definitions 6 and 7, 1..10.

quantityoursreferenceerrortolerance
Q1 type 62.752.750abs ≤ 1e-12✓
Q3 type 68.258.250abs ≤ 1e-12✓
Q1 type 73.253.250abs ≤ 1e-12✓
Q3 type 77.757.750abs ≤ 1e-12✓
median5.55.50abs ≤ 1e-12✓
geometric_and_median_ci (analytic, pass)

Reference: Closed-form values.

quantityoursreferenceerrortolerance
geometric mean of 1, 10, 10010101.8e-15abs ≤ 1e-12✓
geometric SD factor10101.8e-15abs ≤ 1e-12✓
harmonic mean2.7027027032.7027027030abs ≤ 1e-12✓
median CI lower (n = 10)220exact✓
median CI upper (n = 10)990exact✓
median CI achieved level0.9785156250.9785156250abs ≤ 1e-12✓
CV of 1..100.55048188260.55048188260abs ≤ 1e-12✓
skew_kurtosis_formula (cross-check, pass)

Reference: Joanes & Gill (1998) G1, G2 written out.

quantityoursreferenceerrortolerance
skewness G11.6796694811.6796694810rel ≤ 1e-12✓
excess kurtosis G24.3549745954.3549745950rel ≤ 1e-12✓
CI of mean (lower)1.3848827541.3848827540rel ≤ 1e-12✓
graph_support (cross-check, pass)

Reference: Kernel density vs scipy.stats.gaussian_kde at the same bandwidth; bandwidth vs Silverman's rule as in R bw.nrd0; Tukey box-plot fences; number at risk by counting.

quantityoursreferenceerrortolerance
bandwidth (bw.nrd0 rule)0.84058445450.84058445450rel ≤ 1e-12✓
maxdensity − gaussian_kde8.326672685e-1708.3e-17
density integrates to 1 (trapezoid)0.999912658718.7e-05abs ≤ 0.001✓
Tukey upper fence (type 7: Q3 = 7, IQR = 4)13130abs ≤ 1e-12✓
upper whisker = largest value inside880exact✓
outliers110exact✓
at risk at 10 (6-MP)15150exact✓
at risk at 20 (6-MP)880exact✓
S(10) from the at-risk table0.75294117650.75294.1e-05abs ≤ 5e-05✓
Normality
shapiro_wilk_1965 (published, pass)

Reference: Shapiro & Wilk (1965), Biometrika 52:591, weights of 11 men: W = 0.79.

quantityoursreferenceerrortolerance
W0.78881469480.790.0012abs ≤ 0.005✓
dagostino_vs_scipy (cross-check, pass)

Reference: scipy.stats.normaltest (independent code).

quantityoursreferenceerrortolerance
K² (n = 8)0.28391370350.28391370350rel ≤ 1e-10✓
P (n = 8)0.86765869360.86765869360rel ≤ 1e-09✓
K² (n = 25)7.1970368357.1970368350rel ≤ 1e-10✓
P (n = 25)0.02736423480.02736423480rel ≤ 1e-09✓
K² (n = 400)60.3989285960.398928590rel ≤ 1e-10✓
P (n = 400)7.665479038e-147.665479038e-140rel ≤ 1e-09✓
lilliefors_vs_monte_carlo (cross-check, pass)

Reference: Lilliefors D vs statsmodels; P vs the Monte Carlo null distribution (40,000 seeded samples per n).

Note: P comes from the Dallal–Wilkinson approximation (P < 0.1) or interpolation in a simulated table; it is accurate to about 0.003 around P = 0.05 and about 0.015 around P = 0.2.

quantityoursreferenceerrortolerance
D (n = 8)0.23166723420.23166723420abs ≤ 1e-12✓
P at the Monte Carlo 0.05 critical value (n = 8)0.048876130440.050.0011abs ≤ 0.004✓
P at the Monte Carlo 0.01 critical value (n = 8)0.0092797835180.010.00072abs ≤ 0.002✓
P at the Monte Carlo 0.2 critical value (n = 8)0.20717142390.20.0072abs ≤ 0.015✓
D (n = 20)0.12876570740.12876570740abs ≤ 1e-12✓
P at the Monte Carlo 0.05 critical value (n = 20)0.05357350070.050.0036abs ≤ 0.004✓
P at the Monte Carlo 0.01 critical value (n = 20)0.0096606135430.010.00034abs ≤ 0.002✓
P at the Monte Carlo 0.2 critical value (n = 20)0.21336986230.20.013abs ≤ 0.015✓
D (n = 50)0.083496077760.083496077760abs ≤ 1e-12✓
P at the Monte Carlo 0.05 critical value (n = 50)0.0497184020.050.00028abs ≤ 0.004✓
P at the Monte Carlo 0.01 critical value (n = 50)0.0099967214540.013.3e-06abs ≤ 0.002✓
P at the Monte Carlo 0.2 critical value (n = 50)0.20995535830.20.01abs ≤ 0.015✓
D (n = 200)0.058814311480.058814311480abs ≤ 1e-12✓
P at the Monte Carlo 0.05 critical value (n = 200)0.047879337260.050.0021abs ≤ 0.004✓
P at the Monte Carlo 0.01 critical value (n = 200)0.010039562230.014e-05abs ≤ 0.002✓
P at the Monte Carlo 0.2 critical value (n = 200)0.20991134720.20.0099abs ≤ 0.015✓
normality_identities (analytic, pass)

Reference: normality_differences = normality on first − second; normality_columns = normality on each column.

quantityoursreferenceerrortolerance
Shapiro–Wilk W of the differences0.82987133190.82987133190exact✓
Shapiro–Wilk P of the differences0.033341608630.033341608630exact✓
D'Agostino P of the differences0.0034616013650.0034616013650exact✓
column a: Shapiro–Wilk P0.34561365520.34561365520exact✓
column a: D'Agostino–Pearson omnibus P0.97152858020.97152858020exact✓
column a: Kolmogorov–Smirnov (Lilliefors) P0.79102333260.79102333260exact✓
column b: Shapiro–Wilk P7.481085553e-067.481085553e-060exact✓
column b: D'Agostino–Pearson omnibus P1.744187627e-071.744187627e-070exact✓
column b: Kolmogorov–Smirnov (Lilliefors) P0.0012888912410.0012888912410exact✓
too-short column reported, not tested000exact✓
t tests
t_tests_sleep (published, pass)

Reference: Student's sleep data; R t.test documented output (t, df, P, 95% CI).

quantityoursreferenceerrortolerance
paired t-4.062127683-4.06212.8e-05abs ≤ 5e-05✓
paired P0.0028328901970.0028331.1e-07abs ≤ 5e-07✓
paired CI lower-2.459885763-2.45988583.7e-08abs ≤ 1e-07✓
paired CI upper-0.7001142367-0.70011423.7e-08abs ≤ 1e-07✓
Student t-1.860813467-1.86081.3e-05abs ≤ 5e-05✓
Student P0.079186714220.079193.3e-06abs ≤ 5e-06✓
Student CI lower-3.363874032-3.3638743.2e-08abs ≤ 1e-06✓
Welch df17.7764735217.7760.00047abs ≤ 0.0005✓
Welch P0.079394140190.079394.1e-06abs ≤ 5e-06✓
Welch CI lower-3.365483231-3.36548323.1e-08abs ≤ 1e-07✓
Welch CI upper0.20548323070.20548323.1e-08abs ≤ 1e-07✓
t_tests_vs_scipy (cross-check, pass)

Reference: scipy.stats ttest_ind / ttest_rel / ttest_1samp with CIs.

quantityoursreferenceerrortolerance
t (welch=False)-0.6676510472-0.66765104725e-16rel ≤ 1e-12✓
P one-sided (welch=False)0.25581378660.25581378664.3e-16rel ≤ 1e-10✓
CI upper (welch=False)0.68442900380.68442900386.5e-16rel ≤ 1e-10✓
t (welch=True)-0.789877634-0.7898776344.2e-16rel ≤ 1e-12✓
P one-sided (welch=True)0.21988322030.21988322035e-16rel ≤ 1e-10✓
CI upper (welch=True)0.51810779190.51810779194.3e-16rel ≤ 1e-10✓
paired P0.87164310590.87164310590rel ≤ 1e-10✓
paired CI lower-0.9864873241-0.98648732410rel ≤ 1e-10✓
one-sample P0.66846251770.66846251773.3e-16rel ≤ 1e-10✓
effect_size_ci_inversion (analytic, pass)

Reference: Definition of the noncentral-t interval (Steiger & Fouladi 1997).

quantityoursreferenceerrortolerance
P(T <= tlower) = 0.9750.9750.9754.6e-15abs ≤ 1e-09
P(T <= tupper) = 0.0250.0250.0259.9e-15abs ≤ 1e-09
Hedges' J(18) exact0.9576464270.9576464271.8e-15abs ≤ 1e-12✓
Hedges' J vs approximation 1 - 3/(4df - 1)0.9576464270.95774647890.0001abs ≤ 0.0002✓
One-way ANOVA
nist_anova_SiRstv (NIST, pass)

Reference: NIST StRD ANOVA 'SiRstv' (lower difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between0.05114626160.0511462616LRE 14.0LRE ≥ 12✓
MS between0.01278656540.0127865654LRE 14.0LRE ≥ 12✓
F1.1804623741.180462374LRE 13.1LRE ≥ 12✓
SS within0.216636560.21663656LRE 13.1LRE ≥ 12✓
MS within0.0108318280.010831828LRE 13.1LRE ≥ 12✓
R²0.19099903910.1909990391LRE 13.2LRE ≥ 12✓
residual SD0.10407606830.1040760683LRE 13.4LRE ≥ 12✓
df between440exact✓
SS between (vs exact rational result for the binary inputs)0.05114626160.0511462616LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)0.216636560.21663656LRE 15.0LRE ≥ 12✓
nist_anova_SmLs01 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs01' (lower difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between1.681.68LRE 15.0LRE ≥ 12✓
MS between0.210.21LRE 15.0LRE ≥ 12✓
F2121LRE 15.0LRE ≥ 12✓
SS within1.81.8LRE 15.0LRE ≥ 12✓
MS within0.010.01LRE 15.0LRE ≥ 12✓
R²0.48275862070.4827586207LRE 15.0LRE ≥ 12✓
residual SD0.10.1LRE 15.0LRE ≥ 12✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)1.681.68LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1.81.8LRE 15.0LRE ≥ 12✓
nist_anova_SmLs02 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs02' (lower difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between16.0816.08LRE 15.0LRE ≥ 12✓
MS between2.012.01LRE 15.0LRE ≥ 12✓
F201201LRE 15.0LRE ≥ 12✓
SS within1818LRE 15.0LRE ≥ 12✓
MS within0.010.01LRE 15.0LRE ≥ 12✓
R²0.47183098590.4718309859LRE 15.0LRE ≥ 12✓
residual SD0.10.1LRE 15.0LRE ≥ 12✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)16.0816.08LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1818LRE 15.0LRE ≥ 12✓
nist_anova_SmLs03 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs03' (lower difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between160.08160.08LRE 15.0LRE ≥ 12✓
MS between20.0120.01LRE 15.0LRE ≥ 12✓
F20012001LRE 15.0LRE ≥ 12✓
SS within180180LRE 15.0LRE ≥ 12✓
MS within0.010.01LRE 15.0LRE ≥ 12✓
R²0.47071277350.4707127735LRE 15.0LRE ≥ 12✓
residual SD0.10.1LRE 15.0LRE ≥ 12✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)160.08160.08LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)180180LRE 15.0LRE ≥ 12✓
nist_anova_AtmWtAg (NIST, pass)

Reference: NIST StRD ANOVA 'AtmWtAg' (average difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between3.638341875e-093.638341875e-09LRE 10.2LRE ≥ 9.5✓
MS between3.638341875e-093.638341875e-09LRE 10.2LRE ≥ 9.5✓
F15.9467335715.94673357LRE 10.2LRE ≥ 9.5✓
SS within1.049517292e-081.049517292e-08LRE 10.9LRE ≥ 9.5✓
MS within2.28155933e-102.28155933e-10LRE 10.9LRE ≥ 9.5✓
R²0.25742654450.2574265445LRE 10.3LRE ≥ 9.5✓
residual SD1.510483144e-051.510483144e-05LRE 11.2LRE ≥ 9.5✓
df between110exact✓
SS between (vs exact rational result for the binary inputs)3.638341875e-093.638341875e-09LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1.049517292e-081.049517292e-08LRE 15.0LRE ≥ 12✓
nist_anova_SmLs04 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs04' (average difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between1.681.68LRE 10.1LRE ≥ 9.5✓
MS between0.210.21LRE 10.1LRE ≥ 9.5✓
F2121LRE 10.4LRE ≥ 9.5✓
SS within1.81.8LRE 10.3LRE ≥ 9.5✓
MS within0.010.01LRE 10.3LRE ≥ 9.5✓
R²0.48275862070.4827586207LRE 10.7LRE ≥ 9.5✓
residual SD0.10.1LRE 10.6LRE ≥ 9.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)1.681.68LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1.81.8LRE 15.0LRE ≥ 12✓
nist_anova_SmLs05 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs05' (average difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between16.0816.08LRE 9.9LRE ≥ 9.5✓
MS between2.012.01LRE 9.9LRE ≥ 9.5✓
F201201LRE 10.2LRE ≥ 9.5✓
SS within1818LRE 10.3LRE ≥ 9.5✓
MS within0.010.01LRE 10.3LRE ≥ 9.5✓
R²0.47183098590.4718309859LRE 10.5LRE ≥ 9.5✓
residual SD0.10.1LRE 10.6LRE ≥ 9.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)16.0816.08LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1818LRE 15.0LRE ≥ 12✓
nist_anova_SmLs06 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs06' (average difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between160.08160.08LRE 9.9LRE ≥ 9.5✓
MS between20.0120.01LRE 9.9LRE ≥ 9.5✓
F20012001LRE 10.2LRE ≥ 9.5✓
SS within180180LRE 10.3LRE ≥ 9.5✓
MS within0.010.01LRE 10.3LRE ≥ 9.5✓
R²0.47071277350.4707127735LRE 10.5LRE ≥ 9.5✓
residual SD0.10.1LRE 10.6LRE ≥ 9.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)160.08160.08LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)180180LRE 15.0LRE ≥ 12✓
nist_anova_SmLs07 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs07' (higher difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between1.6801562691.68LRE 4.0LRE ≥ 3.5✓
MS between0.21001953370.21LRE 4.0LRE ≥ 3.5✓
F21.0008118921LRE 4.4LRE ≥ 3.5✓
SS within1.8000978371.8LRE 4.3LRE ≥ 3.5✓
MS within0.010000543540.01LRE 4.3LRE ≥ 3.5✓
R²0.48276827430.4827586207LRE 4.7LRE ≥ 3.5✓
residual SD0.10000271770.1LRE 4.6LRE ≥ 3.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)1.6801562691.680156269LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)1.8000978371.800097837LRE 15.0LRE ≥ 12✓
nist_anova_SmLs08 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs08' (higher difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between16.0819142816.08LRE 3.9LRE ≥ 3.5✓
MS between2.0102392862.01LRE 3.9LRE ≥ 3.5✓
F201.0130041201LRE 4.2LRE ≥ 3.5✓
SS within18.0009782518LRE 4.3LRE ≥ 3.5✓
MS within0.010000543470.01LRE 4.3LRE ≥ 3.5✓
R²0.47184710830.4718309859LRE 4.5LRE ≥ 3.5✓
residual SD0.10000271730.1LRE 4.6LRE ≥ 3.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)16.0819142816.08191428LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)18.0009782518.00097825LRE 15.0LRE ≥ 12✓
nist_anova_SmLs09 (NIST, pass)

Reference: NIST StRD ANOVA 'SmLs09' (higher difficulty).

Note: SmLs07–09 have 13 constant leading digits; their decimal values are not representable in binary, which limits any double-precision computation to about 4 digits (see the exact-rational checks).

quantityoursreferenceerrortolerance
SS between160.0994944160.08LRE 3.9LRE ≥ 3.5✓
MS between20.012436820.01LRE 3.9LRE ≥ 3.5✓
F2001.1349262001LRE 4.2LRE ≥ 3.5✓
SS within180.0097823180LRE 4.3LRE ≥ 3.5✓
MS within0.010000543460.01LRE 4.3LRE ≥ 3.5✓
R²0.47072957240.4707127735LRE 4.4LRE ≥ 3.5✓
residual SD0.10000271730.1LRE 4.6LRE ≥ 3.5✓
df between880exact✓
SS between (vs exact rational result for the binary inputs)160.0994944160.0994944LRE 15.0LRE ≥ 12✓
SS within (vs exact rational result for the binary inputs)180.0097823180.0097823LRE 15.0LRE ≥ 12✓
welch_brown_forsythe_vs_statsmodels (cross-check, pass)

Reference: statsmodels.stats.oneway.anova_oneway.

quantityoursreferenceerrortolerance
Welch F0.28325780470.28325780470rel ≤ 1e-10✓
Welch df29.611631239.611631231.8e-16rel ≤ 1e-10✓
Welch P0.83636675010.83636675010rel ≤ 1e-09✓
Brown–Forsythe F*0.33981051380.33981051380rel ≤ 1e-10✓
Brown–Forsythe df216.4149480716.414948072.2e-16rel ≤ 1e-10✓
Brown–Forsythe P (Satterthwaite)0.79683327350.79683327350rel ≤ 1e-09✓
ordinary F0.3704970950.3704970953e-16rel ≤ 1e-10✓
Two-way ANOVA
two_way_montgomery (published, pass)

Reference: Montgomery, Design and Analysis of Experiments, battery life example (3 materials × 3 temperatures, n = 4).

quantityoursreferenceerrortolerance
SS material10683.7222210683.720.0022abs ≤ 0.005✓
SS temperature39118.7222239118.720.0022abs ≤ 0.005✓
SS interaction9613.7777789613.780.0022abs ≤ 0.005✓
SS error18230.7518230.750abs ≤ 0.005✓
F material7.9113722697.910.0014abs ≤ 0.005✓
F temperature28.9676919528.970.0023abs ≤ 0.005✓
F interaction3.55953543.560.00046abs ≤ 0.005✓
factorial_vs_statsmodels (cross-check, pass)

Reference: statsmodels anova_lm (Type I, II, III with sum contrasts) on unbalanced 3×2 and 2×2×2 designs.

quantityoursreferenceerrortolerance
Type 1 SS A9.9820169039.9820169030rel ≤ 1e-09✓
Type 1 F A3.5281753373.5281753370rel ≤ 1e-09✓
Type 1 SS B1.2963179941.2963179946.9e-16rel ≤ 1e-09✓
Type 1 F B0.91637536160.91637536167.3e-16rel ≤ 1e-09✓
Type 1 SS A × B7.2986368137.2986368133.7e-16rel ≤ 1e-09✓
Type 1 F A × B2.5797261872.5797261873.4e-16rel ≤ 1e-09✓
Type 2 SS A10.88437510.8843754.9e-16rel ≤ 1e-09✓
Type 2 F A3.8471166523.8471166524.6e-16rel ≤ 1e-09✓
Type 2 SS B1.2963179941.2963179941.2e-15rel ≤ 1e-09✓
Type 2 F B0.91637536160.91637536161.1e-15rel ≤ 1e-09✓
Type 2 SS A × B7.2986368137.2986368131.6e-15rel ≤ 1e-09✓
Type 2 F A × B2.5797261872.5797261871.5e-15rel ≤ 1e-09✓
Type 3 SS A8.4220221528.4220221521.5e-15rel ≤ 1e-09✓
Type 3 F A2.9767902752.9767902751.5e-15rel ≤ 1e-09✓
Type 3 SS B1.575458781.575458781.8e-15rel ≤ 1e-09✓
Type 3 F B1.1137017431.1137017431.8e-15rel ≤ 1e-09✓
Type 3 SS A × B7.2986368137.2986368131.6e-15rel ≤ 1e-09✓
Type 3 F A × B2.5797261872.5797261871.5e-15rel ≤ 1e-09✓
3-way Type III SS A × B × Cf2.4845507972.4845507971.8e-16rel ≤ 1e-09✓
3-way residual SS15.9655055715.965505571.1e-16rel ≤ 1e-09✓
factorial_emm_contrast_vs_statsmodels (cross-check, pass)

Reference: Estimated-marginal-mean contrast via statsmodels OLS t_test on a cell-means model.

quantityoursreferenceerrortolerance
difference of marginal means-0.1657892255-0.16578922550rel ≤ 1e-10✓
SE0.3501801990.3501801991.6e-16rel ≤ 1e-10✓
unadjusted P0.64036230080.64036230080rel ≤ 1e-09✓
Multiple comparisons
tukey_vs_scipy_statsmodels (cross-check, pass)

Reference: scipy.stats.tukey_hsd and statsmodels pairwise_tukeyhsd (unequal n).

quantityoursreferenceerrortolerance
P g0-g1 (scipy)0.77748350140.77748350144.7e-15abs ≤ 1e-06✓
CI lower g0-g1 (scipy)-2.31999541-2.319995414.3e-13abs ≤ 1e-06✓
P g0-g2 (scipy)0.047797253260.047797253268.9e-15abs ≤ 1e-06✓
CI lower g0-g2 (scipy)-3.268806196-3.2688061964e-13abs ≤ 1e-06✓
P g0-g3 (scipy)0.9619628490.9619628492.9e-15abs ≤ 1e-06✓
CI lower g0-g3 (scipy)-1.751097687-1.7510976873.7e-13abs ≤ 1e-06✓
P g1-g2 (scipy)0.37465889340.37465889342.1e-15abs ≤ 1e-06✓
CI lower g1-g2 (scipy)-2.859661548-2.8596615484.4e-13abs ≤ 1e-06✓
P g1-g3 (scipy)0.94473877740.94473877744.1e-15abs ≤ 1e-06✓
CI lower g1-g3 (scipy)-1.355782507-1.3557825074.1e-13abs ≤ 1e-06✓
P g2-g3 (scipy)0.096062258370.096062258378e-15abs ≤ 1e-06✓
CI lower g2-g3 (scipy)-0.1886494865-0.18864948653.9e-13abs ≤ 1e-06✓
P g0-g2 (statsmodels)0.047797253260.047797253268.9e-15abs ≤ 0.001✓
studentized_range_distribution (published, pass)

Reference: Tukey/Harter tables of q(0.95; k, df) and scipy.stats.studentized_range (independent numerical integration).

quantityoursreferenceerrortolerance
q(0.95; 3, 10)3.876776753.8770.00022abs ≤ 0.0005✓
q(0.95; 4, 20)3.9582935613.9580.00029abs ≤ 0.0005✓
q(0.95; 5, 20)4.2318567494.2320.00014abs ≤ 0.0005✓
q(0.95; 2, ∞) = 1.96·√22.7718076492.7718076712.2e-08abs ≤ 1e-06✓
P(Q ≤ 3.0; 3, 10) vs SciPy0.86501658480.86501658485.9e-15abs ≤ 1e-12✓
P(Q ≤ 4.5; 5, 20) vs SciPy0.96627050580.96627050581.2e-14abs ≤ 1e-12✓
P(Q ≤ 2.0; 2, 5) vs SciPy0.78356277070.78356277075.2e-15abs ≤ 1e-12✓
P(Q ≤ 5.5; 10, 60) vs SciPy0.99108929370.99108929372.3e-14abs ≤ 1e-12✓
P(Q ≤ 8.0; 3, 3) vs SciPy0.97781172090.97781172098.9e-15abs ≤ 1e-12✓
P(Q ≤ 1.0; 6, 30) vs SciPy0.020374592610.020374592613e-15abs ≤ 1e-12✓
dunnett_tables (published, pass)

Reference: Dunnett (1955, 1964) two-sided tables at α = 0.05 (equal n), and one-sided df = 12.

quantityoursreferenceerrortolerance
k = 2, df = ∞2.2121277472.210.0021abs ≤ 0.006✓
k = 3, df = ∞2.348970592.350.001abs ≤ 0.006✓
k = 4, df = ∞2.4417707732.440.0018abs ≤ 0.006✓
k = 5, df = ∞2.5114630532.510.0015abs ≤ 0.006✓
k = 9, df = ∞2.6862233672.690.0038abs ≤ 0.006✓
k = 2, df = 122.502366762.50.0024abs ≤ 0.006✓
k = 3, df = 122.6828700632.680.0029abs ≤ 0.006✓
k = 4, df = 122.8070826192.810.0029abs ≤ 0.006✓
one-sided k = 2, df = 122.1080572522.110.0019abs ≤ 0.006✓
k = 1 equals t(0.975, 12)2.178812832.178812839e-14abs ≤ 1e-08✓
dunnett_vs_scipy (cross-check, pass)

Reference: scipy.stats.dunnett (randomized QMC; mean of 10 seeds) on Dunnett's (1955) blood-count data.

quantityoursreferenceerrortolerance
statistic a0.85703212590.85703212591.1e-16abs ≤ 1e-12✓
P a vs control0.620101980.62012698742.5e-05abs ≤ 0.0003✓
P b vs control0.0058253608480.0058227068662.7e-06abs ≤ 0.0003✓
CI lower b0.83972820640.83886911190.00086abs ≤ 0.003✓
p_adjust_vs_statsmodels (cross-check, pass)

Reference: statsmodels.stats.multitest.multipletests.

quantityoursreferenceerrortolerance
maxdifferencebonferroni000
maxdifferencesidak000
maxdifferenceholm000
maxdifferenceholm_sidak000
maxdifferencehochberg000
maxdifferencefdr_bh1.387778781e-1701.4e-17
maxdifferencefdr_by2.775557562e-1702.8e-17
benjamini_hochberg_1995 (published, pass)

Reference: Benjamini & Hochberg (1995), JRSS B 57:289, 15 P values: BH rejects 4, Bonferroni 3 at 0.05.

quantityoursreferenceerrortolerance
BH rejections440exact✓
Bonferroni rejections330exact✓
k2_identities (analytic, pass)

Reference: With 2 groups Tukey = Student t test, Games–Howell = Welch t test, Dunn = Kruskal–Wallis.

quantityoursreferenceerrortolerance
Tukey P = Student P0.17577945840.17577945845.7e-15abs ≤ 1e-08✓
Games–Howell P = Welch P0.14374966940.14374966943.1e-15abs ≤ 1e-08✓
Dunn z² = H2.3557422972.3557422971.1e-15rel ≤ 1e-10✓
Repeated-measures ANOVA
rm_anova_baron_li (published, pass)

Reference: R documentation for mauchly.test / SSD (Baron & Li reaction-time data, 10 subjects × 6 conditions).

Note: R's Mauchly P (0.04765) uses the untransformed dimension (6) in one term of Anderson's second-order correction; we use the transformed dimension (5) throughout and get 0.04758. Using R's term gives 0.047652.

quantityoursreferenceerrortolerance
F (sphericity assumed)38.0279329638.0286.7e-05abs ≤ 0.0005✓
Greenhouse–Geisser ε0.48549176480.48558.2e-06abs ≤ 5e-05✓
Huynh–Feldt ε0.67780749160.67787.5e-06abs ≤ 5e-05✓
Mauchly W0.031084459380.0310844.6e-07abs ≤ 5e-07✓
Mauchly P0.047584669570.047656.5e-05abs ≤ 0.0001✓
Mauchly W (noise × deg)0.89377724930.893782.8e-06abs ≤ 5e-06✓
Mauchly P (noise × deg)0.6381417850.63814.2e-05abs ≤ 5e-05✓
rm_anova_vs_statsmodels (cross-check, pass)

Reference: statsmodels AnovaRM (one and two within factors); Box (1954) epsilon from the covariance matrix.

quantityoursreferenceerrortolerance
one-way F6.6269143586.6269143581.3e-16rel ≤ 1e-10✓
one-way P0.0020302169130.0020302169132.3e-15rel ≤ 1e-09✓
GG ε vs Box's formula0.44370283560.44370283568.8e-16rel ≤ 1e-12✓
two-way F (a)0.49249130430.49249130432.7e-15rel ≤ 1e-10✓
two-way F (b)17.2093374517.209337452.1e-16rel ≤ 1e-10✓
two-way F (a × b)0.95062894650.95062894651.4e-15rel ≤ 1e-10✓
split_plot_hand_formulas (analytic, pass)

Reference: Classical split-plot sums of squares computed by hand formulas (balanced design).

quantityoursreferenceerrortolerance
SS group15.703435615.70343561.6e-15rel ≤ 1e-10✓
SS subjects within groups41.2729481641.272948160rel ≤ 1e-10✓
SS time2.7756279892.7756279899.6e-16rel ≤ 1e-10✓
SS time × group2.8953629732.8953629736.1e-16rel ≤ 1e-10✓
SS total = sum of all rows104.0931066104.09310661.4e-16rel ≤ 1e-10✓
rm_posthoc_and_mixed_missing (cross-check, pass)

Reference: Separate-error RM comparisons equal paired t tests; mixed model with missing values vs statsmodels MixedLM formula interface (same model).

quantityoursreferenceerrortolerance
separate-error comparison P = paired t P0.02060279080.02060279080abs ≤ 1e-12✓
separate-error comparison t-2.87710857-2.877108570abs ≤ 1e-12✓
mixed model REML log-likelihood (4 missing values)-60.08499928-60.084999286.1e-14rel ≤ 1e-06✓
subject variance5.02407685.0240704751.3e-06rel ≤ 0.001✓
residual variance1.3621157181.3621163364.5e-07rel ≤ 0.0001✓
Mixed-effects model
mixed_model_vs_rm_anova (cross-check, pass)

Reference: Balanced complete data: REML random-intercept Wald F equals the sphericity-assumed RM ANOVA F.

quantityoursreferenceerrortolerance
F time0.87404053010.87404053012.6e-12rel ≤ 0.0001✓
F group4.2334262894.2334262897.8e-12rel ≤ 0.0001✓
F time × group0.99658877620.99658877622.6e-12rel ≤ 0.0001✓
REML log-likelihood vs statsmodels formula API-86.97672377-86.976723771.5e-12rel ≤ 1e-06✓
Nonparametric tests
nonparametric_r_examples (published, pass)

Reference: R documentation examples (Hollander & Wolfe data) for wilcox.test, kruskal.test, friedman.test.

quantityoursreferenceerrortolerance
Mann–Whitney W (= U)35350exact✓
Mann–Whitney P (one-sided)0.12720612720.12726.1e-06abs ≤ 5e-05✓
Wilcoxon V (= W+)40400exact✓
Wilcoxon P (one-sided)0.019531250.019531.3e-06abs ≤ 5e-06✓
Kruskal–Wallis H0.77142857140.771431.4e-06abs ≤ 5e-06✓
Kruskal–Wallis P0.67996477360.683.5e-05abs ≤ 0.005✓
Friedman χ²11.1428571411.1430.00014abs ≤ 0.0005✓
Friedman P0.0038050407760.0038054.1e-08abs ≤ 5e-07✓
nonparametric_vs_scipy (cross-check, pass)

Reference: scipy.stats mannwhitneyu, wilcoxon, kruskal, friedmanchisquare (with ties, normal approximation).

quantityoursreferenceerrortolerance
Mann–Whitney U3163160abs ≤ 1e-12✓
Mann–Whitney P (ties)0.48357639340.48357639340rel ≤ 1e-10✓
Mann–Whitney exact P0.063492063490.063492063490abs ≤ 1e-12✓
Wilcoxon P (ties)0.5630714050.5630714050rel ≤ 1e-10✓
Kruskal–Wallis H1.958916281.958916280rel ≤ 1e-10✓
Friedman χ² (ties)2.0243902442.0243902440rel ≤ 1e-10✓
exact_null_distributions (analytic, pass)

Reference: Brute-force enumeration of all rank assignments / sign patterns.

quantityoursreferenceerrortolerance
Mann–Whitney pmf (4, 5): max abs error1.387778781e-1701.4e-17abs ≤ 1e-15✓
signed-rank pmf (8): max abs error000abs ≤ 1e-15✓
hodges_lehmann_definition (analytic, pass)

Reference: Hodges–Lehmann estimators and order-statistic CIs from their definitions.

quantityoursreferenceerrortolerance
shift estimate = median of differences0.3050.3050abs ≤ 1e-12✓
CI lower = d_(c)-0.15-0.150abs ≤ 1e-12✓
CI upper = d_(N+1-c)0.760.760abs ≤ 1e-12✓
achieved coverage0.960039960.960039960abs ≤ 1e-12✓
Correlation
correlation_r_example (published, pass)

Reference: R cor.test documentation example (Hollander & Wolfe): Pearson, Kendall, Spearman.

quantityoursreferenceerrortolerance
Pearson r0.57118155760.57118164.2e-08abs ≤ 5e-08✓
Pearson t1.8410826381.84111.7e-05abs ≤ 5e-05✓
Pearson P0.10817305430.10822.7e-05abs ≤ 5e-05✓
Pearson CI lower-0.149742633-0.14974263.3e-08abs ≤ 5e-08✓
Pearson CI upper0.89557946180.89557953.8e-08abs ≤ 5e-08✓
Kendall tau0.44444444440.44444444.4e-08abs ≤ 5e-08✓
Kendall P (one-sided)0.059719466490.059725.3e-07abs ≤ 5e-06✓
Spearman rho0.60.60abs ≤ 1e-12✓
Spearman exact P0.096797839510.09682.2e-06abs ≤ 5e-05✓
correlation_vs_scipy (cross-check, pass)

Reference: scipy.stats pearsonr (with CI), spearmanr, kendalltau.

quantityoursreferenceerrortolerance
Pearson P0.039496491290.039496491292.3e-15rel ≤ 1e-10✓
Pearson CI lower0.020414997910.020414997910abs ≤ 1e-12✓
Spearman rho0.36195773080.36195773080abs ≤ 1e-12✓
Spearman P (n > 9: t approximation)0.049355612070.049355612070rel ≤ 1e-10✓
Kendall tau-b0.25977011490.25977011490abs ≤ 1e-12✓
Contingency tables
contingency_r_examples (published, pass)

Reference: R chisq.test (Agresti party-by-gender) and fisher.test (tea tasting, job satisfaction) documented output.

Note: The exact upper limit of the tea-tasting odds-ratio CI is 626.24 (the tail probability is exactly 0.025 there); R reports 621.93 because of its root-finder tolerance, so that limit is checked against the defining equation instead.

quantityoursreferenceerrortolerance
χ²30.070149130.070.00015abs ≤ 0.005✓
χ² P2.953589183e-072.954e-074.1e-11abs ≤ 5e-10✓
Fisher P two-sided0.48571428570.48571.4e-05abs ≤ 5e-05✓
Fisher P one-sided0.24285714290.24294.3e-05abs ≤ 5e-05✓
conditional MLE odds ratio6.4083196586.4083091.1e-05abs ≤ 5e-05✓
exact CI lower0.21173559540.21173292.7e-06abs ≤ 5e-06✓
exact CI upper: P(X <= 3upper) = 0.0250.0250.0253.5e-18abs ≤ 1e-10
one-sided CI lower0.31357376750.31356934.5e-06abs ≤ 5e-06✓
Freeman–Halton P (4 × 4 job satisfaction)0.7826849390.78271.5e-05abs ≤ 5e-05✓
risk_ratio_odds_ratio_published (published, pass)

Reference: Agresti, Categorical Data Analysis: Physicians' Health Study (OR 1.83, 95% CI 1.44–2.33); Koopman (1984) score interval 36/40 vs 16/80 (2.94–7.15); Newcombe (1998) method 10, 56/70 − 48/80 (0.0524–0.3339); Newcombe (1998) Wilson interval 81/263 (0.2553–0.3662).

quantityoursreferenceerrortolerance
odds ratio1.8320539421.830.0021abs ≤ 0.005✓
OR CI lower1.4400423921.444.2e-05abs ≤ 0.005✓
OR CI upper2.330779752.330.00078abs ≤ 0.005✓
relative risk1.8178017941.820.0022abs ≤ 0.005✓
Koopman lower2.9395691922.940.00043abs ≤ 0.005✓
Koopman upper7.1522234357.150.0022abs ≤ 0.005✓
Newcombe lower0.05243147240.05243.1e-05abs ≤ 5e-05✓
Newcombe upper0.3338726540.33392.7e-05abs ≤ 5e-05✓
Wilson lower0.25528851990.25531.1e-05abs ≤ 5e-05✓
Wilson upper0.3662095770.36629.6e-06abs ≤ 5e-05✓
contingency_vs_scipy_statsmodels (cross-check, pass)

Reference: scipy chi2_contingency (Yates), scipy fisher_exact, statsmodels Table2x2 and mcnemar.

quantityoursreferenceerrortolerance
Yates χ²1.4559963791.4559963790rel ≤ 1e-12✓
Yates P0.22756821460.22756821460rel ≤ 1e-12✓
Woolf OR CI lower0.73352964710.73352964711.5e-16rel ≤ 1e-10✓
Katz RR CI upper3.0436890353.0436890354.4e-16rel ≤ 1e-10✓
G statistic2.4600430082.4600430080rel ≤ 1e-10✓
Fisher P [[8, 2], [1, 5]]0.034965034970.034965034970abs ≤ 1e-12✓
Freeman–Halton P = Fisher P [[8, 2], [1, 5]]0.034965034970.034965034971.5e-16abs ≤ 1e-12✓
Fisher P [[20, 15], [5, 30]]0.00036743402760.00036743402760abs ≤ 1e-12✓
Freeman–Halton P = Fisher P [[20, 15], [5, 30]]0.00036743402760.00036743402764.4e-18abs ≤ 1e-12✓
Fisher P [[0, 7], [6, 2]]0.0069930069930.0069930069930abs ≤ 1e-12✓
Freeman–Halton P = Fisher P [[0, 7], [6, 2]]0.0069930069930.0069930069934.3e-18abs ≤ 1e-12✓
McNemar χ² P (corrected)4.114562281e-054.114562281e-050rel ≤ 1e-12✓
McNemar exact P0.14599609380.14599609380abs ≤ 1e-12✓
freeman_halton_vs_permutation (cross-check, pass)

Reference: scipy fisher_exact with 200,000 seeded Monte Carlo tables (2 × 3).

quantityoursreferenceerrortolerance
exact P vs Monte Carlo0.008674417370.008609956956.4e-05abs ≤ 0.001✓
two_by_two_zero_cells (analytic, pass)

Reference: Limits with zero counts: Koopman upper limit unbounded when the control risk is 0; Clopper–Pearson and Wilson limits at 0 and n.

quantityoursreferenceerrortolerance
Koopman upper limit unbounded (null)110exact✓
Koopman lower limit finite and > 1110exact✓
Clopper–Pearson upper for 0/20 = 1 − 0.025^(1/20)0.1684334710.1684334718.3e-17abs ≤ 1e-12✓
Clopper–Pearson lower for 0/20000exact✓
Clopper–Pearson lower for 20/20 = 0.025^(1/20)0.8315665290.8315665291.1e-16abs ≤ 1e-12✓
Woolf interval uses the 0.5 correction110exact✓
Survival
kaplan_meier_6mp (published, pass)

Reference: Freireich et al. (1963) 6-MP leukaemia data; KM estimates and Greenwood SE as tabulated in Kleinbaum & Klein, Survival Analysis; median CIs from R survfit (conf.type = 'log').

quantityoursreferenceerrortolerance
S(6)0.85714285710.8570.00014abs ≤ 0.0005✓
S(7)0.80672268910.8070.00028abs ≤ 0.0005✓
S(10)0.75294117650.7535.9e-05abs ≤ 0.0005✓
S(13)0.69019607840.690.0002abs ≤ 0.0005✓
S(16)0.62745098040.6270.00045abs ≤ 0.0005✓
S(22)0.53781512610.5380.00018abs ≤ 0.0005✓
S(23)0.44817927170.4480.00018abs ≤ 0.0005✓
Greenwood SE at 60.076360354830.07644e-05abs ≤ 5e-05✓
median 6-MP23230exact✓
median CI lower 6-MP16160exact✓
median placebo880exact✓
median CI placebo lower440exact✓
median CI placebo upper12120exact✓
logrank_cox_6mp (published, pass)

Reference: R survdiff (χ² = 16.8) and coxph (Efron: β = 1.572, SE 0.412, LR 16.35) on the 6-MP data; Kleinbaum & Klein (Breslow ties: β = 1.509, SE 0.410).

quantityoursreferenceerrortolerance
log-rank χ²16.7929409916.80.0071abs ≤ 0.05✓
Cox β (Efron)1.5721251491.57212.5e-05abs ≤ 5e-05✓
Cox SE (Efron)0.41239671770.41243.3e-06abs ≤ 5e-05✓
Cox hazard ratio (Efron)4.8168738984.8170.00013abs ≤ 0.0005✓
Cox LR χ² (Efron)16.3516908416.350.0017abs ≤ 0.005✓
Cox β (Breslow)1.5091914131.5090.00019abs ≤ 0.0005✓
Cox SE (Breslow)0.40956440640.410.00044abs ≤ 0.0005✓
survival_vs_lifelines_statsmodels (cross-check, pass)

Reference: lifelines (KaplanMeierFitter, logrank_test, CoxPHFitter) and statsmodels survdiff.

quantityoursreferenceerrortolerance
log-log CI lower at 60.61971795530.61971795531.1e-16abs ≤ 1e-10✓
log-log CI lower at 130.43161022250.43161022251.7e-16abs ≤ 1e-10✓
log-log CI lower at 230.1880520060.1880520068.3e-17abs ≤ 1e-10✓
logrank χ² vs lifelines16.7929409916.792940996.3e-16rel ≤ 1e-10✓
logrank χ² vs statsmodels16.7929409916.792940992.1e-16rel ≤ 1e-10✓
gehan_breslow_wilcoxon χ² vs lifelines13.4578520513.457852052.6e-16rel ≤ 1e-10✓
gehan_breslow_wilcoxon χ² vs statsmodels13.4578520513.457852052.6e-16rel ≤ 1e-10✓
tarone_ware χ² vs lifelines15.123575315.12357539.4e-16rel ≤ 1e-10✓
tarone_ware χ² vs statsmodels15.123575315.12357532.3e-16rel ≤ 1e-10✓
Cox β x1 vs lifelines0.58618184650.58618166443.1e-07rel ≤ 1e-05✓
Cox SE x2 vs lifelines0.27880710850.27880710232.2e-08rel ≤ 0.0001✓
concordance vs lifelines0.69833830420.69833830420abs ≤ 1e-06✓
survival_edge_cases (cross-check, pass)

Reference: lifelines multivariate_logrank_test (3 groups) and KaplanMeierFitter with tied event/censoring times; trend test from its definition.

quantityoursreferenceerrortolerance
3-group log-rank χ²1.4743793611.4743793619e-16rel ≤ 1e-10✓
3-group df220exact✓
S(0.6) with ties110abs ≤ 1e-12✓
S(3.6) with ties0.7776669990.7776669992.2e-16abs ≤ 1e-12✓
S(7) with ties0.54507512130.54507512132.2e-16abs ≤ 1e-12✓
S(14) with ties0.38155258490.38155258495.6e-17abs ≤ 1e-12✓
S(26) with ties0.2146233290.2146233298.3e-17abs ≤ 1e-12✓
trend χ² ≤ overall χ² (projection)0.70890405981.474379361-0.77≤ reference + 1e-09✓
ROC curves
roc_hanley_mcneil (published, pass)

Reference: Hanley & McNeil (1982), Radiology 143:29, CT rating data (58 normal, 51 abnormal): AUC 0.893, SE 0.032.

quantityoursreferenceerrortolerance
AUC0.89317106150.8930.00017abs ≤ 0.0005✓
SE (Hanley–McNeil)0.032486579610.0320.00049abs ≤ 0.0005✓
roc_cross_checks (cross-check, pass)

Reference: AUC = U / (n1 n0) (scipy mannwhitneyu); DeLong SE vs the midrank algorithm of Sun & Xu (2014).

quantityoursreferenceerrortolerance
AUC = U/(n1 n0)0.67958333330.67958333330abs ≤ 1e-14✓
DeLong SE0.064271822480.064271822480rel ≤ 1e-12✓
Bland–Altman
bland_altman_1986 (published, pass)

Reference: Bland & Altman (1986), Lancet i:307, peak expiratory flow (Wright vs mini Wright): bias −2.1, SD 38.8, limits −79.7 to 75.5 (mean ± 2 SD, from rounded values).

quantityoursreferenceerrortolerance
bias-2.117647059-2.10.018abs ≤ 0.05✓
SD of differences38.7651298738.80.035abs ≤ 0.05✓
lower limit-79.64790681-79.70.052abs ≤ 0.1✓
upper limit75.4126126975.50.087abs ≤ 0.1✓
Linear regression
nist_lls_Norris (NIST, pass)

Reference: NIST StRD linear least squares 'Norris' (lower difficulty).

quantityoursreferenceerrortolerance
B0-0.2623230738-0.2623230738LRE 12.3LRE ≥ 11✓
B11.0021168181.002116818LRE 14.3LRE ≥ 11✓
SD(B0)0.23281823430.2328182343LRE 13.9LRE ≥ 11✓
SD(B1)0.00042979684820.0004297968482LRE 13.9LRE ≥ 11✓
residual SD0.88479639610.8847963961LRE 13.9LRE ≥ 11✓
R²0.99999374590.9999937459LRE 15.0LRE ≥ 11✓
nist_lls_Pontius (NIST, pass)

Reference: NIST StRD linear least squares 'Pontius' (lower difficulty).

quantityoursreferenceerrortolerance
B00.00067356578950.0006735657895LRE 12.5LRE ≥ 11✓
B17.320591604e-077.320591604e-07LRE 15.0LRE ≥ 11✓
B2-3.160818713e-15-3.160818713e-15LRE 13.6LRE ≥ 11✓
SD(B0)0.0001079386120.000107938612LRE 14.0LRE ≥ 11✓
SD(B1)1.578174e-101.578174e-10LRE 14.1LRE ≥ 11✓
SD(B2)4.8665285e-174.8665285e-17LRE 14.0LRE ≥ 11✓
residual SD0.00020517742410.0002051774241LRE 14.0LRE ≥ 11✓
R²0.99999990020.9999999002LRE 15.0LRE ≥ 11✓
nist_lls_NoInt1 (NIST, pass)

Reference: NIST StRD linear least squares 'NoInt1' (average difficulty).

quantityoursreferenceerrortolerance
B02.0743801652.074380165LRE 14.7LRE ≥ 11✓
SD(B0)0.016528925620.01652892562LRE 15.0LRE ≥ 11✓
residual SD3.567530343.56753034LRE 15.0LRE ≥ 11✓
R²0.99936549230.9993654923LRE 15.0LRE ≥ 11✓
nist_lls_NoInt2 (NIST, pass)

Reference: NIST StRD linear least squares 'NoInt2' (average difficulty).

quantityoursreferenceerrortolerance
B00.72727272730.7272727273LRE 15.0LRE ≥ 11✓
SD(B0)0.042082731810.04208273181LRE 14.9LRE ≥ 11✓
residual SD0.36927447290.3692744729LRE 15.0LRE ≥ 11✓
R²0.99334811530.9933481153LRE 15.0LRE ≥ 11✓
nist_lls_Filip (NIST, pass)

Reference: NIST StRD linear least squares 'Filip' (higher difficulty).

quantityoursreferenceerrortolerance
B0-1467.489644-1467.489614LRE 7.7LRE ≥ 7✓
B1-2772.179649-2772.179592LRE 7.7LRE ≥ 7✓
B2-2316.371129-2316.371082LRE 7.7LRE ≥ 7✓
B3-1127.973964-1127.973941LRE 7.7LRE ≥ 7✓
B4-354.4782412-354.4782337LRE 7.7LRE ≥ 7✓
B5-75.12420335-75.12420174LRE 7.7LRE ≥ 7✓
B6-10.87531827-10.87531804LRE 7.7LRE ≥ 7✓
B7-1.06221501-1.062214986LRE 7.6LRE ≥ 7✓
B8-0.06701911702-0.06701911546LRE 7.6LRE ≥ 7✓
B9-0.002467810842-0.002467810783LRE 7.6LRE ≥ 7✓
B10-4.029625352e-05-4.029625251e-05LRE 7.6LRE ≥ 7✓
SD(B0)298.0845352298.084531LRE 7.8LRE ≥ 7✓
SD(B1)559.7798735559.7798655LRE 7.8LRE ≥ 7✓
SD(B2)466.4775788466.4775721LRE 7.8LRE ≥ 7✓
SD(B3)227.2042778227.2042745LRE 7.8LRE ≥ 7✓
SD(B4)71.6478671471.64786609LRE 7.8LRE ≥ 7✓
SD(B5)15.289718115.28971787LRE 7.8LRE ≥ 7✓
SD(B6)2.2369116322.236911598LRE 7.8LRE ≥ 7✓
SD(B7)0.22162432530.2216243219LRE 7.8LRE ≥ 7✓
SD(B8)0.014236376540.01423637632LRE 7.8LRE ≥ 7✓
SD(B9)0.00053561741750.0005356174089LRE 7.8LRE ≥ 7✓
SD(B10)8.96632852e-068.966328374e-06LRE 7.8LRE ≥ 7✓
residual SD0.0033480105580.003348010513LRE 7.9LRE ≥ 7✓
R²0.99672741610.9967274162LRE 10.1LRE ≥ 7✓
nist_lls_Longley (NIST, pass)

Reference: NIST StRD linear least squares 'Longley' (higher difficulty).

quantityoursreferenceerrortolerance
B0-3482258.635-3482258.635LRE 12.3LRE ≥ 9✓
B115.0618722715.06187227LRE 10.8LRE ≥ 9✓
B2-0.03581917929-0.03581917929LRE 11.9LRE ≥ 9✓
B3-2.020229804-2.020229804LRE 12.9LRE ≥ 9✓
B4-1.033226867-1.033226867LRE 13.1LRE ≥ 9✓
B5-0.05110410565-0.05110410565LRE 11.4LRE ≥ 9✓
B61829.1514651829.151465LRE 12.3LRE ≥ 9✓
SD(B0)890420.3836890420.3836LRE 13.5LRE ≥ 9✓
SD(B1)84.9149257784.91492577LRE 12.6LRE ≥ 9✓
SD(B2)0.033491007770.03349100777LRE 13.4LRE ≥ 9✓
SD(B3)0.48839968170.4883996817LRE 12.8LRE ≥ 9✓
SD(B4)0.21427416320.2142741632LRE 13.0LRE ≥ 9✓
SD(B5)0.22607320010.2260732001LRE 13.2LRE ≥ 9✓
SD(B6)455.4784991455.4784991LRE 13.4LRE ≥ 9✓
residual SD304.8540736304.8540736LRE 12.9LRE ≥ 9✓
R²0.99547900460.9954790046LRE 14.8LRE ≥ 9✓
nist_lls_Wampler1 (NIST, pass)

Reference: NIST StRD linear least squares 'Wampler1' (higher difficulty).

quantityoursreferenceerrortolerance
B00.99999999961LRE 9.4LRE ≥ 9✓
B10.99999999991LRE 10.1LRE ≥ 9✓
B211LRE 10.2LRE ≥ 9✓
B311LRE 11.0LRE ≥ 9✓
B411LRE 12.2LRE ≥ 9✓
B511LRE 13.9LRE ≥ 9✓
SD(B0)2.785904693e-100LRE 9.6LRE ≥ 9✓
SD(B1)3.059308448e-100LRE 9.5LRE ≥ 9✓
SD(B2)1.008758215e-100LRE 10.0LRE ≥ 9✓
SD(B3)1.313467664e-110LRE 10.9LRE ≥ 9✓
SD(B4)7.307574761e-130LRE 12.1LRE ≥ 9✓
SD(B5)1.453898266e-140LRE 13.8LRE ≥ 9✓
residual SD3.054898907e-100LRE 9.5LRE ≥ 9✓
R²11LRE 15.0LRE ≥ 9✓
nist_lls_Wampler2 (NIST, pass)

Reference: NIST StRD linear least squares 'Wampler2' (higher difficulty).

quantityoursreferenceerrortolerance
B011LRE 15.0LRE ≥ 9✓
B10.10.1LRE 13.6LRE ≥ 9✓
B20.010.01LRE 12.9LRE ≥ 9✓
B30.0010.001LRE 12.8LRE ≥ 9✓
B40.00010.0001LRE 13.1LRE ≥ 9✓
B51e-051e-05LRE 13.9LRE ≥ 9✓
SD(B0)4.744630559e-150LRE 14.3LRE ≥ 9✓
SD(B1)5.210260203e-150LRE 14.3LRE ≥ 9✓
SD(B2)1.718000283e-150LRE 14.8LRE ≥ 9✓
SD(B3)2.236946164e-160LRE 15.0LRE ≥ 9✓
SD(B4)1.244541589e-170LRE 15.0LRE ≥ 9✓
SD(B5)2.476111318e-190LRE 15.0LRE ≥ 9✓
residual SD5.202750382e-150LRE 14.3LRE ≥ 9✓
R²11LRE 15.0LRE ≥ 9✓
nist_lls_Wampler3 (NIST, pass)

Reference: NIST StRD linear least squares 'Wampler3' (higher difficulty).

quantityoursreferenceerrortolerance
B00.99999999961LRE 9.5LRE ≥ 9✓
B111LRE 10.3LRE ≥ 9✓
B211LRE 10.2LRE ≥ 9✓
B311LRE 11.0LRE ≥ 9✓
B411LRE 12.2LRE ≥ 9✓
B511LRE 13.9LRE ≥ 9✓
SD(B0)2152.3262472152.326247LRE 13.8LRE ≥ 9✓
SD(B1)2363.5517352363.551735LRE 13.9LRE ≥ 9✓
SD(B2)779.3435243779.3435243LRE 13.8LRE ≥ 9✓
SD(B3)101.4755076101.4755076LRE 13.9LRE ≥ 9✓
SD(B4)5.6456651225.645665122LRE 13.8LRE ≥ 9✓
SD(B5)0.11232485470.1123248547LRE 13.8LRE ≥ 9✓
residual SD2360.1450242360.145024LRE 14.1LRE ≥ 9✓
R²0.9999955590.999995559LRE 15.0LRE ≥ 9✓
nist_lls_Wampler4 (NIST, pass)

Reference: NIST StRD linear least squares 'Wampler4' (higher difficulty).

quantityoursreferenceerrortolerance
B00.99999999871LRE 8.9LRE ≥ 8✓
B11.0000000011LRE 8.8LRE ≥ 8✓
B20.99999999961LRE 9.4LRE ≥ 8✓
B311LRE 10.3LRE ≥ 8✓
B411LRE 11.6LRE ≥ 8✓
B511LRE 13.3LRE ≥ 8✓
SD(B0)215232.6247215232.6247LRE 14.3LRE ≥ 8✓
SD(B1)236355.1735236355.1735LRE 14.4LRE ≥ 8✓
SD(B2)77934.3524377934.35243LRE 14.2LRE ≥ 8✓
SD(B3)10147.5507610147.55076LRE 14.6LRE ≥ 8✓
SD(B4)564.5665122564.5665122LRE 14.3LRE ≥ 8✓
SD(B5)11.2324854711.23248547LRE 14.3LRE ≥ 8✓
residual SD236014.5024236014.5024LRE 14.9LRE ≥ 8✓
R²0.95747844080.9574784408LRE 15.0LRE ≥ 8✓
nist_lls_Wampler5 (NIST, pass)

Reference: NIST StRD linear least squares 'Wampler5' (higher difficulty).

quantityoursreferenceerrortolerance
B00.99999990551LRE 7.0LRE ≥ 6✓
B11.0000001481LRE 6.8LRE ≥ 6✓
B20.99999995121LRE 7.3LRE ≥ 6✓
B31.0000000061LRE 8.2LRE ≥ 6✓
B40.99999999971LRE 9.5LRE ≥ 6✓
B511LRE 11.2LRE ≥ 6✓
SD(B0)21523262.4721523262.47LRE 14.3LRE ≥ 6✓
SD(B1)23635517.3523635517.35LRE 14.4LRE ≥ 6✓
SD(B2)7793435.2437793435.243LRE 14.2LRE ≥ 6✓
SD(B3)1014755.0761014755.076LRE 14.6LRE ≥ 6✓
SD(B4)56456.6512256456.65122LRE 14.3LRE ≥ 6✓
SD(B5)1123.2485471123.248547LRE 14.3LRE ≥ 6✓
residual SD23601450.2423601450.24LRE 14.8LRE ≥ 6✓
R²0.0022466892160.002246689216LRE 13.8LRE ≥ 6✓
linear_regression_vs_statsmodels (cross-check, pass)

Reference: statsmodels OLS: confidence and prediction bands, comparison of slopes/intercepts (nested F tests).

quantityoursreferenceerrortolerance
confidence band lower3.9618912263.9618912260rel ≤ 1e-10✓
prediction band upper6.1763931786.1763931780rel ≤ 1e-10✓
slope P0.00020672316720.00020672316722.1e-15rel ≤ 1e-09✓
slopes F4.9386548924.9386548921.3e-15rel ≤ 1e-10✓
intercepts F35.3736978335.373697832e-16rel ≤ 1e-10✓
common slope0.60800208520.60800208523.7e-16rel ≤ 1e-10✓
regression_diagnostics_vs_statsmodels (cross-check, pass)

Reference: statsmodels het_breuschpagan (Koenker form) and variance_inflation_factor.

quantityoursreferenceerrortolerance
Breusch–Pagan LM3.8815048223.8815048221.4e-15rel ≤ 1e-09✓
Breusch–Pagan P0.27454702910.27454702918.1e-16rel ≤ 1e-09✓
VIF x11.1749754051.1749754053.8e-16rel ≤ 1e-09✓
VIF x21.1926407291.1926407291.9e-16rel ≤ 1e-09✓
VIF x31.0175864931.0175864930rel ≤ 1e-09✓
linear_regression_datasets (cross-check, pass)

Reference: Each line = linear_regression on that data set; scipy.stats.linregress.

quantityoursreferenceerrortolerance
W1 slope = linear_regression0.0089281443410.0089281443410exact✓
W1 slope CI upper = linear_regression0.010340336690.010340336690exact✓
W1 slope vs linregress0.0089281443410.0089281443413.9e-16rel ≤ 1e-12✓
W1 slope SE vs linregress0.00057713249760.00057713249765.6e-16rel ≤ 1e-10✓
W1 R² vs linregress0.97554172890.97554172890rel ≤ 1e-12✓
W2 slope = linear_regression0.020083516480.020083516480exact✓
W2 slope CI upper = linear_regression0.0219184390.0219184390exact✓
W2 slope vs linregress0.020083516480.020083516483.5e-16rel ≤ 1e-12✓
W2 slope SE vs linregress0.00074989318210.00074989318211.5e-14rel ≤ 1e-10✓
W2 R² vs linregress0.99170430560.99170430561.1e-16rel ≤ 1e-12✓
W3 slope = linear_regression0.029282877340.029282877340exact✓
W3 slope CI upper = linear_regression0.029893682450.029893682450exact✓
W3 slope vs linregress0.029282877340.029282877341.2e-16rel ≤ 1e-12✓
W3 slope SE vs linregress0.00024962284870.00024962284876.3e-14rel ≤ 1e-10✓
W3 R² vs linregress0.99956418410.99956418410rel ≤ 1e-12✓
W4 slope = linear_regression0.040214539010.040214539010exact✓
W4 slope CI upper = linear_regression0.041508389710.041508389710exact✓
W4 slope vs linregress0.040214539010.040214539010rel ≤ 1e-12✓
W4 slope SE vs linregress0.00052876882530.00052876882533.5e-14rel ≤ 1e-10✓
W4 R² vs linregress0.99896374540.99896374541.1e-16rel ≤ 1e-12✓
W5 slope = linear_regression0.051097760.051097760exact✓
W5 slope CI upper = linear_regression0.052095552030.052095552030exact✓
W5 slope vs linregress0.051097760.051097761.4e-16rel ≤ 1e-12✓
W5 slope SE vs linregress0.00040777604120.00040777604128.8e-14rel ≤ 1e-10✓
W5 R² vs linregress0.99961803370.99961803370rel ≤ 1e-12✓
Logistic regression
logistic_challenger (published, pass)

Reference: Dalal, Fowlkes & Hoadley (1989), JASA 84:945, Challenger O-ring data (23 launches): β0 = 15.0429, β1 = −0.2322, SEs 7.3786, 0.1082; deviance 20.315 (null 28.267).

quantityoursreferenceerrortolerance
β015.0429016515.04291.6e-06abs ≤ 5e-05✓
β1-0.2321627442-0.23223.7e-05abs ≤ 5e-05✓
SE β07.3786301327.37863e-05abs ≤ 5e-05✓
SE β10.10823642950.10823.6e-05abs ≤ 5e-05✓
residual deviance20.3151926920.3150.00019abs ≤ 0.0005✓
null deviance28.2671527328.2670.00015abs ≤ 0.0005✓
logistic_vs_newton (cross-check, pass)

Reference: Independent Newton–Raphson maximum-likelihood fit written in this file (grouped binomial data).

quantityoursreferenceerrortolerance
β0-0.2438602793-0.24386027930rel ≤ 1e-08✓
β10.81507503530.81507503532.7e-16rel ≤ 1e-08✓
β2-0.5622871086-0.56228710860rel ≤ 1e-08✓
SE β00.13659000680.13659000685.3e-11rel ≤ 1e-06✓
SE β10.097456999230.097456999241.2e-10rel ≤ 1e-06✓
SE β20.19081509640.19081509645.4e-11rel ≤ 1e-06✓
Poisson regression
poisson_dobson (published, pass)

Reference: Dobson (1990) randomized-trial counts, R glm documentation example: deviance 5.1291, null 10.5814, AIC 56.76.

quantityoursreferenceerrortolerance
intercept3.0445224383.0450.00048abs ≤ 0.0005✓
outcome2-0.4542552723-0.45434.5e-05abs ≤ 5e-05✓
outcome3-0.2929871247-0.2931.3e-05abs ≤ 5e-05✓
residual deviance5.1291410775.12914.1e-05abs ≤ 5e-05✓
null deviance10.5814458610.58144.6e-05abs ≤ 5e-05✓
AIC56.761318456.760.0013abs ≤ 0.005✓
poisson_vs_discrete_model (cross-check, pass)

Reference: statsmodels discrete Poisson model (Newton, separate code path from GLM/IRLS) with exposure offset.

quantityoursreferenceerrortolerance
β00.1580329220.1580329221.9e-11rel ≤ 1e-06✓
β10.4388363040.4388363041.9e-12rel ≤ 1e-06✓
SE β10.083336735470.083336839251.2e-06rel ≤ 1e-05✓
log-likelihood-101.888304-101.8883040rel ≤ 1e-09✓
PCA
pca_cross_checks (cross-check, pass)

Reference: Eigen-decomposition of the correlation matrix (numpy.linalg.eigh); statsmodels PCA.

quantityoursreferenceerrortolerance
eigenvalue 1 vs eigh2.1073858632.1073858630rel ≤ 1e-10✓
eigenvalue 2 vs eigh1.7894869811.7894869812.5e-16rel ≤ 1e-10✓
eigenvalue 3 vs eigh0.98835003440.98835003441.8e-15rel ≤ 1e-10✓
eigenvalue 4 vs eigh0.062380156060.062380156064.8e-15rel ≤ 1e-10✓
eigenvalue 5 vs eigh0.052396965940.052396965945.6e-15rel ≤ 1e-10✓
variance proportion 1 vs statsmodels0.42147717250.42147717251.1e-15rel ≤ 1e-10✓
variance proportion 2 vs statsmodels0.35789739620.35789739624.7e-16rel ≤ 1e-10✓
variance proportion 3 vs statsmodels0.19767000690.19767000692.4e-15rel ≤ 1e-10✓
score covariance off-diagonal9.451129338e-1609.5e-16abs ≤ 1e-10✓
Kaiser count = eigenvalues > 1220exact✓
Area under curve
auc_analytic (analytic, pass)

Reference: Closed-form areas of piecewise-linear curves and ∫₀^π sin = 2.

quantityoursreferenceerrortolerance
net area000abs ≤ 1e-15✓
positive area0.50.50abs ≤ 1e-15✓
alternating: positive0.750.750abs ≤ 1e-15✓
alternating: number of regions440exact✓
∫ sin (2001 points)1.99999958924.1e-07abs ≤ 1e-06✓
area above baseline 2770abs ≤ 1e-15✓
SE = sqrt(Σ (w·SE)²)0.29154759470.29154759470abs ≤ 1e-15✓
auc_se_monte_carlo (cross-check, pass)

Reference: Monte Carlo SD of areas of 40,000 simulated curves (seeded).

quantityoursreferenceerrortolerance
SE vs simulated SD2.058063412.0575689120.00024rel ≤ 0.01✓
Outliers
grubbs_nist (published, pass)

Reference: NIST/SEMATECH e-Handbook §1.3.5.17.1, Tietjen–Moore mass-spectrometer data: G = 2.4687, one-sided critical value 2.032 (α = 0.05).

quantityoursreferenceerrortolerance
G2.4687646112.46876.5e-05abs ≤ 0.0001✓
one-sided critical value2.0316520022.0320.00035abs ≤ 0.0005✓
outlier found110exact✓
rout_motulsky_brown (published, pass)

Reference: Motulsky & Brown (2006), BMC Bioinformatics 7:123, Table 1 (N = 13, K = 3): t ratios, P values, thresholds; Q = 1% flags only the point at time 3, Q = 5% flags times 1 and 3.

quantityoursreferenceerrortolerance
t ratio (time 3)5.0506734595.050.00067abs ≤ 0.005✓
t ratio (time 1)3.8707218373.870.00072abs ≤ 0.005✓
t ratio (time 2)1.3867275041.390.0033abs ≤ 0.005✓
P (time 1)0.0031055066850.00315.5e-06abs ≤ 5e-05✓
P (time 3)0.00049875426060.00051.2e-06abs ≤ 5e-05✓
threshold rank 12, Q = 1%0.0015384615380.00153.8e-05abs ≤ 5e-05✓
outliers at Q = 1%110exact✓
outliers at Q = 5%220exact✓
Power and sample size
power_published (published, pass)

Reference: R power.t.test, power.anova.test and power.prop.test documented examples; Cohen (1988) Table 2.4.1.

Note: R's power.t.test counts one tail by default (strict = FALSE); we count both, which changes the 7th digit here. R's anova and proportion results differ in the 5th digit through its root-finder tolerance.

quantityoursreferenceerrortolerance
t test power, n = 20, d = 10.86895302770.86895282.3e-07abs ≤ 5e-07✓
t test n for 90% power, d = 122.0210884322.02111.2e-05abs ≤ 5e-05✓
Cohen n per group d = 0.563.76561019640.23abs ≤ 1✓
Cohen n per group d = 0.825.52457184260.48abs ≤ 1✓
Cohen n per group d = 0.2393.4056953930.41abs ≤ 1✓
ANOVA n (4 groups, f = 0.5, 80%)11.9261111711.926131.9e-05abs ≤ 0.0001✓
proportions n (0.5 vs 0.75, 90%)76.7069161276.70.0069abs ≤ 0.05✓
power_vs_statsmodels (cross-check, pass)

Reference: statsmodels.stats.power (TTestIndPower, TTestPower, FTestAnovaPower, NormalIndPower); Fleiss closed form.

quantityoursreferenceerrortolerance
two-sample n63.7656101963.765610596.2e-09rel ≤ 1e-06✓
two-sample power, ratio 20.43476751150.43476751150rel ≤ 1e-10✓
paired power0.58042710890.58042710890rel ≤ 1e-10✓
one-sided power0.50668652250.50668652250rel ≤ 1e-10✓
ANOVA power0.25359551920.25359551920rel ≤ 1e-10✓
arcsine n76.6529403676.652940372e-10rel ≤ 1e-06✓
normal-approximation n vs Fleiss closed form76.7069161276.706928451.6e-07rel ≤ 0.0001✓
Simulation
coverage_t_and_effect_size (simulation, pass)

Reference: 95% CIs over 2,000 seeded data sets.

quantityoursreferenceerrortolerance
Welch CI of the difference (n = 8, 15; SD 1, 3)0.9530.950.003abs ≤ 0.0156✓
Cohen's d noncentral-t CI (d = 0.8, n = 12 + 12)0.960.950.01abs ≤ 0.0156✓
paired CI (n = 10)0.9580.950.008abs ≤ 0.0156✓
coverage_rank_based (simulation, pass)

Reference: Hodges–Lehmann CIs over 2,000 seeded data sets (exact intervals: coverage = achieved level).

quantityoursreferenceerrortolerance
Mann–Whitney shift CI (exponential, n = 10, 12)0.9610.95742956730.0036abs ≤ 0.0145✓
signed-rank pseudo-median CI (t4, n = 15)0.9420.95208740230.01abs ≤ 0.0153✓
coverage_correlation_survival_roc (simulation, pass)

Reference: 95% CIs over 1,000 seeded data sets.

quantityoursreferenceerrortolerance
Pearson r Fisher-z CI (ρ = 0.5, n = 25)0.9420.950.008abs ≤ 0.0217✓
Kaplan–Meier log-log CI at the true median (n = 60, ~30% censored)0.9510.950.001abs ≤ 0.0217✓
AUC DeLong CI (binormal, AUC = 0.760, n = 40 + 40)0.9450.950.005abs ≤ 0.0217✓
error_rates_under_null (simulation, pass)

Reference: Type I error / family-wise error rate at α = 0.05 over 2,000 seeded null data sets.

quantityoursreferenceerrortolerance
Welch ANOVA (unequal SDs and n)0.04850.050.0015abs ≤ 0.0156✓
Games–Howell family-wise (unequal SDs and n)0.04750.050.0025abs ≤ 0.0256✓
Tukey family-wise (4 groups)0.0440.050.006abs ≤ 0.0156✓
Dunnett family-wise (3 vs control)0.040.050.01abs ≤ 0.0156✓
Holm–Šidák family-wise (6 comparisons; at most 0.05)0.0320.05-0.018≤ reference + 0.0156✓
rout_false_positives (simulation, pass)

Reference: ROUT (Q = 1%) on 1,000 seeded Gaussian data sets (n = 30): Motulsky & Brown report 1–3% of data sets with a false outlier.

quantityoursreferenceerrortolerance
fraction of data sets with ≥ 1 false outlier (at most 0.03)0.0150.03-0.015≤ reference + 0.0172✓
Other
small_closed_forms (analytic, pass)

Reference: Closed-form values: KM median when S(t) = 0.5 exactly (midpoint convention, as R survfit); 2×2 diagnostic accuracy; chi-square goodness of fit vs scipy.stats.chisquare.

quantityoursreferenceerrortolerance
KM median (S = 0.5 on [2, 3))2.52.50exact✓
sensitivity 45/500.90.90abs ≤ 1e-15✓
specificity 90/1000.90.90abs ≤ 1e-15✓
PPV 45/550.81818181820.81818181820abs ≤ 1e-15✓
LR+ = 0.9 / 0.1991.8e-15abs ≤ 1e-12✓
PPV at prevalence 1% (Bayes)0.083333333330.083333333332.8e-17abs ≤ 1e-12✓
Mendel's peas χ² vs scipy0.47002398080.47002398080rel ≤ 1e-12✓
Mendel's peas P vs scipy0.92542589510.92542589510rel ≤ 1e-12✓
P values from test statistics
p_value_closed_forms (analytic, pass)

Reference: Closed forms: t with 1 df (Cauchy) and 2 df, chi-square with 1 and 2 df, F(2, d2), the normal tail via math.erfc, and r through t with 2 df.

quantityoursreferenceerrortolerance
t = 0.3, df = 10.81445284180.81445284181.4e-16rel ≤ 1e-12✓
t = −0.3, df = 20.79248566080.79248566080rel ≤ 1e-12✓
t = 1, df = 10.50.52.2e-16rel ≤ 1e-12✓
t = −1, df = 20.42264973080.42264973081.3e-16rel ≤ 1e-12✓
t = 2.5, df = 10.24223788320.24223788320rel ≤ 1e-12✓
t = −2.5, df = 20.12961172020.12961172022.1e-16rel ≤ 1e-12✓
t = 12, df = 10.052929352120.052929352129.2e-16rel ≤ 1e-12✓
t = −12, df = 20.0068729336770.0068729336778.8e-16rel ≤ 1e-12✓
χ² = 0.5, df = 20.77880078310.77880078310rel ≤ 1e-12✓
χ² = 0.5, df = 10.47950012220.47950012222.3e-16rel ≤ 1e-12✓
χ² = 3.84146, df = 20.14650006450.14650006450rel ≤ 1e-12✓
χ² = 3.84146, df = 10.050.052.6e-15rel ≤ 1e-12✓
χ² = 10, df = 20.0067379469990.0067379469991.3e-16rel ≤ 1e-12✓
χ² = 10, df = 10.0015654022580.0015654022581.4e-16rel ≤ 1e-12✓
χ² = 40, df = 22.061153622e-092.061153622e-096e-16rel ≤ 1e-12✓
χ² = 40, df = 12.539628589e-102.539628589e-101.2e-15rel ≤ 1e-12✓
F = 0.7, df = (2, 5)0.53947966090.53947966092.1e-16rel ≤ 1e-12✓
F = 3.5, df = (2, 12)0.063469615970.063469615976.6e-16rel ≤ 1e-12✓
F = 9, df = (2, 30.5)0.00084724894430.00084724894435.1e-16rel ≤ 1e-12✓
z = 0.1, two-sided0.92034432540.92034432540rel ≤ 1e-12✓
z = 0.1, one-sided0.46017216270.46017216270rel ≤ 1e-12✓
z = 1.95996, two-sided0.050.058.3e-16rel ≤ 1e-12✓
z = 1.95996, one-sided0.0250.0258.3e-16rel ≤ 1e-12✓
z = 3.3, two-sided0.00096684828480.00096684828481.1e-16rel ≤ 1e-12✓
z = 3.3, one-sided0.00048342414240.00048342414241.1e-16rel ≤ 1e-12✓
z = 6, two-sided1.97317529e-091.97317529e-097.1e-15rel ≤ 1e-12✓
z = 6, one-sided9.86587645e-109.86587645e-107.1e-15rel ≤ 1e-12✓
r = 0.2, df = 20.80.81.4e-16rel ≤ 1e-12✓
r = -0.75, df = 20.250.251.1e-16rel ≤ 1e-12✓
r = 0.99, df = 20.010.011.2e-14rel ≤ 1e-12✓
r = 1 gives P = 0000exact✓
p_value_published (published, pass)

Reference: Critical values printed by R (qt, qchisq, qf, qnorm at 6–7 decimals) give P = 0.05; Student's sleep data (R t.test: paired t = −4.0621, df = 9, P = 0.002833; Welch t = −1.8608, df = 17.776, P = 0.07939).

Note: The sleep-data statistics are printed to 4–5 significant digits, so the P recomputed from them can differ from R's (computed from the unrounded t) by the rounding of t; the tolerance allows for that.

quantityoursreferenceerrortolerance
t = 2.228139, df = 100.049999987450.051.3e-08abs ≤ 2e-07✓
t = 12.706205, df = 10.049999998970.051e-09abs ≤ 2e-08✓
z = 1.9599640.049999998190.051.8e-09abs ≤ 2e-07✓
z = 1.644854, one-sided0.049999961530.053.8e-08abs ≤ 2e-07✓
χ² = 3.841459, df = 10.049999994650.055.3e-09abs ≤ 2e-07✓
χ² = 18.307038, df = 100.050000000820.058.2e-10abs ≤ 2e-08✓
F = 3.098391, df = (3, 20)0.050000009960.051e-08abs ≤ 2e-07✓
paired sleep: t = −4.0621, df = 90.002833007840.0028337.8e-09abs ≤ 5e-06✓
Welch sleep: t = −1.8608, df = 17.7760.079396578140.079396.6e-06abs ≤ 1e-05✓
p_value_vs_quadrature (cross-check, pass)

Reference: Adaptive quadrature (scipy.integrate.quad) of the t, chi-square and F densities written out with log-gamma functions, including fractional degrees of freedom.

quantityoursreferenceerrortolerance
t = 2.1, df = 50.089753249880.089753249881.1e-15rel ≤ 1e-09✓
t = 0.8, df = 17.7760.4342723320.4342723322.3e-15rel ≤ 1e-09✓
t = 4.5, df = 3.40.015615144170.015615144171e-15rel ≤ 1e-09✓
t = 1.3, df = 1200.19609247780.19609247781.4e-16rel ≤ 1e-09✓
χ² = 7.2, df = 30.065789052690.065789052691.1e-15rel ≤ 1e-09✓
χ² = 1.1, df = 0.50.14027460030.14027460032e-16rel ≤ 1e-09✓
χ² = 25, df = 11.50.011690771240.011690771241e-15rel ≤ 1e-09✓
F = 2.7, df = (3, 26)0.066328439040.066328439048e-15rel ≤ 1e-09✓
F = 0.4, df = (4, 9.5)0.80430654660.80430654668.3e-16rel ≤ 1e-09✓
F = 11, df = (1, 40)0.0019461985470.0019461985472.5e-15rel ≤ 1e-09✓
Summary-data tests
summary_t_equals_raw (cross-check, pass)

Reference: The raw-data t tests (themselves validated against R) on Student's sleep data and seeded data, fed their own mean, SD (or SEM) and n; scipy.stats.ttest_ind_from_stats.

quantityoursreferenceerrortolerance
Student t = raw-1.860813467-1.8608134671.2e-16rel ≤ 1e-12✓
Student df = raw18180rel ≤ 1e-12✓
Student P = raw0.079186714220.079186714220rel ≤ 1e-10✓
Student CI lower = raw-3.363874032-3.3638740320rel ≤ 1e-12✓
Student CI upper = raw0.20387403230.20387403231.1e-15rel ≤ 1e-12✓
Student Cohen's d = raw-0.8321810813-0.83218108131.3e-16rel ≤ 1e-12✓
Student Hedges' g CI lower = raw-1.665171791-1.6651717912.7e-16rel ≤ 1e-09✓
Student variance F test P = raw0.74271993170.74271993171.5e-15rel ≤ 1e-10✓
Student t vs ttest_ind_from_stats-1.860813467-1.8608134670rel ≤ 1e-12✓
Student P vs ttest_ind_from_stats0.079186714220.079186714220rel ≤ 1e-10✓
Welch t = raw-1.860813467-1.8608134672.4e-16rel ≤ 1e-12✓
Welch df = raw17.7764735217.776473522e-16rel ≤ 1e-12✓
Welch P = raw0.079394140190.079394140191e-15rel ≤ 1e-10✓
Welch CI lower = raw-3.365483231-3.3654832310rel ≤ 1e-12✓
Welch CI upper = raw0.20548323070.20548323072.2e-15rel ≤ 1e-12✓
Welch Cohen's d = raw-0.8321810813-0.83218108131.3e-16rel ≤ 1e-12✓
Welch Hedges' g CI lower = raw-1.665171791-1.6651717912.7e-16rel ≤ 1e-09✓
Welch variance F test P = raw0.74271993170.74271993171.5e-15rel ≤ 1e-10✓
Welch t vs ttest_ind_from_stats-1.860813467-1.8608134670rel ≤ 1e-12✓
Welch P vs ttest_ind_from_stats0.079394140190.079394140190rel ≤ 1e-10✓
one-sided Welch P (seeded) = raw0.93196473580.93196473580rel ≤ 1e-10✓
one-sided 90% CI lower (seeded) = raw-2.272491593-2.2724915930rel ≤ 1e-12✓
paired t = raw-4.062127683-4.0621276830rel ≤ 1e-12✓
paired P = raw0.0028328901970.0028328901970rel ≤ 1e-10✓
paired CI lower = raw-2.459885763-2.4598857630rel ≤ 1e-12✓
paired Cohen's d_z = raw-1.284557563-1.2845575630rel ≤ 1e-12✓
paired, published R t-4.062127683-4.06212.8e-05abs ≤ 5e-05✓
paired, published R P0.0028328901970.0028331.1e-07abs ≤ 5e-07✓
one-sample from summary = t_test_one_sample0.065059885670.065059885671.7e-15rel ≤ 1e-10✓
summary_anova_plant_growth (published, pass)

Reference: R's PlantGrowth (Dobson 1983): anova(lm()) F = 4.8461, P = 0.01591; TukeyHSD differences, limits and adjusted P; the raw-data one_way_anova (Welch, Brown–Forsythe, Dunnett); scipy.stats.bartlett.

quantityoursreferenceerrortolerance
F (R anova)4.8460878624.84611.2e-05abs ≤ 5e-05✓
P (R anova)0.015909958330.015914.2e-08abs ≤ 5e-06✓
F = raw4.8460878624.8460878625.5e-16rel ≤ 1e-10✓
SS within = raw10.4920910.492090rel ≤ 1e-12✓
Welch F = raw5.1809724085.1809724080rel ≤ 1e-10✓
Welch df2 = raw17.1284186217.128418624.1e-16rel ≤ 1e-10✓
Brown–Forsythe F* = raw4.8460878624.8460878621.8e-16rel ≤ 1e-10✓
ω² = raw0.2040788460.2040788465.4e-16rel ≤ 1e-10✓
Bartlett χ² vs scipy2.8785737872.8785737870rel ≤ 1e-10✓
Bartlett P vs scipy0.23709677360.23709677360rel ≤ 1e-10✓
Tukey ctrl−trt1 difference0.3710.3714.4e-16abs ≤ 5e-12✓
Tukey ctrl−trt1 lower (R)-0.3202160514-0.32021614.9e-08abs ≤ 5e-07✓
Tukey ctrl−trt1 upper (R)1.0622160511.06221614.9e-08abs ≤ 5e-07✓
Tukey ctrl−trt1 adjusted P (R)0.39087114420.39087114.4e-08abs ≤ 5e-07✓
Tukey ctrl−trt2 difference-0.494-0.4946.7e-16abs ≤ 5e-12✓
Tukey ctrl−trt2 lower (R)-1.185216051-1.18521614.9e-08abs ≤ 5e-07✓
Tukey ctrl−trt2 upper (R)0.19721605140.19721614.9e-08abs ≤ 5e-07✓
Tukey ctrl−trt2 adjusted P (R)0.19799599130.1979968.7e-09abs ≤ 5e-07✓
Tukey trt1−trt2 difference-0.865-0.8652.2e-16abs ≤ 5e-12✓
Tukey trt1−trt2 lower (R)-1.556216051-1.55621614.9e-08abs ≤ 5e-07✓
Tukey trt1−trt2 upper (R)-0.1737839486-0.17378394.9e-08abs ≤ 5e-07✓
Tukey trt1−trt2 adjusted P (R)0.012006423980.01200642.4e-08abs ≤ 5e-07✓
Dunnett trt1 adjusted P = raw0.32269568580.32269568586.9e-16rel ≤ 1e-09✓
Dunnett trt2 adjusted P = raw0.15348586150.15348586157.2e-16rel ≤ 1e-09✓
Games–Howell trt1−trt2 adjusted P = raw0.023703454740.023703454740rel ≤ 1e-09✓
F from SEM input = F from SD input4.8460878624.8460878620rel ≤ 1e-12✓
Nested designs
nested_vs_statsmodels (cross-check, pass)

Reference: statsmodels MixedLM (REML, random intercept per subject, cell-means fixed effects) on unbalanced seeded data: group means and the variance components; the REML log-likelihood and the GLS standard errors (X'V⁻¹X)⁻¹ computed with dense matrices.

Note: statsmodels maximises the REML likelihood numerically (about 5 digits); ours solves the REML score equation to full precision, so its likelihood is at least as high. statsmodels' own standard errors come from the Hessian of all parameters, so they are compared through the usual GLS formula (as in R's nlme and lme4) evaluated at statsmodels' variance estimates.

quantityoursreferenceerrortolerance
seed 5: mean G19.5439185679.5439185973.2e-09rel ≤ 1e-05✓
seed 5: SE G1 (GLS)0.28143808420.28143813761.9e-07rel ≤ 0.0001✓
seed 5: mean G210.8926906910.892690693.6e-11rel ≤ 1e-05✓
seed 5: SE G2 (GLS)0.33287395740.33287401621.8e-07rel ≤ 0.0001✓
seed 5: mean G38.5395002828.5395002721.1e-09rel ≤ 1e-05✓
seed 5: SE G3 (GLS)0.26062832540.26062837331.8e-07rel ≤ 0.0001✓
seed 5: subject variance0.17404633370.17404647248e-07rel ≤ 0.0001✓
seed 5: residual variance0.41485599820.4148559391.4e-07rel ≤ 1e-05✓
seed 5: REML log-likelihood (statsmodels − ours ≤ 0)-2.842170943e-130-2.8e-13≤ reference + 1e-10✓
seed 6: mean G110.953112810.953113496.3e-08rel ≤ 1e-05✓
seed 6: SE G1 (GLS)0.29105636760.29105746613.8e-06rel ≤ 0.0001✓
seed 6: mean G211.387829711.387829263.8e-08rel ≤ 1e-05✓
seed 6: SE G2 (GLS)0.2300058850.23000701994.9e-06rel ≤ 0.0001✓
seed 6: subject variance0.058285283240.058287829974.4e-05rel ≤ 0.0001✓
seed 6: residual variance0.45282707210.45282547283.5e-06rel ≤ 1e-05✓
seed 6: REML log-likelihood (statsmodels − ours ≤ 0)-9.248157795e-110-9.2e-11≤ reference + 1e-10✓
seed 6: difference-0.4347169001-0.43471577722.6e-06rel ≤ 1e-05✓
nested_balanced_classical (cross-check, pass)

Reference: Balanced designs with a positive subject variance: the classical nested ANOVA (F = MS groups / MS subjects within groups), Student's t test on the subject means, the ANOVA estimator of the subject variance, and statsmodels anova_lm for the subjects-within-groups F.

quantityoursreferenceerrortolerance
nested F = MS groups / MS subjects3.6793563823.6793563822.1e-15rel ≤ 1e-08✓
nested P0.067954812960.067954812964.9e-15rel ≤ 1e-08✓
df denominator = subjects − groups990exact✓
subject variance = (MS_S − MS_E)/n0.4887938210.4887938214.5e-16rel ≤ 1e-08✓
residual variance = MS_E0.22582122220.22582122221.2e-16rel ≤ 1e-09✓
subjects-within-groups F vs anova_lm7.493550297.493550291.7e-15rel ≤ 1e-09✓
subjects-within-groups P vs anova_lm3.779624785e-053.779624785e-051.3e-14rel ≤ 1e-08✓
nested t = Student t on subject means-2.136752362-2.1367523624.2e-16rel ≤ 1e-08✓
nested P = Student P on subject means0.076492650920.076492650925.4e-16rel ≤ 1e-08✓
nested CI lower = Student CI on subject means-2.875579776-2.8755797760rel ≤ 1e-08✓
nested df660exact✓
Tukey on the nested model = Tukey on subject means (P)0.075839892660.075839892667.3e-15rel ≤ 1e-07✓
Parts of whole
fraction_of_total (cross-check, pass)

Reference: Exact fractions; Wilson and Clopper–Pearson intervals vs statsmodels proportion_confint.

quantityoursreferenceerrortolerance
total1001000exact✓
fraction of part 20.310.310abs ≤ 1e-15✓
percent of part 4990abs ≤ 1e-13✓
fractions sum to 1110abs ≤ 1e-15✓
Wilson lower, part 10.32798382670.32798382670abs ≤ 1e-12✓
Wilson upper, part 10.5179351330.5179351330abs ≤ 1e-12✓
Clopper–Pearson 90% lower, part 10.33647974510.33647974510abs ≤ 1e-12✓
Wilson lower, part 20.22779697210.22779697212.8e-17abs ≤ 1e-12✓
Wilson upper, part 20.40626055720.40626055720abs ≤ 1e-12✓
Clopper–Pearson 90% lower, part 20.23400915020.23400915025.6e-17abs ≤ 1e-12✓
Wilson lower, part 30.1170022550.1170022552.8e-17abs ≤ 1e-12✓
Wilson upper, part 30.26667358390.26667358390abs ≤ 1e-12✓
Clopper–Pearson 90% lower, part 30.1196907780.1196907780abs ≤ 1e-12✓
Wilson lower, part 40.048072540.048072541.4e-17abs ≤ 1e-12✓
Wilson upper, part 40.16226212850.16226212852.8e-17abs ≤ 1e-12✓
Clopper–Pearson 90% lower, part 40.047756635910.047756635910abs ≤ 1e-12✓
decimal parts: 0.3 of 1.0 (exact total)0.30.30abs ≤ 1e-15✓
qPCR (ΔΔCt)
ddct_vs_python_reference (cross-check, pass)

Reference: The independent Python reference (packages/integrations-py, openhagen_integrations.ddct, written from Livak & Schmittgen 2001 and Pfaffl 2001) on the synthetic qPCR export: its recorded output (ddct-expected.json).

Note: Every per-sample ΔCt, ΔΔCt and relative quantity, for Livak (efficiency 2) and the efficiency-corrected ratio (GAPDH 1.95, IL6 1.9, TNF 2.05); the check reports the largest absolute difference over all rows.

quantityoursreferenceerrortolerance
livak: rows12120exact✓
livak: method110exact✓
livak: maxdelta_ct − reference000
livak: maxdelta_delta_ct − reference000
livak: maxrq − reference000
pfaffl: rows12120exact✓
pfaffl: method110exact✓
pfaffl: maxdelta_ct − reference000
pfaffl: maxdelta_delta_ct − reference000
pfaffl: maxrq − reference000
ddct_group_statistics (cross-check, pass)

Reference: Group fold changes and intervals vs scipy.stats.ttest_ind (Welch and Student) on the samples' log2 relative quantities, back-transformed; mean ΔCt intervals vs scipy.stats.t.interval; Livak identity 2^−mean ΔΔCt.

quantityoursreferenceerrortolerance
Welch IL6: P0.00019684750150.00019684750150rel ≤ 1e-10✓
Welch IL6: fold-change CI lower4.1868511564.1868511560rel ≤ 1e-12✓
Welch IL6: fold-change CI upper7.561009227.561009220rel ≤ 1e-12✓
IL6: fold change = 2^−mean ΔΔCt5.6264393895.6264393890rel ≤ 1e-12✓
IL6: mean ΔCt CI lower5.825845485.825845480rel ≤ 1e-12✓
Welch TNF: P0.00011304446640.00011304446640rel ≤ 1e-10✓
Welch TNF: fold-change CI lower1.3224228511.3224228510rel ≤ 1e-12✓
Welch TNF: fold-change CI upper1.5003102691.5003102690rel ≤ 1e-12✓
TNF: fold change = 2^−mean ΔΔCt1.4085611751.4085611757.9e-16rel ≤ 1e-12✓
TNF: mean ΔCt CI lower10.1021792810.102179280rel ≤ 1e-12✓
Student IL6: P6.295988444e-056.295988444e-050rel ≤ 1e-10✓
Student IL6: fold-change CI lower4.2759788234.2759788230rel ≤ 1e-12✓
Student IL6: fold-change CI upper7.4034090217.4034090210rel ≤ 1e-12✓
Student TNF: P0.00011288159550.00011288159550rel ≤ 1e-10✓
Student TNF: fold-change CI lower1.3224300631.3224300630rel ≤ 1e-12✓
Student TNF: fold-change CI upper1.5003020861.5003020860rel ≤ 1e-12✓

Correlation matrices with degenerate columns

Synthetic regression coverage: constant/empty/undersized columns are omitted with named reasons; pairs with fewer than three complete rows or a constant variable on their common rows retain null coefficients and P values and the actual pair count. At least one estimable off-diagonal pair is required. Multiplicity adjustment includes only estimable pairs. Unequal column lengths remain an error. Pearson, Spearman and Kendall coefficients are checked against SciPy. See tests/test_correlation_matrix_degenerate.py; no real lab file is committed.

Non-compartmental pharmacokinetics, pk_nca

Reference: R 4.5.3 with PKNCA 0.12.1. the linear-up/log-down trapezoidal rule; the best-fit adjusted-R² rule for λz) and contains no PKNCA code. PKNCA's options, all its defaults, are stated in the script: linear-up/log-down AUC, at least 3 points for λz, Tmax not in λz, adjusted-R² factor 1e-4, BLQ first "keep", middle "drop", last "keep".

Cases: the 12 Theoph subjects (R datasets), grouped by body weight for the group summaries; constructed profiles with BLQ samples at the dose time, between measurable values and at the end; two points after Tmax; sampling stopped at 9 h; a rising last value; a noisy terminal phase; no sample at the dose time (PKNCA's start_conc0 imputation).

outputminimum agreement (significant digits)
Cmax, Tmax, Tlast, Clast, λz point count and its first and last timesexact
AUC0-t, AUCall14.9
λz, t½, R², adjusted R², span ratio, predicted Clast14.8
AUC0-∞ (observed and predicted Clast), % extrapolated14.6
CL/F, Vz/F (observed and predicted)14.7
group mean, SD, geometric mean and CV, median, min, max14.6

Every NA in PKNCA (λz with two points after Tmax; λz when the best adjusted R² belongs to a fit that does not decline) is null in the engine. Constructed failures: two terminal points fail lambda_z_points; the rising end and the noisy terminal phase (adjusted R² 0.866) fail lambda_z_fit; 66.7% and 31.5% (Theoph subject 1 as measured) extrapolated fail auc_extrapolated; a BLQ sample between measurable values fails blq; a span under two half-lives fails lambda_z_span; negative concentrations, two samples at one time, an IV route (not computed yet), a missing or non-positive dose and fewer than 3 λz points are refused with the reason.

ANCOVA, ancova

The outcome compared between groups adjusted for its baseline (and other pre-treatment covariates). Independent units are fitted by exact least squares in Python; clustered units and repeated outcomes run in the pinned R runtime (models_worker.R, kind "ancova": lme4/lmerTest for random intercepts, mmrm with an unstructured covariance for repeated outcomes (nlme::gls when mmrm cannot fit it), emmeans for every mean and difference).

Independent units: the largest relative difference from R per case and quantity.

casechecksadjusted means, SE, df, F, R²slopes check, group slopesJohnson–Neyman boundsTukey / Bonferroni / HolmDunnettchange / final alternatives
MASS::anorexia (Postwt ~ Treat + Prewt)806.2e-159.5e-143.2e-155.9e-082.0e-059.4e-15
MASS::anorexia, HC3801.6e-139.5e-143.2e-153.4e-081.8e-059.4e-15
MASS::cats (Hwt ~ Sex + Bwt)381.4e-138.1e-151.4e-133.5e-133.7e-129.8e-16
ChickWeight (day 21 ~ Diet + day 0)1271.1e-136.6e-13—1.1e-102.4e-051.5e-15
carData::Baumann (2 covariates)841.3e-143.9e-14—2.1e-095.0e-061.0e-15
MASS::birthwt (race + smoke + lwt)649.5e-157.5e-14—2.1e-102.7e-06—

References: emmeans adjusted means (covariates at their means, equal weights over factor levels) and pairwise / treatment-vs-control contrasts; car::Anova Type II F (white.adjust = "hc3" for HC3); the group × covariate F test of nested lm fits; emtrends group slopes; Johnson–Neyman bounds found by root-finding on emmeans' t ratio along the covariate (independent of the engine's closed form). Tukey uses the studentized range as emmeans does. Dunnett is the single-step exact multivariate t of the adjusted differences (the engine: seeded Genz–Bretz lattice, 400,000 points; the reference: mvtnorm at abseps 2e-7 with a root-found critical value; emmeans' own mvt default tolerance is 1e-3, which the test also allows against its printed values).

Repeated outcomes and clustered units: 749 checks in 21 tests, all within tolerance.

The largest relative gap from R per case (observed):

caseengine fitadjusted means (estimate, SE, df)differences (estimate, SE, adjusted P, CI)Type III terms (F; df; P)
mmrm::fev_data, baseline × visit (4 visits)mmrm, unstructured, Satterthwaite5.4e-135.3e-131.6e-7; 2.5e-5; 4.3e-11
mmrm::fev_data, no baseline × visitmmrm, Satterthwaite4.3e-132.7e-138.5e-14; 1.5e-7; 3.0e-11
ChickWeight days 2–8, adjusted for day 0mmrm, Satterthwaite4.4e-163.2e-161.7e-5; 2.6e-7; 2.8e-11
30 of fev's subjects (seeded), Kenward–Rogermmrm, Kenward–Roger3.7e-136.6e-133.3e-13; 2.4e-13; 3.7e-14
mlmRev::Exam schools 1–30, clusteredlmer, Satterthwaite8.2e-72.7e-75.4e-7; 1.9e-4; 3.8e-6
nlme::BodyWeight, 16 rats over 10 dayslmer (compound symmetry), Satterthwaite7.1e-71.6e-61.1e-4; 5.4e-7; 6.2e-8
nlme::BodyWeight, Kenward–Rogerlmer, Kenward–Roger (pbkrtest)1.1e-71.1e-61.1e-4; 7.3e-13; 4.4e-8

Tolerances: mmrm cases 1e-6 (the engine fits mmrm itself: the same optimum and the same analytic df); lmer cases 1e-5; terms F 2e-4, df 3e-4, P 1e-5 (the reference refits the model with the covariate centred, a second REML optimisation). The term tests are each term's joint test with the covariates at their means (the engine's estimable functions from emmeans, tested by the fitting package's exact multi-df method: mmrm::df_md, lmerTest::contestMD; the reference uses the centred model's own coefficients). emmeans' own joint-test df are an approximation (on fev_data 132.1 for time against mmrm's exact 158.7) and are no longer used for mmrm or lmer. Before r7 the time term was tested with the covariate at its mean + 0.5 (the slope grid's two values averaged); it is now at the mean.

Kenward–Roger (small sample, 30 subjects): for an unstructured covariance the engine uses mmrm's linear Kenward–Roger (vcov "Kenward-Roger-Linear", as SAS's DDFM=KR); mmrm's full form adjusted some SEs below the model-based ones (0.0952 against 0.0978, auditor #8), the linear form never does (tested). KR changes the SEs and the multi-df tests (time: df 18.79 against Satterthwaite's 19.93); for a single contrast mmrm's KR df equal its Satterthwaite df, so the per-visit df do not move. Compound symmetry is fitted by lmer, so its KR is pbkrtest's own. Time at the 3000-value limit (300 units × 10 visits, the product launcher, 2 GiB R cap): unstructured KR 16 s, Satterthwaite 17 s; random intercepts with KR 9–16 s; no request is near the time allowance.

Residual SD (auditor #8, r7e): the SD left after the adjustment (residual_sd, planning.residual_sd, used by What next's power) comes from the fitted covariance: for repeated outcomes the last visit's marginal SD sqrt(V[t, t]) of the unstructured matrix (its visit in residual_sd_at), for random intercepts one value's marginal SD (residual plus intercept variances). Before, R's sigma() was applied to the mmrm fit, which has no sigma method (2.5488 on fev_data, where the visit-4 SD is 10.016). It matches the reference's own computation for every case (mmrm to 1e-6, lmer 1e-5) and scales with the outcome's units (×1000 gives ×1000: to 1e-6 for random intercepts, 1e-4 for the unstructured fits, which are re-optimised at the new scale).

Scale (auditor #8): every covariate is centred and scaled to unit SD before fitting (r6j), so the tests at the covariate means are tests at 0. Terms, the slopes check and the adjusted means are the same for a baseline written as 5s + s·z with s from 1 to 1e10 (tested to 1e-6), and on the auditor's scale design the time term equals the exact centred reference at every s from 1 to 1e8 (unstructured F 4.7918, compound symmetry F 5.2367, P 0.00689); emmeans' estimable functions, rounded near 1e-8, had tested time at the wrong baseline once it was large. Grid rows are matched by index, so an SD of 1e9 or more no longer duplicates the adjusted means.

The fallback when mmrm cannot fit (it fails on 20 of fev's subjects; gls failed there too): nlme::gls (corSymm + varIdent, REML) with emmeans' appx-Satterthwaite, seeded (its gradient is a random draw); against mmrm on fev_data, estimates and SEs to 1e-4 and df to 3% (observed 1.9% with standardized covariates, chick_mmrm; up to 3.2% on held-out data; unseeded draws reached 2.8%); the result labels its df "approximated numerically". emmeans' analytic path for gls (glsControl(natural = FALSE)) gave df of 217–398 against mmrm's 131–148 and is not used.

Memory and time (pod, loaded, through the product launcher, 3 groups): the R worker's data size peaks at 0.76 GB (1000 units × 3 visits), 0.79 GB (300 × 6), 0.83 GB (100 × 10) and 1.08 GB (300 × 10). With the 2 GiB R cap (engine 6 GB, 24 Nov 2026): mmrm 3–13 s up to 3000 values, 33 s at 300 × 10; random intercepts (clustered units, compound symmetry) 3–9 s with Satterthwaite or Kenward–Roger df at 3000 values; the gls fallback 15 s at 60 × 4 and 44 s at 200 × 4 (minutes for larger designs). Under the former 1 GiB cap the 300 × 10 fit ran out of memory (R's garbage collector thrashed, then the exact fit failed and gls took over: 206–248 s). The long-job rule follows these times (registry.long_running): a request that may fit an unstructured covariance is a long job; clustered units and compound symmetry are ordinary requests.

Planted truth: coverage of the 95% CI of the adjusted difference, the group F test's type I error, Dunnett's family-wise error, the slopes check's false-alarm rate under parallel slopes, HC3 against model-based SEs under unequal variances, Tukey's simultaneous coverage, a planted interaction whose Johnson–Neyman bounds bracket the true crossing, and the precision gain over the change score and the final value alone. A documented run:

planted truthresultnominal
95% CI of the adjusted difference covers the planted difference (2 groups, n = 12)0.9375; reruns at 4,000 data sets, seeds 1 and 2: 0.9488 and 0.9560, identical to statsmodels OLS on every data set0.95
Group F test rejects under the null (3 groups, n = 8)0.0530.05
Dunnett family-wise error under the null (2 comparisons with the control)0.0570.05
Slopes check alarms under parallel slopes0.0650.05
Tukey simultaneous coverage (4 groups, n = 10, unequal planted effects)0.9570.95
Coverage with unequal variances (SD 1.5 vs 3.75, n 8 vs 16): model-based / HC30.987 / 0.9620.95

Tumour-growth efficacy studies, tumour_growth and power_tumour_growth

References: R 4.5.3: stats lm/t.test, mratios 1.4.4 ttestratio (Fieller, unequal variances), lme4 2.0.6/lmerTest 3.2.1 (REML, Satterthwaite, the engine worker's bobyqa control), minpack.lm 1.2.4 nlsLM (Gompertz on ln volume from the engine's starts), survival 3.8 (survdiff, survfit), and the mRECIST rule of Gao et al. (2015) as Xeva's mRECIST codes it (reproduced in the script as an external reference). The parity table of every quantity passes on all 3,806 values:

quantityvalueslargest relative difference
per-animal growth rates; rate difference, Welch CI, df, P; rate-based T/C and CI2311.9e-13
growth-rate inhibition with Fieller CI307.0e-15
T/C % (mean, Fieller CI), TGI % (ΔT/ΔC, Fieller CI), geometric T/C (Welch CI, P)9601.7e-14
T/C % (median), TGI % (1 − T/C)1944.3e-15
adjusted and carry-forward AUC ratios, CIs, P805.6e-15
mixed model slope differences, SE, df, P, CI, rate-based T/C; group slopes1063.1e-05
exponential fit; Gompertz parameters, SE, RSS1265.0e-06
time to endpoint: log-rank χ², P, HR (O/E) and CI, medians583.7e-14
mRECIST best response, best average response and category (study animals and 849 PDXE curves)2,0514.6e-15

The mixed model's differences are the optimizer's (both fits stop within lme4's tolerance; one study's singular fit lands on the same boundary). Planted-truth simulations: the rate-based T/C is unbiased (mean log error < 0.05) with 88–99% coverage of its 95% CI over 150 studies with removals at a size limit, while the last-day T/C over the survivors is biased towards 1 by more than 0.3 on the log scale (large control tumours leave first); renamed groups and animals, numeric IDs, unequal groups, three arms (Holm), zero volumes, removal reasons and refusals (restarting IDs, two volumes on a day, negative volumes, no control) are class tests.

power_tumour_growth: each simulated animal grows exponentially from a lognormal baseline at its own rate, with noise on ln volume, and is removed after its first measurement at or over the size limit; each study is analysed by Welch's t test of the animals' rates. Against an independent R simulation (20,000 studies per setting, with and without removals) the power agrees within 4 combined Monte Carlo SE; without removals it agrees with Student's noncentral-t power of the per-animal rate variance rate_sd² + residual_sd²/Σ(t − t̄)² from 6 animals per group (Welch's test has a little less power with 3).

Relative potency, relative_potency

References: R 4.5.3: drc 4.0.0 (drm with LL.4 / LL.3 / LL2.4 and pmodels for the parallel model; EDcomp delta and Fieller intervals; anova of the parallel against the unconstrained model per pair) and minpack.lm 1.2.4 nlsLM on the same models from drc's estimates (Gauss–Newton standard errors, the engine's covariance = "gauss_newton"). The served default is drc's observed-Hessian covariance (covariance = "hessian", named in the methods text), so a potency interval equals drc EDcomp's; the Gauss–Newton path is kept and checked against nlsLM. Parallel-line assays: lm with a common slope on ln dose and Fieller's interval written out from Finney (1978).

quantityagreement
parallel-model residual SS; ln EC50 differences (log potency) on S.alba, spinach, G.aparine, S.alba 3PL1e-9; 1e-8
log potency SE, CI ends, P (Gauss–Newton) vs nlsLM1e-8 to 1e-6
potency, delta and Fieller CIs (observed-Hessian covariance) vs drc EDcomp1e-6 (drc's numerical Hessian: SE to 4e-4)
parallelism F per pair vs drc anova1.5e-5 (the engine's unconstrained fit reaches a lower minimum than drc's)
slope ratio and asymptote differences with 90% CIs vs nlsLM1e-6
parallel-line potency and Fieller CI, F test vs lm1e-10

Verdicts on the public data: spinach (diuron's slope 3.4 × bentazon's, F = 43.9) and G.aparine are not parallel, so no potency is reported (the EC50s and their ratio, labelled, are); S.alba (slope ratio 0.53, F P = 0.051) is "not shown", its potency 0.425 (95% CI 0.351–0.516) reported with that label. Planted truth: parallel curves with ρ = 2.5 (8 doses × 3, 2% noise) give an unbiased log potency and 90–99% coverage over 120 assays, with equivalence shown in at least 95 of 120 and a false "not parallel" in at most 5; a slope ratio of 2.2 is "not parallel" with no potency; a noisy single-replicate assay is "not shown". Reference swap inverts the potency and its CI; labels, numeric codes and row order do not change it.

Aligned rank transform ANOVA, art_anova

The class: an ordinal outcome (a Likert item, a score on a few ordered levels) or a measurement far from normal on every reasonable scale, in a factorial of two to four crossed factors, where the question includes interactions. ARTool's method (Wobbrock et al. 2011): residuals from the cell means plus each effect's estimated effect (the alternating sum of its marginal means, observation-weighted as ARTool's ave), average ranks, the full factorial fitted to each effect's ranks with only that effect read; ART-C contrasts (Elkin et al. 2021) align for the combined factor of the compared effect. Between subjects the engine fits the linear model in Python (Type III F, sum-to-zero contrasts); with a subject or block column it fits a random intercept per subject (lmer, Type III F with Kenward–Roger df, as car::Anova runs pbkrtest's KRmodcomp) or Error(subject) strata (aov) in the pinned R runtime (models_worker.R kind "art"), and emmeans' pairwise contrasts there. Every result carries ARTool's alignment check and the caveat that main-effect tests can mislead under a strong interaction or unequal spreads (Lüpsen 2017); estimates are on the rank scale.

References: R 4.5.3, ARTool 0.11.2, car 3.1.5, emmeans 2.0.4, lme4 2.0.6, pbkrtest 0.5.5. Parity, 7,747 values over 13 cases, all pass:

quantityvalueslargest relative difference
F, df, P of every effect: linear model, Type III; sums of squares1529.3e-15
F, Kenward–Roger df, P: mixed model; F, df, P: Error() strata1320 (the same R libraries)
ART-C estimate, SE, df, t (linear, mixed and Error() models)2,4721.6e-13
ART-C P: Tukey (studentized range; below 1e-6 compared absolutely, R ptukey's precision), Holm, Bonferroni, Šidák, Scheffé, FDR, none6183.8e-6 (tail: 3.1e-12 absolute)
ART-C CIs: Tukey (R qtukey, accurate to 4 decimals of q); Bonferroni, Šidák, Scheffé, none8602.8e-6; 2.1e-14
aligned responses; aligned ranks (every row and effect)3,2362.3e-13; exact
alignment check: column sums and F of the effects not aligned for (~0), unbalanced F2773.5e-9

Cases: Higgins1990Table1, InteractionTestData, ToothGrowth (also unbalanced), warpbreaks, ElkinABC (three-way) between subjects; Higgins1990Table5 (split plot; lmer, Error(), unbalanced lmer), HigginsABC (lmer, Error()), ElkinAB and ElkinABC (lmer). One deliberate difference: ARTool rounds the aligned responses to 8 decimals before ranking, absolutely, which ties every value of data in small units; the engine rounds to 9 significant decimals of the largest aligned value (ARTool's rounding for data of magnitude about 10): the same ranks on every case, and results independent of the unit.

Planted truth: at α = 0.05 the null rejection rates are 0.073, 0.047, 0.053 (2 × 3, lognormal errors, 600 designs) and 0.048, 0.048, 0.043 (a 1–5 Likert item); with large main effects and no interaction the interaction test rejects 0.048 (the plain rank transform's failure avoided); a single shifted cell is found with power 0.91; within subjects (12 subjects, 2 × 3, lognormal) the null rates are 0.060, 0.040, 0.050 and a shifted cell's power 0.70. The main-effect rate of 0.073 under skew is the mild liberality Lüpsen (2017) reports, which the caveat states. Refusals: one factor (Kruskal–Wallis or Friedman named), an empty cell, no residual df, text responses without their order.

Stratified Cox model, cox_regression with strata

The class: a factor whose hazards are not proportional (a centre, a cell type, a sex, a litter, an event type) gets its own baseline hazard per level (or per combination of several stratum columns, as survival::strata combines them); the other covariates' hazard ratios are estimated within strata and the stratified factor gets no hazard ratio, which the result states (strata_note). Partial likelihood, score residuals (cluster-robust SE), concordance pairs and the cox.zph risk sets are all within strata; cox.zph's time scale stays that of all subjects pooled, as R computes it.

References: R 4.5.3, survival 3.8-13: coxph(Surv(time, event) ~ x + strata(s) [+ cluster(id)]) with Efron and Breslow ties, cox.zph(terms = FALSE) on the served default time scale (km, R's default) and on rank, and the fit's concordance with its pair counts. Parity, 390 values over 10 cases, all pass:

quantityvalueslargest relative difference
coefficients; SE (robust with a cluster); z; P1041.1e-8 (P 1.0e-7)
likelihood-ratio, Wald (robust with a cluster), score and robust score χ²309.8e-9
concordance within strata; concordant, discordant and tied pairs40exact
cox.zph χ² and P per coefficient, within strata (km, the served scale; and rank)1045.2e-9
subjects, events, strata and per-stratum counts (missing values and missing strata dropped as R does)112exact

Cases: survival::lung (sex; wt.loss with 14 missing values; Efron and Breslow), veteran (celltype; celltype × prior), pbc (stage; edema categorical), rats (litter, 50 strata of three; sex with cluster(litter)), colon (etype with cluster(id): two event types per patient) and bladder (enum with cluster(id)). Planted truth: a log hazard ratio of 0.7 for x, four strata whose baseline hazards differ 100-fold and in which x is more common where the hazard is high (100 data sets of 600): the stratified estimate averages 0.708 (SD 0.105) with 96% coverage of its 95% CI, the unstratified one 1.127 (confounded by the strata); R's own 400 simulations give 0.691 and 1.124.

Agreement of raters and methods, icc, fleiss_kappa and weighted_kappa

The class: the same subjects measured, scored or classified by two or more raters, readers, observers or methods. The ICC covers measurements (all six forms, Shrout & Fleiss and McGraw & Wong names, the one the stated design question picks; subjects with missing ratings kept through REML crossed variance components in the pinned R runtime, as psych::ICC with lmer); Fleiss' kappa covers categories from m raters (raters may differ per subject, ratings may be missing; per-category kappa; Gwet's variance for the CI; weights; Conger's kappa); Cohen's kappa from raw labels builds the table over the full ordered scale (a level no rater used stays in it) and reuses contingency.kappa_core.

References: R 4.5.3: irr 0.85 (icc with r0 = 0 and 0.3, kappam.fleiss with detail and exact, kappa2), psych 2.6.9 (ICC with lmer FALSE and TRUE, cohen.kappa with levels and w.exp 1 and 2), irrCAC 1.4 (fleiss.kappa.raw, conger.kappa.raw, three weights), BlandAltmanLeh 0.3.1 (bland.altman.stats), lme4 2.0.6 of the pinned runtime; irr's and irrCAC's printed roundings are undone by running their own functions with round shadowed. Public data: irr::anxiety, irr::video, irr::diagnoses (Fleiss 1971), irr::vision (Stuart 1953, 7,477 women), the Shrout & Fleiss (1979) table, lme4::Penicillin (complete and with cells removed), irrCAC::cac.raw4raters, cac.raw5obser (missing ratings), cac.raw.gender, cac.ben.gerry, mcr::creatinine. Parity, 819 values, all pass:

quantityvalueslargest relative difference
ICC estimates (6 forms × 4 datasets), two-way ANOVA mean squares648.1e-15
ICC F, df, P against 0 and 0.3 (irr, psych)2162.9e-14
ICC CIs: 6 forms vs psych, 5 vs irr881.6e-12
REML variance components; ICC, F, P and CIs with missing ratings vs psych (lmer)1321.9e-9
Fleiss' kappa, agreement, Gwet SE and CI; Conger's kappa, SE and CI (irrCAC, 3 weights, missing ratings)1653.2e-14
Fleiss' kappa, z, exact; per-category kappa and z (irr, complete subjects)482.1e-14
Cohen's kappa and z (irr); kappa and variance over the full scale (psych)562.0e-14
P values vs irr (relative; absolute below 1e-6, where irr's 2·(1 − pnorm) loses digits)359.2e-12
Bland–Altman bias, limits, bias CI (BlandAltmanLeh)151.4e-15

Documented differences (not failures): irr::icc takes the df of its ICC(A,k) interval from the averaged estimate; the engine uses McGraw & Wong's interval, the Spearman–Brown transform of ICC(A,1)'s, as psych::ICC does (Shrout & Fleiss: engine and psych 0.0711 to 0.9272, irr 0.0394 to 0.9286). irr::kappa2 builds its table over the levels used, so on irr::anxiety raters 2 and 3 (neither uses 5) its weighted kappas are 0.146 (linear) and 0.252 (quadratic), against the engine's 0.126 and 0.230; the engine keeps 5 in the scale and equals psych::cohen.kappa with levels = 1:6. irrCAC's P is one-sided; the engine's is two-sided. BlandAltmanLeh's CIs of the limits use the 1986 approximation √(3s²/n); the engine's default is the exact noncentral-t interval (cases_agreement.py documents both).

Planted truth: the ICC(3,1) and ICC(3,k) intervals cover 95.4% and ICC(2,1), ICC(2,k) 93.2% (McGraw & Wong's approximate interval) over 2,000 studies of 30 subjects × 4 raters (σ²s = 1, σ²r = 0.25, σ²e = 0.5), median estimates within 0.01 of the truth; the one-way ICC(1,1) covers 95.1%; the REML path recovers the ICC on 150 × 4 with 15% removed. Fleiss' kappa with κ = θ² = 0.64 (60 × 5): mean 0.636, Gwet CI coverage 95.9% (93.8% with 20% of ratings missing), per-category kappas also θ²; the null z test rejects 4.7% at α = 0.05. Quadratic weighted kappa (truth 0.817 from the population table, n = 200): mean 0.816, coverage 94.4%.

Class tests: the design question picks each of the eight forms (random/fixed/one-way × single/average × absolute/consistency); long rows equal the wide table; a second rating by one rater is refused, never averaged; text in an ICC points to kappa; category order is never alphabetical (ordinal words, "Grade 10" after "Grade 2", Roman stages, "2+", numeric codes completed between the ends); a skipped middle level changes weighted kappa and end levels do not; "None" is a category, not a missing value; custom weight matrices reuse the core. The design rule fires on renamed raters and methods and declines wide repeated measures (timepoints, treatments, doses, conditions, sides, sex), replicates (unless their precision is asked) and the other study packages.

Back to how every number is checked