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
| kind | what it is | typical tolerance |
|---|---|---|
| NIST | Certified 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 |
| published | A 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-check | An 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 |
| analytic | A value known in closed form (trapezoid areas, quantile definitions, identities such as Tukey with 2 groups = Student's t test). | exact or 1e-12 |
| simulation | Coverage 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
| Analysis | References |
|---|---|
Descriptive statisticsdescriptiveseveral columns · describe_columns | NIST 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 testsnormality | Shapiro & 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_columns | Identical (bit for bit) to normality on first − second and on each column |
Fraction of total (parts of whole)fraction_of_total | Exact 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_sample | Student'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_summary | The 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_summary | R'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_anova | statsmodels 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_anova | NIST ANOVA (11 datasets, all difficulties); statsmodels anova_oneway (Welch, Brown–Forsythe); error-rate simulation |
Non-compartmental pharmacokinetics (NCA)pk_nca | R'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)ancova | R 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_growth | R 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_growth | An 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_potency | R 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_anova | Montgomery'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_anova | R 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_comparisons | Marginal-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_values | Studentized 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_anova | R 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_anova | nlme'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 · friedman | R 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_matrix | R 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_accuracy | R 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_regression | Freireich 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 timesrmst | R 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_altman | Hanley & 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 methodsicc | R 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_kappa | irr::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_kappa | irr::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_regression | NIST 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_regression | Challenger O-ring data (Dalal et al. 1989); Dobson's Poisson example (R glm); independent Newton–Raphson; statsmodels discrete Poisson model |
Principal component analysispca | Eigen-decomposition of the correlation matrix; statsmodels PCA |
Area under the curvearea_under_curve | Closed-form areas; Monte Carlo SE |
Outlier testsGrubbs' outlier test · grubbsROUT outlier detection · rout | NIST/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_proportions | R 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_ct | The independent Python reference in packages/integrations-py; SciPy ttest_ind and t.interval for the group statistics |
P value from a test statisticp_value | Closed 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_test | Scenario 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
-
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.
-
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.
-
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.
-
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.
-
Power calculations. R's
power.t.testcounts only one tail of the two-sided rejection region by default (strict = FALSE); we count both. R'spower.anova.testandpower.prop.teststop their root search at a tolerance of about 1e-4. Both effects change only the 5th–7th digit. -
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.
-
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.
-
Kaplan–Meier intervals default to the log-log transformation (as lifelines); R's
survfitdefaults to the log transformation. Both are available (ci_method), and both are tested. -
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.
-
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.
-
Nested designs. The group comparison uses the REML estimates, the generalised least-squares covariance (X'V⁻¹X)⁻¹ (as R's
nlmeandlme4report 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. -
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.
-
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).
-
Test of proportional hazards (
cox_regression): the score test of R survival ≥ 3.0'scox.zph, one test per coefficient (terms = FALSE), time transformrank(R's default iskm). 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). -
Hosmer–Lemeshow groups are 10 groups of near-equal size by sorted fitted probability (ties keep row order). ResourceSelection's
hoslem.testcuts at deciles instead; the two agree when n is a multiple of 10 without tied probabilities, and both are checked. -
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. -
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). -
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).
| case | data | checked | checks | min digits |
|---|---|---|---|---|
mixed_nlme_ergostool | ergoStool, 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 SE | 15/15 | 3.7 |
mixed_nlme_machines | Machines, 6 workers × 3 machines × 3 replicates (§1.3) | SDs; intercept and treatment-coded effects; REML log-likelihood | 6/6 | 4.8 |
mixed_nlme_pbib | SASmixed PBIB, 15 treatments in 15 blocks of 4 (§2.4) | REML Wald F, P and df; ML log-likelihood | 5/5 | 3.1 |
mixed_reml_independent | Machines and PBIB | Machines variance components vs the ANOVA estimators; PBIB REML and ML variance components, Wald F and ML log-likelihood vs the independent fit | 9/9 | 10.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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
rm_anova_reacttime_two_within | reacttime, deg (3) × noise (2) within subjects | F, df and P for deg, noise and deg × noise; Greenhouse–Geisser ε and P; Huynh–Feldt P; Mauchly's W and P for deg | 17/17 | 4.4 |
rm_anova_reacttime_split_plot | reacttime, 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 df | 12/12 | 3.9 |
rm_anova_selfesteem_datanovia | selfesteem, 10 subjects × 3 times | F, 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/31 | 2.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.teston 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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
posthoc_pairwise_t_airquality | airquality Ozone by month (37 missing values dropped) | adjusted P for all 10 pairs: pooled SD with Holm and with Bonferroni; Welch t tests with Holm | 30/30 | 1.6 |
posthoc_tukey_lsd_nist_handbook | e-Handbook, 4 treatments × 5 | Tukey 95% limits for 6 pairs; unadjusted 95% limits for the first 3 treatments; pooled variances | 20/20 | 1.7 |
posthoc_games_howell_rstatix | ToothGrowth len by dose: all, OJ only, VC only | difference, 95% limits and adjusted P for 3 pairs in each | 36/36 | 2.5 |
posthoc_dunnett_desctools | Hollander & 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 control | 40/40 | 0.7 |
posthoc_dunnett_one_sided_multcomp | recovery, one-sided (less than control) at 90% | Dunnett quantile; 3 estimates; 3 upper limits, each against two multcomp runs | 11/11 | 2.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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
survival_aml_r | aml (Miller 1981), Maintained vs Nonmaintained | Kaplan–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/120 | 2.6 |
survival_logrank_empty_group_r | aml plus a third group of 7 early censorings | log-rank χ² and df; expected deaths in the third group | 3/3 | 3.0 |
survival_ovarian_km_r | ovarian (Edmonson et al. 1979), all and by treatment | KM rows; log-rank observed and expected; χ² against R's Cox score test with Breslow ties; P | 150/150 | 2.8 |
survival_ovarian_cox_r | ovarian | 8 Cox models with 1–3 of age, resid.ds, rx, ecog.ps: coefficient rows and likelihood-ratio test | 104/104 | 2.6 |
survival_lung_r | lung (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/37 | 3.2 |
survival_veteran_cox_r | veteran (Kalbfleisch & Prentice 1980) | Cox karno + age + trt: the karno coefficient, printed to 9 decimals | 1/1 | 8.3 |
survival_cox_ties_closed_form | Therneau & 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/11 | 6.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_survivalcounted 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 = τ)andsummary(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).
| case | data | checked | checks | min digits |
|---|---|---|---|---|
rmst_r_survrm2_real | survRM2'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/180 | 13.5 |
rmst_r_survrm2_crossing_and_edges | the 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 above | 60/60 | 14.5 |
rmst_r_survrm2_four_groups | veteran celltype (4 groups, τ = 180) | as above; 3 contrasts, each against squamous | 46/46 | 14.1 |
rmst_r_survfit_rmean | all 13 data sets | per group RMST and SE vs survival's rmean and se(rmean) | 56/56 | 15.0 |
rmst_r_survival_at_times | the 12 data sets with chosen times | per group n at risk, KM survival, Greenwood SE, log-log CI; per contrast the survival difference, SE, CI, P | 540/540 | 12.5 |
rmst_r_tau_rule | PBC τ = 13 and τ just above the limit (refused by both); veteran τ = 600 (accepted by both) | refusal or acceptance as R decides | 6/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.testandprop.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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
contingency_r_chisq_examples | Agresti 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 P | 26/26 | 4.0 |
contingency_r_fisher_convictions | Fisher's twin convictions | one- and two-sided P; conditional MLE odds ratio; exact 95% and 99% limits | 14/14 | 4.4 |
contingency_r_mcnemar_binom_prop | Agresti presidential approval; 682/925 (Conover); 52/100 | McNemar χ² and P; Clopper–Pearson and Wilson 95% limits | 7/7 | 4.0 |
contingency_sas_freq_examples | SAS diet/heart-disease 2×2 table; 341/762 | Pearson, 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% limits | 27/27 | 2.8 |
contingency_nist_handbook | wafer defects 3×4; diode lots 2×5; 4/20; 26/200 | χ², df, P and expected counts; exact 90% limits; one-sided Wilson 95% lower limit | 18/18 | 3.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.testandpower.prop.test.
What is checked. power_t_test, power_anova and power_proportions, solving for power, n or p2.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
power_pwr_vignette | pwr vignette examples | power 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 = 3 | 14/14 | 6.5 |
power_r_stats_examples | R's examples | one-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 vignette | 10/10 | 7.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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
roc_proc_auc_delong | aSAH: wfns, ndka, s100b | group sizes; AUC; DeLong variance; DeLong 95% CI of ndka for all patients and for women | 17/17 | 4.4 |
roc_proc_coords_s100b | aSAH: s100b | all 51 curve points (thresholds, sensitivities, specificities); Youden-optimal threshold 0.205 with its sensitivity and specificity | 7/7 | 15.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.
| case | data | checked | checks | min digits |
|---|---|---|---|---|
bland_altman_1986_bias_ci | PEFR, Wright − mini Wright, first readings, n = 17 (Table 1) | t(0.975, 16); SE of the bias; 95% CI of the bias | 4/4 | 2.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())andsummary(lm())output on R's own data sets (chickwts, InsectSprays, warpbreaks, LifeCycleSavings, Formaldehyde, attitude, stackloss, swiss, trees), andlmtest::bptestfor Breusch–Pagan. - Correlation. R's
cor.testexamples (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.
| area | topic | case | references | checks passed | tolerance | min digits |
|---|---|---|---|---|---|---|
| Statistics | Assay quality | assay_quality_definitions | zhang-1999-z-factor, zhang-2007-2008-ssmd, closed-form | 30 of 30 | behaviour holds; rel ≤ 1e-12 | 15.0 |
| Statistics | Assay quality | plate_uniformity_statsmodels_scipy | statsmodels, scipy | 20 of 20 | behaviour holds; rel ≤ 1e-08; rel ≤ 1e-09; … | 12.9 |
| Statistics | Bland–Altman | bland_altman_1986_bias_ci | bland-altman-1986 | 4 of 4 | half a unit of the printed digit; abs ≤ 0.1 | 2.7 |
| Statistics | Clustering | clustering_hierarchical_naive | closed-form | 280 of 280 | rel ≤ 1e-10 | 15.0 |
| Statistics | Clustering | clustering_hierarchical_r | r-stats-ex | 13 of 13 | half a unit of the printed digit; exact | 7.6 |
| Statistics | Clustering | clustering_kmeans_published_exhaustive | datanovia-kmeans-usarrests, closed-form | 23 of 23 | half a unit of the printed digit; behaviour holds; rel ≤ 1e-10; … | 6.8 |
| Statistics | Contingency tables | binomial_r_binom_test | r-stats-ex | 4 of 4 | half a unit of the printed digit | 4.7 |
| Statistics | Contingency tables | contingency_nist_handbook | nist-sematech-handbook | 18 of 18 | half a unit of the printed digit; abs ≤ 1e-12; abs ≤ 2e-06; … | 3.1 |
| Statistics | Contingency tables | contingency_r_chisq_examples | r-stats-ex | 26 of 26 | half a unit of the printed digit; exact | 4.0 |
| Statistics | Contingency tables | contingency_r_fisher_convictions | r-stats-ex | 14 of 14 | half a unit of the printed digit; abs ≤ 1e-09; abs ≤ 1e-10; … | 4.4 |
| Statistics | Contingency tables | contingency_r_mcnemar_binom_prop | r-stats-ex | 7 of 7 | half a unit of the printed digit | 4.0 |
| Statistics | Contingency tables | contingency_sas_freq_examples | sas-stat-14.1-freq | 27 of 27 | half a unit of the printed digit | 2.8 |
| Statistics | Contingency tables | kappa_statsmodels | statsmodels, closed-form | 27 of 27 | rel ≤ 1e-10; rel ≤ 1e-12; rel ≤ 1e-14; … | 14.0 |
| Statistics | Contingency tables | trend_r_prop_trend_test | r-stats-ex | 5 of 5 | half a unit of the printed digit | 4.3 |
| Statistics | Correlation | correlation_cor_test_r | r-stats-ex | 15 of 15 | half a unit of the printed digit; exact | 4.2 |
| Statistics | Correlation | partial_correlation_residual_method | statsmodels | 12 of 12 | rel ≤ 0; rel ≤ 1e-09; rel ≤ 1e-10; … | 14.9 |
| Statistics | Correlation | partial_correlation_wikipedia | wikipedia-partial-correlation | 2 of 2 | half a unit of the printed digit | 7.3 |
| Statistics | Effect sizes | effect_sizes_closed_forms | closed-form | 10 of 10 | rel ≤ 1e-09; rel ≤ 1e-12 | 15.0 |
| Statistics | Effect sizes | effect_sizes_lakens_2013 | lakens-2013-effect-sizes | 14 of 14 | half a unit of the printed digit | 0.8 |
| Statistics | Effect sizes | effect_sizes_noncentral_cis | noncentral-f-series, noncentral-chi2-series | 19 of 19 | rel ≤ 0; rel ≤ 1e-06 | 11.7 |
| Statistics | Equivalence tests | equivalence_bounds_in_d_units | closed-form | 7 of 7 | rel ≤ 1e-12 | 15.0 |
| Statistics | Equivalence tests | equivalence_statsmodels | statsmodels | 36 of 36 | rel ≤ 1e-10 | 14.1 |
| Statistics | Equivalence tests | equivalence_toster_sleep | toster-vignette | 19 of 19 | half a unit of the printed digit; behaviour holds; exact | 1.3 |
| Statistics | Frequency distributions | frequency_edges_numpy | numpy-histogram | 28 of 28 | exact | 15.0 |
| Statistics | Frequency distributions | frequency_nist_pidigits | nist-strd-univ | 16 of 16 | digits ≥ 12; exact; rel ≤ 1e-12 | 15.0 |
| Statistics | Independent reference audit | wave2_independent_r_values | r-wave2 | 397 of 397 | rel ≤ 0; rel ≤ 0.0001; rel ≤ 1e-05; … | 6.8 |
| Statistics | Linear regression | regression_influence_r_lifecyclesavings | r-stats-ex-influence | 309 of 309 | half a unit of the printed digit; behaviour holds; exact | 0.3 |
| Statistics | Linear regression | regression_influence_statsmodels | statsmodels | 20 of 20 | behaviour holds; rel ≤ 1e-09; rel ≤ 1e-10; … | 10.3 |
| Statistics | Linear regression | regression_r_datasets_summaries | r-datasets-ex | 166 of 166 | half a unit of the printed digit; exact; ≤ reference + 0 | 2.7 |
| Statistics | Linear regression | regression_r_lifecyclesavings | r-stats-ex | 41 of 41 | half a unit of the printed digit; exact | 3.2 |
| Statistics | Logistic regression | hosmer_lemeshow_r_birthwt | r-resourceselection-hoslem | 3 of 3 | exact; rel ≤ 1e-06 | 9.0 |
| Statistics | Logistic regression | hosmer_lemeshow_r_pima | r-resourceselection-hoslem | 6 of 6 | exact; rel ≤ 1e-06 | 15.0 |
| Statistics | Method comparison | method_comparison_deming_known_sds | r-deming-tests | 4 of 4 | half a unit of the printed digit; behaviour holds; rel ≤ 2e-05 | 2.8 |
| Statistics | Method comparison | method_comparison_deming_mcr | r-mcr-unit-tests | 12 of 12 | half a unit of the printed digit; exact; rel ≤ 1e-06; … | 6.3 |
| Statistics | Method comparison | method_comparison_deming_odr | scipy | 6 of 6 | behaviour holds; rel ≤ 1e-05; rel ≤ 1e-06 | 7.0 |
| Statistics | Method comparison | method_comparison_passing_bablok_bruteforce | r-deming-tests, closed-form | 18 of 18 | abs ≤ 1.29e-09; abs ≤ 1.35e-09; abs ≤ 1e-09; … | 14.6 |
| Statistics | Method comparison | method_comparison_passing_bablok_calanas | r-mcr-unit-tests | 42 of 42 | rel ≤ 1e-11; rel ≤ 1e-12 | 13.1 |
| Statistics | Method comparison | method_comparison_passing_bablok_exact | r-deming-tests | 4 of 4 | abs ≤ 1e-12 | 14.3 |
| Statistics | Method validation | accuracy_recovery_statsmodels | statsmodels | 15 of 15 | rel ≤ 1e-09; rel ≤ 1e-12; rel ≤ 1e-13 | 13.6 |
| Statistics | Method validation | linearity_formaldehyde_r | r-datasets-ex | 12 of 12 | half a unit of the printed digit; behaviour holds | 3.4 |
| Statistics | Method validation | linearity_lack_of_fit_mandel_statsmodels | statsmodels | 8 of 8 | behaviour holds; exact; rel ≤ 1e-09; … | 13.4 |
| Statistics | Method validation | lod_loq_formaldehyde_epa | r-datasets-ex, epa-40cfr136-appendix-b | 41 of 41 | half a unit of the printed digit; rel ≤ 0.0002; rel ≤ 1e-14 | 3.7 |
| Statistics | Method validation | precision_confidence_limits_sas | r-vca-sas-references | 20 of 20 | half a unit of the printed digit; rel ≤ 1e-15 | 4.8 |
| Statistics | Method validation | precision_variance_components_sas | r-vca-sas-references | 72 of 72 | half a unit of the printed digit | 3.5 |
| Statistics | Mixed-effects model | mixed_nlme_ergostool | nlme-pinheiro-bates-scripts | 15 of 15 | half a unit of the printed digit; exact | 3.7 |
| Statistics | Mixed-effects model | mixed_nlme_machines | nlme-pinheiro-bates-scripts | 6 of 6 | half a unit of the printed digit | 4.8 |
| Statistics | Mixed-effects model | mixed_nlme_pbib | nlme-pinheiro-bates-scripts | 5 of 5 | half a unit of the printed digit; exact | 3.1 |
| Statistics | Mixed-effects model | mixed_reml_independent | closed-form | 9 of 9 | rel ≤ 1e-05; rel ≤ 1e-07; rel ≤ 1e-09 | 7.4 |
| Statistics | Mixed-effects models | mixed_lsmeans_complete_data | closed-form | 65 of 65 | rel ≤ 0; rel ≤ 0.0001; rel ≤ 1e-05; … | 10.1 |
| Statistics | Multiple comparisons | posthoc_compact_letter_display | closed-form | 3 of 3 | behaviour holds; exact | 15.0 |
| Statistics | Multiple comparisons | posthoc_dunnett_desctools | desctools-dunnett | 40 of 40 | half a unit of the printed digit; abs ≤ 0.001; abs ≤ 0.00101; … | 0.7 |
| Statistics | Multiple comparisons | posthoc_dunnett_one_sided_multcomp | multcomp-ex | 11 of 11 | half a unit of the printed digit; abs ≤ 0.0005; abs ≤ 0.001 | 2.1 |
| Statistics | Multiple comparisons | posthoc_games_howell_rstatix | rstatix-games-howell | 36 of 36 | half a unit of the printed digit; ≤ reference + 0 | 2.5 |
| Statistics | Multiple comparisons | posthoc_pairwise_t_airquality | r-stats-ex | 30 of 30 | half a unit of the printed digit | 1.6 |
| Statistics | Multiple comparisons | posthoc_tukey_lsd_nist_handbook | nist-sematech-handbook | 20 of 20 | half a unit of the printed digit; abs ≤ 0.002 | 1.7 |
| Statistics | Multiple comparisons | posthoc_unequal_variances_t3_t2 | scipy, closed-form | 36 of 36 | rel ≤ 1e-08; rel ≤ 1e-09; rel ≤ 1e-10 | 10.6 |
| Statistics | Multiple t tests | fdr_two_stage_bky | statsmodels | 2 of 2 | behaviour holds; exact | 15.0 |
| Statistics | Multiple t tests | multiple_t_adjustments_statsmodels | statsmodels | 12 of 12 | exact; rel ≤ 1e-09 | 15.0 |
| Statistics | Multiple t tests | multiple_t_rows_vs_r | toster-vignette | 7 of 7 | half a unit of the printed digit; exact; rel ≤ 1e-12 | 1.3 |
| Statistics | Normality | qq_r_ppoints | r-stats-ex, closed-form | 20 of 20 | half a unit of the printed digit; exact; rel ≤ 1e-12 | 6.8 |
| Statistics | One-way ANOVA | anova_linear_trend | scipy, closed-form | 6 of 6 | rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-11; … | 15.0 |
| Statistics | One-way ANOVA | anova_r_one_way_tables | r-datasets-ex | 22 of 22 | half a unit of the printed digit; exact | 2.9 |
| Statistics | PCA | parallel_analysis_paran_same_draws | r-paran-1.5.6 | 10 of 10 | digits ≥ 12; exact | 14.7 |
| Statistics | PCA | parallel_analysis_r_mtcars | r-paran-1.5.6, r-psych-2.6.9 | 35 of 35 | abs ≤ 0.00736; abs ≤ 0.00779; abs ≤ 0.00804; … | 2.1 |
| Statistics | PCA | parallel_analysis_r_state_x77 | r-paran-1.5.6, r-psych-2.6.9 | 26 of 26 | abs ≤ 0.00557; abs ≤ 0.00621; abs ≤ 0.00649; … | 2.4 |
| Statistics | Power and sample size | power_correlation_regression_pwr | r-pwr-1.3-0, r-stats-ex | 9 of 9 | half a unit of the printed digit; abs ≤ 0.000122; abs ≤ 1e-06 | 6.8 |
| Statistics | Power and sample size | power_pwr_vignette | r-pwr-1.3-0 | 14 of 14 | half a unit of the printed digit; abs ≤ 1e-10; ≤ reference + 0 | 6.5 |
| Statistics | Power and sample size | power_r_stats_examples | r-stats-ex, r-pwr-1.3-0 | 10 of 10 | half a unit of the printed digit; abs ≤ 1e-07; abs ≤ 1e-10; … | 7.2 |
| Statistics | Power and sample size | power_survival_mcnemar_rank_closed_forms | schoenfeld-freedman-logrank, closed-form | 17 of 17 | rel ≤ 0.0001; rel ≤ 1e-05; rel ≤ 1e-08; … | 5.6 |
| Statistics | ROC curves | roc_proc_auc_delong | r-proc-1.19.1 | 17 of 17 | half a unit of the printed digit; exact; rel ≤ 1e-09; … | 4.4 |
| Statistics | ROC curves | roc_proc_coords_s100b | r-proc-1.19.1 | 7 of 7 | abs ≤ 1e-15; exact; rel ≤ 1e-12; … | 15.0 |
| Statistics | Regression diagnostics | regression_breusch_pagan_lmtest | lmtest-ex | 6 of 6 | half a unit of the printed digit; exact | 3.6 |
| Statistics | Repeated-measures ANOVA | rm_anova_reacttime_split_plot | r-stats-ex | 12 of 12 | half a unit of the printed digit; exact | 3.9 |
| Statistics | Repeated-measures ANOVA | rm_anova_reacttime_two_within | r-stats-ex | 17 of 17 | half a unit of the printed digit; exact | 4.4 |
| Statistics | Repeated-measures ANOVA | rm_anova_selfesteem_datanovia | datanovia-rm-anova | 31 of 31 | half a unit of the printed digit; exact | 2.5 |
| Statistics | Repeated-measures ANOVA | rm_comparisons_reacttime_two_within | r-stats-ex, scipy, closed-form | 20 of 20 | half a unit of the printed digit; rel ≤ 1e-09; rel ≤ 1e-10; … | 4.4 |
| Statistics | Repeated-measures ANOVA | rm_comparisons_selfesteem_paired_bonferroni | datanovia-rm-anova | 12 of 12 | half a unit of the printed digit; exact | 2.5 |
| Statistics | Repeated-measures ANOVA | rm_comparisons_split_plot | statsmodels, scipy | 18 of 18 | rel ≤ 0; rel ≤ 1e-06; rel ≤ 1e-09; … | 14.5 |
| Statistics | Survival | cox_zph_r_lung | r-survival-3.8-12-cox-zph | 20 of 20 | exact; rel ≤ 1e-06 | 8.5 |
| Statistics | Survival | cox_zph_r_ovarian | r-survival-3.8-12-cox-zph | 10 of 10 | exact; rel ≤ 1e-06 | 13.5 |
| Statistics | Survival | cox_zph_r_veteran | r-survival-3.8-12-cox-zph | 52 of 52 | behaviour holds; exact; rel ≤ 1e-06 | 7.3 |
| Statistics | Survival | survival_aml_r | r-survival-3.8-13 | 120 of 120 | half a unit of the printed digit; behaviour holds; exact | 2.6 |
| Statistics | Survival | survival_cox_ties_closed_form | therneau-grambsch-2000-appendix, r-survival-3.8-13, closed-form | 11 of 11 | half a unit of the printed digit; rel ≤ 1e-08; rel ≤ 1e-09 | 6.5 |
| Statistics | Survival | survival_logrank_empty_group_r | r-survival-3.8-13 | 3 of 3 | half a unit of the printed digit; exact | 3.0 |
| Statistics | Survival | survival_lung_r | r-survival-3.8-13 | 37 of 37 | half a unit of the printed digit; exact | 3.2 |
| Statistics | Survival | survival_ovarian_cox_r | r-survival-3.8-13 | 104 of 104 | half a unit of the printed digit; exact | 2.6 |
| Statistics | Survival | survival_ovarian_km_r | r-survival-3.8-13 | 150 of 150 | half a unit of the printed digit; exact | 2.8 |
| Statistics | Survival | survival_veteran_cox_r | r-survival-3.8-13 | 1 of 1 | half a unit of the printed digit | 8.3 |
| Statistics | Two-way ANOVA | anova_r_warpbreaks_two_way | r-datasets-ex, r-stats-ex | 36 of 36 | half a unit of the printed digit; exact | 2.8 |
| Statistics | Two-way ANOVA | factorial_cell_comparisons | scipy, statsmodels | 64 of 64 | rel ≤ 0; rel ≤ 1e-05; rel ≤ 1e-06; … | 12.9 |
| Statistics | Two-way ANOVA | factorial_effect_sizes_statsmodels | statsmodels, noncentral-f-series | 21 of 21 | rel ≤ 0; rel ≤ 1e-06; rel ≤ 1e-08; … | 11.7 |
| Statistics | Two-way ANOVA | factorial_lsmeans_statsmodels | statsmodels | 96 of 96 | rel ≤ 1e-09; rel ≤ 1e-10 | 14.9 |
| Statistics | Two-way ANOVA | factorial_r_tukeyhsd_additive_warpbreaks | r-stats-ex | 13 of 13 | half a unit of the printed digit; rel ≤ 0 | 5.0 |
| Integrations | qPCR (ΔΔCt) | qpcr_livak2001_figure2_time_course | livak-schmittgen-2001 | 9 of 9 | rel ≤ 0.149 | 1.1 |
| Integrations | qPCR (ΔΔCt) | qpcr_livak2001_table1_separate_wells | livak-schmittgen-2001 | 24 of 24 | half a unit of the printed digit | 1.1 |
| Integrations | qPCR (ΔΔCt) | qpcr_livak2001_table2_same_well | livak-schmittgen-2001 | 14 of 14 | half a unit of the printed digit | 1.8 |
| Integrations | qPCR (ΔΔCt) | qpcr_pfaffl2001_efficiency_corrected | pfaffl-2001 | 12 of 12 | rel ≤ 0.0116; rel ≤ 0.0117; rel ≤ 0.0121; … | 2.3 |
| Integrations | qPCR (ΔΔCt) | qpcr_yuan2006_ttest_on_delta_ct | yuan-2006 | 41 of 41 | half a unit of the printed digit; exact; ≤ reference + 0 | 3.4 |
| Integrations | qPCR (ΔΔCt) | qpcr_yuan2006_wilcoxon_on_delta_ct | yuan-2006 | 6 of 6 | half a unit of the printed digit; exact | 3.9 |
| Integrations | qPCR standard curves and efficiency | qpcr_yuan2006_gene_by_treatment_and_equal_slopes | yuan-2006 | 12 of 12 | half a unit of the printed digit; exact; rel ≤ 2e-06 | 2.7 |
| Integrations | qPCR standard curves and efficiency | qpcr_yuan2006_standard_curves | yuan-2006 | 61 of 61 | half a unit of the printed digit; exact | 3.5 |
| Properties and simulation | CI coverage | sim_coverage_bland_altman_loa | seeded-simulation, closed-form | 4 of 4 | abs ≤ 0.0227 | 1.9 |
| Properties and simulation | CI coverage | sim_coverage_glm | seeded-simulation | 3 of 3 | abs ≤ 0.0562 | 1.5 |
| Properties and simulation | CI coverage | sim_coverage_kendall_ci | seeded-simulation, closed-form | 4 of 4 | ≤ reference + 0.0307; ≥ reference − 0.0357 | – |
| Properties and simulation | CI coverage | sim_coverage_linear_regression | seeded-simulation | 3 of 3 | abs ≤ 0.0227 | 1.9 |
| Properties and simulation | CI coverage | sim_coverage_spearman_ci | seeded-simulation, closed-form | 4 of 4 | ≤ reference + 0.0307; ≥ reference − 0.0357 | – |
| Properties and simulation | CI coverage | sim_coverage_survival | seeded-simulation | 5 of 5 | abs ≤ 0.0307; abs ≤ 0.0357; abs ≤ 0.0562 | 1.8 |
| Properties and simulation | CI coverage | sim_coverage_welch_cohens_d | seeded-simulation, closed-form | 2 of 2 | abs ≤ 0.0307 | 1.9 |
| Properties and simulation | Family-wise error | sim_fwe_posthoc_unequal_n | seeded-simulation | 4 of 4 | abs ≤ 0.0427; abs ≤ 0.0527; ≤ reference + 0.0397 | 0.6 |
| Properties and simulation | Invariance | invariance_equivalent_forms | closed-form | 19 of 19 | exact; rel ≤ 1e-06; rel ≤ 1e-07; … | 13.9 |
| Properties and simulation | Invariance | invariance_row_and_label_order | closed-form | 12 of 12 | rel ≤ 1e-06; rel ≤ 1e-07; rel ≤ 1e-12 | 15.0 |
| Properties and simulation | Invariance | invariance_unit_scaling | closed-form | 11 of 11 | rel ≤ 1e-07; rel ≤ 1e-08; rel ≤ 1e-09; … | 12.5 |
| Properties and simulation | Invariance | invariance_vs_scipy_after_transformation | closed-form, scipy | 3 of 3 | rel ≤ 1e-10; rel ≤ 1e-12 | 15.0 |
| Properties and simulation | Power | power_null_and_identities | closed-form | 9 of 9 | rel ≤ 1e-06; rel ≤ 1e-09 | 13.5 |
| Properties and simulation | Power | sim_power_formulas | seeded-simulation | 5 of 5 | abs ≤ 0.0485; abs ≤ 0.049; abs ≤ 0.0491; … | 1.2 |
| Properties and simulation | Type I error | sim_type1_contingency | seeded-simulation | 4 of 4 | abs ≤ 0.0307; ≤ reference + 0.0227 | 1.1 |
| Properties and simulation | Type I error | sim_type1_one_way | seeded-simulation | 3 of 3 | abs ≤ 0.0227; abs ≤ 0.0307 | 0.5 |
| Properties and simulation | Type I error | sim_type1_repeated_measures | seeded-simulation | 5 of 5 | abs ≤ 0.0227; abs ≤ 0.0407; abs ≤ 0.0508; … | 0.6 |
| Robustness | Constant data | robustness_constant_and_zero_variance | scipy, closed-form | 27 of 27 | behaviour holds; rel ≤ 1e-12 | 15.0 |
| Robustness | Extreme scales | robustness_extreme_scales | closed-form | 15 of 15 | digits ≥ 10; digits ≥ 12; digits ≥ 4; … | 4.9 |
| Robustness | Input validation | robustness_input_validation | closed-form | 17 of 17 | behaviour holds | – |
| Robustness | Large n | robustness_large_n | scipy, lifelines | 9 of 9 | rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-11; … | 14.3 |
| Robustness | Large tables | robustness_exact_test_limits | scipy | 6 of 6 | behaviour holds; rel ≤ 0.001; rel ≤ 1e-12; … | 3.1 |
| Robustness | Missing values | robustness_missing_values | scipy, closed-form | 17 of 17 | behaviour holds; exact; rel ≤ 1e-12 | 14.4 |
| Robustness | Separation | robustness_separation | closed-form | 7 of 7 | behaviour holds | – |
| Robustness | Singular designs | robustness_singular_designs | closed-form | 5 of 5 | behaviour holds | – |
| Robustness | Ties | robustness_ties_vs_scipy | scipy | 9 of 9 | rel ≤ 1e-09; rel ≤ 1e-10; rel ≤ 1e-12 | 15.0 |
| Robustness | Too few observations | robustness_too_few_observations | closed-form | 14 of 14 | behaviour holds | – |
| Robustness | Zero cells | robustness_contingency_zero_cells | scipy, statsmodels, closed-form | 7 of 7 | behaviour holds; exact; rel ≤ 1e-10; … | 14.8 |
References cited above:
bland-altman-1986: 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. Bland). https://www-users.york.ac.uk/~mb55/meas/ba.htmclosed-form: Closed-form values and exact identities derived in the test (exact or rational arithmetic).datanovia-kmeans-usarrests: Kassambara A, Datanovia: 'K-Means Clustering in R: Algorithm and Practical Examples', printed output of kmeans(scale(USArrests), centers = 4, nstart = 25): cluster sizes and centres. https://www.datanovia.com/en/lessons/k-means-clustering-in-r-algorith-and-practical-examples/datanovia-rm-anova: Kassambara A, 'Repeated Measures ANOVA in R' (Datanovia): worked example with rstatix::anova_test and pairwise_t_test on datarium::selfesteem. https://www.datanovia.com/en/lessons/repeated-measures-anova-in-r/desctools-dunnett: Signorell A et al., R package DescTools: reference documentation of DunnettTest, example output (Hollander & Wolfe 1973 p. 116 data; airquality). https://andrisignorell.github.io/DescTools/reference/DunnettTest.htmlepa-40cfr136-appendix-b: US EPA, Definition and Procedure for the Determination of the Method Detection Limit, Revision 2, 40 CFR Part 136 Appendix B (82 FR 40939, 2017), Table 1. https://www.law.cornell.edu/cfr/text/40/appendix-B_to_part_136lakens-2013-effect-sizes: Lakens D (2013). Calculating and reporting effect sizes to facilitate cumulative science: a practical primer for t-tests and ANOVAs. Frontiers in Psychology 4:863. https://doi.org/10.3389/fpsyg.2013.00863lifelines: lifelines (Davidson-Pilon 2019, JOSS 4:1317), an independent implementation. https://lifelines.readthedocs.iolivak-schmittgen-2001: Livak KJ, Schmittgen TD (2001). Analysis of relative gene expression data using real-time quantitative PCR and the 2^-ΔΔCT method. Methods 25(4):402-408, doi:10.1006/meth.2001.1262 (Tables 1 and 2, p. 406 text, Fig. 2). https://doi.org/10.1006/meth.2001.1262lmtest-ex: Zeileis A, Hothorn T, R package lmtest: documented example output (tests/Examples/lmtest-Ex.Rout.save), bptest on bondyield and currencysubstitution (Kraemer & Sonnberger 1986). https://raw.githubusercontent.com/cran/lmtest/master/tests/Examples/lmtest-Ex.Rout.savemultcomp-ex: Hothorn T, Bretz F, Westfall P, R package multcomp: documented example output (tests/Examples/multcomp-Ex.Rout.save), recovery data (Westfall et al. 1999, p. 80). https://raw.githubusercontent.com/cran/multcomp/master/tests/Examples/multcomp-Ex.Rout.savenist-sematech-handbook: NIST/SEMATECH e-Handbook of Statistical Methods (2012). https://www.itl.nist.gov/div898/handbook/nist-strd-univ: NIST Statistical Reference Datasets: Univariate Summary Statistics (9 problems, certified to 15 digits). https://www.itl.nist.gov/div898/strd/univ/univ.htmlnlme-pinheiro-bates-scripts: Pinheiro JC, Bates DM (2000), Mixed-Effects Models in S and S-PLUS (Springer): documented output of the book's scripts run with R package nlme (tests/extras/scripts.Rout.save, R 4.6.0). https://svn.r-project.org/R-packages/trunk/nlme/tests/extras/scripts.Rout.savenoncentral-chi2-series: Noncentral chi-square CDF as the Poisson mixture of central chi-square CDFs (Johnson, Kotz & Balakrishnan 1995, eq. 29.2), summed and inverted by bisection in the case.noncentral-f-series: Noncentral F CDF as the Poisson mixture of regularized incomplete beta functions (Johnson, Kotz & Balakrishnan 1995, Continuous Univariate Distributions vol. 2, eq. 30.5), summed and inverted by bisection in the case.numpy-histogram: NumPy (Harris et al. 2020, Nature 585:357), numpy.histogram: an independent binning implementation with the same edge convention. https://numpy.orgpfaffl-2001: Pfaffl MW (2001). A new mathematical model for relative quantification in real-time RT-PCR. Nucleic Acids Research 29(9):e45, doi:10.1093/nar/29.9.e45 (Tables 2 and 3). https://www.ncbi.nlm.nih.gov/pmc/articles/PMC55695/r-datasets-ex: R Core Team, documented output of the examples of package 'datasets' (tests/Examples/datasets-Ex.Rout.save, R-devel r90574). https://svn.r-project.org/R/trunk/tests/Examples/datasets-Ex.Rout.saver-deming-tests: Therneau T: R package deming, tests atest.Rout.save (arsenate data, coefficients of Ripley & Thompson 1987, Analyst 112:377) and pbtest.Rout.save (Sen's data and a small noisy set with exact Passing–Bablok answers). https://github.com/cran/deming/tree/master/testsr-mcr-unit-tests: Manuilova E, Schuetzenmeister A, Model F: R package mcr (Method Comparison Regression; Roche Diagnostics), unit tests (Passing–Bablok values of the Calanas reference software to 14 digits; Deming, weighted Deming and Linnet jackknife results) and the creatinine data set. https://github.com/cran/mcr/tree/master/inst/unitTestsr-paran-1.5.6: R 4.4.3 paran 1.5.6 (Dinno): Horn's (1965) parallel analysis, principal components, 95th centile; computed by packages/stats/scripts/r_references/diagnostics_references.R. https://CRAN.R-project.org/package=paranr-proc-1.19.1: 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. 2010, Clin Chim Acta 411:1966-1971). https://github.com/xrobin/pROC/tree/master/tests/testthatr-psych-2.6.9: R 4.4.3 psych 2.6.9 (Revelle): fa.parallel(fa = 'pc', quant = 0.95, sim = TRUE); computed by packages/stats/scripts/r_references/diagnostics_references.R. https://CRAN.R-project.org/package=psychr-pwr-1.3-0: Champely S et al., pwr: Basic Functions for Power Analysis, version 1.3-0; printed output of the vignette 'Getting started with the pwr package' (effect sizes after Cohen 1988). https://cran.r-project.org/web/packages/pwr/vignettes/pwr-vignette.htmlr-resourceselection-hoslem: R 4.4.3 glm(family = binomial) with ResourceSelection 0.3-6 hoslem.test (Lele, Keim & Solymos), and the equal-count deciles of risk written out in R (Hosmer, Lemeshow & Sturdivant 2013, section 5.2.2); computed by packages/stats/scripts/r_references/diagnostics_references.R. https://CRAN.R-project.org/package=ResourceSelectionr-stats-ex: R Core Team, documented output of the examples of package 'stats' (tests/Examples/stats-Ex.Rout.save, R-devel r90574, 2026-09-20). https://svn.r-project.org/R/trunk/tests/Examples/stats-Ex.Rout.saver-stats-ex-influence: R Core Team, documented output of the examples of package 'stats': influence.measures and lm.influence on LifeCycleSavings (Belsley, Kuh & Welsch 1980), tests/Examples/stats-Ex.Rout.save. https://svn.r-project.org/R/trunk/tests/Examples/stats-Ex.Rout.saver-survival-3.8-12-cox-zph: R 4.4.3 survival 3.8-12 (Therneau): coxph (Efron and Breslow ties) and cox.zph(transform = 'rank', terms = FALSE), the score test of proportional hazards per coefficient; computed by packages/stats/scripts/r_references/diagnostics_references.R. https://github.com/therneau/survivalr-survival-3.8-13: Therneau T (2024), survival: A Package for Survival Analysis in R, version 3.8-13: documented test output (tests/doaml, ovarian, difftest .Rout.save) and example output (tests/Examples/survival-Ex.Rout.save). https://github.com/therneau/survival/tree/master/testsr-vca-sas-references: Schuetzenmeister A, Dufey F: R package VCA (Roche Diagnostics), unit tests runit.anovaVCA.R and runit.VCAinference.R with reference values from SAS 9.2 PROC NESTED / PROC VARCOMP / PROC MIXED (method=type1, cl), and the package's CLSI EP05 example data. https://github.com/cran/VCA/tree/master/tests/runit/UnitTestsr-wave2: R 4.5.3 stats; lme4 2.0-6; emmeans 2.0.4; survival 3.8.12. Exact inputs and independent generator: scripts/claims/wave2_references.R. https://stat.ethz.ch/R-manual/R-devel/library/stats/html/00Index.htmlrstatix-games-howell: Kassambara A, R package rstatix: reference documentation of games_howell_test, example output on ToothGrowth. https://rpkgs.datanovia.com/rstatix/reference/games_howell_test.htmlsas-stat-14.1-freq: SAS Institute Inc. (2015), SAS/STAT 14.1 User's Guide, Chapter 40 'The FREQ Procedure', Examples 40.4 (binomial proportions) and 40.5 (analysis of a 2×2 contingency table). https://support.sas.com/documentation/onlinedoc/stat/141/freq.pdfschoenfeld-freedman-logrank: Schoenfeld DA (1983). Sample-size formula for the proportional-hazards regression model. Biometrics 39:499–503; Freedman LS (1982). Tables of the number of patients required in clinical trials using the logrank test. Statistics in Medicine 1:121–129; Connor RJ (1987). Sample size for testing differences in proportions for the paired-sample design. Biometrics 43:207–211. https://doi.org/10.2307/2531021scipy: SciPy (Virtanen et al. 2020, Nature Methods 17:261), an independent implementation. https://scipy.orgseeded-simulation: Seeded Monte Carlo simulation with known truth (design, seeds and tolerances documented in the case).statsmodels: statsmodels (Seabold & Perktold 2010), an independent implementation. https://www.statsmodels.orgtherneau-grambsch-2000-appendix: Therneau TM & Grambsch PM (2000), Modeling Survival Data: Extending the Cox Model, Springer, appendix (hand-calculated Breslow and Efron solutions for test data set 1, as coded in survival tests/book1.R, book2.R). https://github.com/therneau/survival/blob/master/tests/book2.Rtoster-vignette: Caldwell AR, 'An Introduction to t_TOST', vignette of R package TOSTER (2025-08-22): t_TOST and simple_htest on R's sleep data with equivalence bounds of ±0.5. https://cran.r-project.org/web/packages/TOSTER/vignettes/IntroTOSTt.htmlwikipedia-partial-correlation: Wikipedia, 'Partial correlation': worked example with R output (correlation of residuals 0.919145, correlation 0.9695016), retrieved 2026-10-21. https://en.wikipedia.org/wiki/Partial_correlationyuan-2006: Yuan JS, Reed A, Chen F, Stewart CN Jr (2006). Statistical analysis of real-time PCR data. BMC Bioinformatics 7:85, doi:10.1186/1471-2105-7-85 (Tables 2-3 and additional files 2, 3, 5, 9, 11: data and SAS output). https://doi.org/10.1186/1471-2105-7-85zhang-1999-z-factor: Zhang J-H, Chung TDY, Oldenburg KR (1999). A simple statistical parameter for use in evaluation and validation of high throughput screening assays. J Biomol Screen 4(2):67–73. https://doi.org/10.1177/108705719900400206zhang-2007-2008-ssmd: Zhang XD (2007). A pair of new statistical parameters for quality control in RNA interference high-throughput screening assays. Genomics 89:552–561; Zhang XD (2008). Novel analytic criteria and effective plate designs for quality control in genome-scale RNAi screens. J Biomol Screen 13:363–377. https://doi.org/10.1177/1087057108317062
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.
| area | cases | checks | passed | kinds |
|---|---|---|---|---|
| Descriptive statistics | 13 | 51 | 51 | NIST, analytic, cross-check |
| Normality | 4 | 33 | 33 | analytic, cross-check, published |
| t tests | 3 | 24 | 24 | analytic, cross-check, published |
| One-way ANOVA | 12 | 117 | 117 | NIST, cross-check |
| Two-way ANOVA | 3 | 30 | 30 | cross-check, published |
| Multiple comparisons | 7 | 49 | 49 | analytic, cross-check, published |
| Repeated-measures ANOVA | 4 | 23 | 23 | analytic, cross-check, published |
| Mixed-effects model | 1 | 4 | 4 | cross-check |
| Nonparametric tests | 4 | 20 | 20 | analytic, cross-check, published |
| Correlation | 2 | 14 | 14 | cross-check, published |
| Contingency tables | 5 | 39 | 39 | analytic, cross-check, published |
| Survival | 4 | 40 | 40 | cross-check, published |
| ROC curves | 2 | 4 | 4 | cross-check, published |
| Bland–Altman | 1 | 4 | 4 | published |
| Linear regression | 14 | 168 | 168 | NIST, cross-check |
| Logistic regression | 2 | 12 | 12 | cross-check, published |
| Poisson regression | 2 | 10 | 10 | cross-check, published |
| PCA | 1 | 10 | 10 | cross-check |
| Area under curve | 2 | 8 | 8 | analytic, cross-check |
| Outliers | 2 | 11 | 11 | published |
| Power and sample size | 2 | 14 | 14 | cross-check, published |
| Simulation | 5 | 14 | 14 | simulation |
| Other | 1 | 8 | 8 | analytic |
| P values from test statistics | 3 | 50 | 50 | analytic, cross-check, published |
| Summary-data tests | 2 | 55 | 55 | cross-check, published |
| Nested designs | 2 | 29 | 29 | cross-check |
| Parts of whole | 1 | 17 | 17 | cross-check |
| qPCR (ΔΔCt) | 2 | 26 | 26 | cross-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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 4.5348 | 4.5348 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 2.86733906 | 2.86733906 | LRE 15.0 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 2.86733906 | 2.86733906 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 518.9587156 | 518.9587156 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 291.6997275 | 291.6997275 | LRE 15.0 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 291.6997275 | 291.6997275 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | -177.435 | -177.435 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 277.332168 | 277.332168 | LRE 15.0 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 277.332168 | 277.332168 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 2.001856 | 2.001856 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 0.000429123454 | 0.000429123454 | LRE 13.1 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 0.000429123454 | 0.000429123454 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 299.8524 | 299.8524 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 0.07901054782 | 0.07901054782 | LRE 13.8 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 0.07901054782 | 0.07901054782 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 10000002 | 10000002 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 1 | 1 | LRE 15.0 | LRE ≥ 13 | ✓ |
| SD (vs exact rational result for the binary inputs) | 1 | 1 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 1.2 | 1.2 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 9 | ✓ |
| SD (vs exact rational result for the binary inputs) | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 1000000.2 | 1000000.2 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 0.1 | 0.1 | LRE 9.5 | LRE ≥ 9 | ✓ |
| SD (vs exact rational result for the binary inputs) | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| mean (vs certified) | 10000000.2 | 10000000.2 | LRE 15.0 | LRE ≥ 14 | ✓ |
| SD (vs certified) | 0.1000000006 | 0.1 | LRE 8.3 | LRE ≥ 8 | ✓ |
| SD (vs exact rational result for the binary inputs) | 0.1000000006 | 0.1000000006 | LRE 15.0 | LRE ≥ 13 | ✓ |
quantiles_hyndman_fan (analytic, pass)
Reference: Hyndman & Fan (1996) definitions 6 and 7, 1..10.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Q1 type 6 | 2.75 | 2.75 | 0 | abs ≤ 1e-12 | ✓ |
| Q3 type 6 | 8.25 | 8.25 | 0 | abs ≤ 1e-12 | ✓ |
| Q1 type 7 | 3.25 | 3.25 | 0 | abs ≤ 1e-12 | ✓ |
| Q3 type 7 | 7.75 | 7.75 | 0 | abs ≤ 1e-12 | ✓ |
| median | 5.5 | 5.5 | 0 | abs ≤ 1e-12 | ✓ |
geometric_and_median_ci (analytic, pass)
Reference: Closed-form values.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| geometric mean of 1, 10, 100 | 10 | 10 | 1.8e-15 | abs ≤ 1e-12 | ✓ |
| geometric SD factor | 10 | 10 | 1.8e-15 | abs ≤ 1e-12 | ✓ |
| harmonic mean | 2.702702703 | 2.702702703 | 0 | abs ≤ 1e-12 | ✓ |
| median CI lower (n = 10) | 2 | 2 | 0 | exact | ✓ |
| median CI upper (n = 10) | 9 | 9 | 0 | exact | ✓ |
| median CI achieved level | 0.978515625 | 0.978515625 | 0 | abs ≤ 1e-12 | ✓ |
| CV of 1..10 | 0.5504818826 | 0.5504818826 | 0 | abs ≤ 1e-12 | ✓ |
skew_kurtosis_formula (cross-check, pass)
Reference: Joanes & Gill (1998) G1, G2 written out.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| skewness G1 | 1.679669481 | 1.679669481 | 0 | rel ≤ 1e-12 | ✓ |
| excess kurtosis G2 | 4.354974595 | 4.354974595 | 0 | rel ≤ 1e-12 | ✓ |
| CI of mean (lower) | 1.384882754 | 1.384882754 | 0 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| bandwidth (bw.nrd0 rule) | 0.8405844545 | 0.8405844545 | 0 | rel ≤ 1e-12 | ✓ |
| max | density − gaussian_kde | 8.326672685e-17 | 0 | 8.3e-17 | |
| density integrates to 1 (trapezoid) | 0.9999126587 | 1 | 8.7e-05 | abs ≤ 0.001 | ✓ |
| Tukey upper fence (type 7: Q3 = 7, IQR = 4) | 13 | 13 | 0 | abs ≤ 1e-12 | ✓ |
| upper whisker = largest value inside | 8 | 8 | 0 | exact | ✓ |
| outliers | 1 | 1 | 0 | exact | ✓ |
| at risk at 10 (6-MP) | 15 | 15 | 0 | exact | ✓ |
| at risk at 20 (6-MP) | 8 | 8 | 0 | exact | ✓ |
| S(10) from the at-risk table | 0.7529411765 | 0.7529 | 4.1e-05 | abs ≤ 5e-05 | ✓ |
Normality
shapiro_wilk_1965 (published, pass)
Reference: Shapiro & Wilk (1965), Biometrika 52:591, weights of 11 men: W = 0.79.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| W | 0.7888146948 | 0.79 | 0.0012 | abs ≤ 0.005 | ✓ |
dagostino_vs_scipy (cross-check, pass)
Reference: scipy.stats.normaltest (independent code).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| K² (n = 8) | 0.2839137035 | 0.2839137035 | 0 | rel ≤ 1e-10 | ✓ |
| P (n = 8) | 0.8676586936 | 0.8676586936 | 0 | rel ≤ 1e-09 | ✓ |
| K² (n = 25) | 7.197036835 | 7.197036835 | 0 | rel ≤ 1e-10 | ✓ |
| P (n = 25) | 0.0273642348 | 0.0273642348 | 0 | rel ≤ 1e-09 | ✓ |
| K² (n = 400) | 60.39892859 | 60.39892859 | 0 | rel ≤ 1e-10 | ✓ |
| P (n = 400) | 7.665479038e-14 | 7.665479038e-14 | 0 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| D (n = 8) | 0.2316672342 | 0.2316672342 | 0 | abs ≤ 1e-12 | ✓ |
| P at the Monte Carlo 0.05 critical value (n = 8) | 0.04887613044 | 0.05 | 0.0011 | abs ≤ 0.004 | ✓ |
| P at the Monte Carlo 0.01 critical value (n = 8) | 0.009279783518 | 0.01 | 0.00072 | abs ≤ 0.002 | ✓ |
| P at the Monte Carlo 0.2 critical value (n = 8) | 0.2071714239 | 0.2 | 0.0072 | abs ≤ 0.015 | ✓ |
| D (n = 20) | 0.1287657074 | 0.1287657074 | 0 | abs ≤ 1e-12 | ✓ |
| P at the Monte Carlo 0.05 critical value (n = 20) | 0.0535735007 | 0.05 | 0.0036 | abs ≤ 0.004 | ✓ |
| P at the Monte Carlo 0.01 critical value (n = 20) | 0.009660613543 | 0.01 | 0.00034 | abs ≤ 0.002 | ✓ |
| P at the Monte Carlo 0.2 critical value (n = 20) | 0.2133698623 | 0.2 | 0.013 | abs ≤ 0.015 | ✓ |
| D (n = 50) | 0.08349607776 | 0.08349607776 | 0 | abs ≤ 1e-12 | ✓ |
| P at the Monte Carlo 0.05 critical value (n = 50) | 0.049718402 | 0.05 | 0.00028 | abs ≤ 0.004 | ✓ |
| P at the Monte Carlo 0.01 critical value (n = 50) | 0.009996721454 | 0.01 | 3.3e-06 | abs ≤ 0.002 | ✓ |
| P at the Monte Carlo 0.2 critical value (n = 50) | 0.2099553583 | 0.2 | 0.01 | abs ≤ 0.015 | ✓ |
| D (n = 200) | 0.05881431148 | 0.05881431148 | 0 | abs ≤ 1e-12 | ✓ |
| P at the Monte Carlo 0.05 critical value (n = 200) | 0.04787933726 | 0.05 | 0.0021 | abs ≤ 0.004 | ✓ |
| P at the Monte Carlo 0.01 critical value (n = 200) | 0.01003956223 | 0.01 | 4e-05 | abs ≤ 0.002 | ✓ |
| P at the Monte Carlo 0.2 critical value (n = 200) | 0.2099113472 | 0.2 | 0.0099 | abs ≤ 0.015 | ✓ |
normality_identities (analytic, pass)
Reference: normality_differences = normality on first − second; normality_columns = normality on each column.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Shapiro–Wilk W of the differences | 0.8298713319 | 0.8298713319 | 0 | exact | ✓ |
| Shapiro–Wilk P of the differences | 0.03334160863 | 0.03334160863 | 0 | exact | ✓ |
| D'Agostino P of the differences | 0.003461601365 | 0.003461601365 | 0 | exact | ✓ |
| column a: Shapiro–Wilk P | 0.3456136552 | 0.3456136552 | 0 | exact | ✓ |
| column a: D'Agostino–Pearson omnibus P | 0.9715285802 | 0.9715285802 | 0 | exact | ✓ |
| column a: Kolmogorov–Smirnov (Lilliefors) P | 0.7910233326 | 0.7910233326 | 0 | exact | ✓ |
| column b: Shapiro–Wilk P | 7.481085553e-06 | 7.481085553e-06 | 0 | exact | ✓ |
| column b: D'Agostino–Pearson omnibus P | 1.744187627e-07 | 1.744187627e-07 | 0 | exact | ✓ |
| column b: Kolmogorov–Smirnov (Lilliefors) P | 0.001288891241 | 0.001288891241 | 0 | exact | ✓ |
| too-short column reported, not tested | 0 | 0 | 0 | exact | ✓ |
t tests
t_tests_sleep (published, pass)
Reference: Student's sleep data; R t.test documented output (t, df, P, 95% CI).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| paired t | -4.062127683 | -4.0621 | 2.8e-05 | abs ≤ 5e-05 | ✓ |
| paired P | 0.002832890197 | 0.002833 | 1.1e-07 | abs ≤ 5e-07 | ✓ |
| paired CI lower | -2.459885763 | -2.4598858 | 3.7e-08 | abs ≤ 1e-07 | ✓ |
| paired CI upper | -0.7001142367 | -0.7001142 | 3.7e-08 | abs ≤ 1e-07 | ✓ |
| Student t | -1.860813467 | -1.8608 | 1.3e-05 | abs ≤ 5e-05 | ✓ |
| Student P | 0.07918671422 | 0.07919 | 3.3e-06 | abs ≤ 5e-06 | ✓ |
| Student CI lower | -3.363874032 | -3.363874 | 3.2e-08 | abs ≤ 1e-06 | ✓ |
| Welch df | 17.77647352 | 17.776 | 0.00047 | abs ≤ 0.0005 | ✓ |
| Welch P | 0.07939414019 | 0.07939 | 4.1e-06 | abs ≤ 5e-06 | ✓ |
| Welch CI lower | -3.365483231 | -3.3654832 | 3.1e-08 | abs ≤ 1e-07 | ✓ |
| Welch CI upper | 0.2054832307 | 0.2054832 | 3.1e-08 | abs ≤ 1e-07 | ✓ |
t_tests_vs_scipy (cross-check, pass)
Reference: scipy.stats ttest_ind / ttest_rel / ttest_1samp with CIs.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t (welch=False) | -0.6676510472 | -0.6676510472 | 5e-16 | rel ≤ 1e-12 | ✓ |
| P one-sided (welch=False) | 0.2558137866 | 0.2558137866 | 4.3e-16 | rel ≤ 1e-10 | ✓ |
| CI upper (welch=False) | 0.6844290038 | 0.6844290038 | 6.5e-16 | rel ≤ 1e-10 | ✓ |
| t (welch=True) | -0.789877634 | -0.789877634 | 4.2e-16 | rel ≤ 1e-12 | ✓ |
| P one-sided (welch=True) | 0.2198832203 | 0.2198832203 | 5e-16 | rel ≤ 1e-10 | ✓ |
| CI upper (welch=True) | 0.5181077919 | 0.5181077919 | 4.3e-16 | rel ≤ 1e-10 | ✓ |
| paired P | 0.8716431059 | 0.8716431059 | 0 | rel ≤ 1e-10 | ✓ |
| paired CI lower | -0.9864873241 | -0.9864873241 | 0 | rel ≤ 1e-10 | ✓ |
| one-sample P | 0.6684625177 | 0.6684625177 | 3.3e-16 | rel ≤ 1e-10 | ✓ |
effect_size_ci_inversion (analytic, pass)
Reference: Definition of the noncentral-t interval (Steiger & Fouladi 1997).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| P(T <= t | lower) = 0.975 | 0.975 | 0.975 | 4.6e-15 | abs ≤ 1e-09 |
| P(T <= t | upper) = 0.025 | 0.025 | 0.025 | 9.9e-15 | abs ≤ 1e-09 |
| Hedges' J(18) exact | 0.957646427 | 0.957646427 | 1.8e-15 | abs ≤ 1e-12 | ✓ |
| Hedges' J vs approximation 1 - 3/(4df - 1) | 0.957646427 | 0.9577464789 | 0.0001 | abs ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 0.0511462616 | 0.0511462616 | LRE 14.0 | LRE ≥ 12 | ✓ |
| MS between | 0.0127865654 | 0.0127865654 | LRE 14.0 | LRE ≥ 12 | ✓ |
| F | 1.180462374 | 1.180462374 | LRE 13.1 | LRE ≥ 12 | ✓ |
| SS within | 0.21663656 | 0.21663656 | LRE 13.1 | LRE ≥ 12 | ✓ |
| MS within | 0.010831828 | 0.010831828 | LRE 13.1 | LRE ≥ 12 | ✓ |
| R² | 0.1909990391 | 0.1909990391 | LRE 13.2 | LRE ≥ 12 | ✓ |
| residual SD | 0.1040760683 | 0.1040760683 | LRE 13.4 | LRE ≥ 12 | ✓ |
| df between | 4 | 4 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 0.0511462616 | 0.0511462616 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 0.21663656 | 0.21663656 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 1.68 | 1.68 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS between | 0.21 | 0.21 | LRE 15.0 | LRE ≥ 12 | ✓ |
| F | 21 | 21 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within | 1.8 | 1.8 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS within | 0.01 | 0.01 | LRE 15.0 | LRE ≥ 12 | ✓ |
| R² | 0.4827586207 | 0.4827586207 | LRE 15.0 | LRE ≥ 12 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 12 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 1.68 | 1.68 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 1.8 | 1.8 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 16.08 | 16.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS between | 2.01 | 2.01 | LRE 15.0 | LRE ≥ 12 | ✓ |
| F | 201 | 201 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within | 18 | 18 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS within | 0.01 | 0.01 | LRE 15.0 | LRE ≥ 12 | ✓ |
| R² | 0.4718309859 | 0.4718309859 | LRE 15.0 | LRE ≥ 12 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 12 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 16.08 | 16.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 18 | 18 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 160.08 | 160.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS between | 20.01 | 20.01 | LRE 15.0 | LRE ≥ 12 | ✓ |
| F | 2001 | 2001 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within | 180 | 180 | LRE 15.0 | LRE ≥ 12 | ✓ |
| MS within | 0.01 | 0.01 | LRE 15.0 | LRE ≥ 12 | ✓ |
| R² | 0.4707127735 | 0.4707127735 | LRE 15.0 | LRE ≥ 12 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 15.0 | LRE ≥ 12 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 160.08 | 160.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 180 | 180 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 3.638341875e-09 | 3.638341875e-09 | LRE 10.2 | LRE ≥ 9.5 | ✓ |
| MS between | 3.638341875e-09 | 3.638341875e-09 | LRE 10.2 | LRE ≥ 9.5 | ✓ |
| F | 15.94673357 | 15.94673357 | LRE 10.2 | LRE ≥ 9.5 | ✓ |
| SS within | 1.049517292e-08 | 1.049517292e-08 | LRE 10.9 | LRE ≥ 9.5 | ✓ |
| MS within | 2.28155933e-10 | 2.28155933e-10 | LRE 10.9 | LRE ≥ 9.5 | ✓ |
| R² | 0.2574265445 | 0.2574265445 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| residual SD | 1.510483144e-05 | 1.510483144e-05 | LRE 11.2 | LRE ≥ 9.5 | ✓ |
| df between | 1 | 1 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 3.638341875e-09 | 3.638341875e-09 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 1.049517292e-08 | 1.049517292e-08 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 1.68 | 1.68 | LRE 10.1 | LRE ≥ 9.5 | ✓ |
| MS between | 0.21 | 0.21 | LRE 10.1 | LRE ≥ 9.5 | ✓ |
| F | 21 | 21 | LRE 10.4 | LRE ≥ 9.5 | ✓ |
| SS within | 1.8 | 1.8 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| MS within | 0.01 | 0.01 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| R² | 0.4827586207 | 0.4827586207 | LRE 10.7 | LRE ≥ 9.5 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 10.6 | LRE ≥ 9.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 1.68 | 1.68 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 1.8 | 1.8 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 16.08 | 16.08 | LRE 9.9 | LRE ≥ 9.5 | ✓ |
| MS between | 2.01 | 2.01 | LRE 9.9 | LRE ≥ 9.5 | ✓ |
| F | 201 | 201 | LRE 10.2 | LRE ≥ 9.5 | ✓ |
| SS within | 18 | 18 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| MS within | 0.01 | 0.01 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| R² | 0.4718309859 | 0.4718309859 | LRE 10.5 | LRE ≥ 9.5 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 10.6 | LRE ≥ 9.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 16.08 | 16.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 18 | 18 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 160.08 | 160.08 | LRE 9.9 | LRE ≥ 9.5 | ✓ |
| MS between | 20.01 | 20.01 | LRE 9.9 | LRE ≥ 9.5 | ✓ |
| F | 2001 | 2001 | LRE 10.2 | LRE ≥ 9.5 | ✓ |
| SS within | 180 | 180 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| MS within | 0.01 | 0.01 | LRE 10.3 | LRE ≥ 9.5 | ✓ |
| R² | 0.4707127735 | 0.4707127735 | LRE 10.5 | LRE ≥ 9.5 | ✓ |
| residual SD | 0.1 | 0.1 | LRE 10.6 | LRE ≥ 9.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 160.08 | 160.08 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 180 | 180 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 1.680156269 | 1.68 | LRE 4.0 | LRE ≥ 3.5 | ✓ |
| MS between | 0.2100195337 | 0.21 | LRE 4.0 | LRE ≥ 3.5 | ✓ |
| F | 21.00081189 | 21 | LRE 4.4 | LRE ≥ 3.5 | ✓ |
| SS within | 1.800097837 | 1.8 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| MS within | 0.01000054354 | 0.01 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| R² | 0.4827682743 | 0.4827586207 | LRE 4.7 | LRE ≥ 3.5 | ✓ |
| residual SD | 0.1000027177 | 0.1 | LRE 4.6 | LRE ≥ 3.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 1.680156269 | 1.680156269 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 1.800097837 | 1.800097837 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 16.08191428 | 16.08 | LRE 3.9 | LRE ≥ 3.5 | ✓ |
| MS between | 2.010239286 | 2.01 | LRE 3.9 | LRE ≥ 3.5 | ✓ |
| F | 201.0130041 | 201 | LRE 4.2 | LRE ≥ 3.5 | ✓ |
| SS within | 18.00097825 | 18 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| MS within | 0.01000054347 | 0.01 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| R² | 0.4718471083 | 0.4718309859 | LRE 4.5 | LRE ≥ 3.5 | ✓ |
| residual SD | 0.1000027173 | 0.1 | LRE 4.6 | LRE ≥ 3.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 16.08191428 | 16.08191428 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 18.00097825 | 18.00097825 | LRE 15.0 | LRE ≥ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS between | 160.0994944 | 160.08 | LRE 3.9 | LRE ≥ 3.5 | ✓ |
| MS between | 20.0124368 | 20.01 | LRE 3.9 | LRE ≥ 3.5 | ✓ |
| F | 2001.134926 | 2001 | LRE 4.2 | LRE ≥ 3.5 | ✓ |
| SS within | 180.0097823 | 180 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| MS within | 0.01000054346 | 0.01 | LRE 4.3 | LRE ≥ 3.5 | ✓ |
| R² | 0.4707295724 | 0.4707127735 | LRE 4.4 | LRE ≥ 3.5 | ✓ |
| residual SD | 0.1000027173 | 0.1 | LRE 4.6 | LRE ≥ 3.5 | ✓ |
| df between | 8 | 8 | 0 | exact | ✓ |
| SS between (vs exact rational result for the binary inputs) | 160.0994944 | 160.0994944 | LRE 15.0 | LRE ≥ 12 | ✓ |
| SS within (vs exact rational result for the binary inputs) | 180.0097823 | 180.0097823 | LRE 15.0 | LRE ≥ 12 | ✓ |
welch_brown_forsythe_vs_statsmodels (cross-check, pass)
Reference: statsmodels.stats.oneway.anova_oneway.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Welch F | 0.2832578047 | 0.2832578047 | 0 | rel ≤ 1e-10 | ✓ |
| Welch df2 | 9.61163123 | 9.61163123 | 1.8e-16 | rel ≤ 1e-10 | ✓ |
| Welch P | 0.8363667501 | 0.8363667501 | 0 | rel ≤ 1e-09 | ✓ |
| Brown–Forsythe F* | 0.3398105138 | 0.3398105138 | 0 | rel ≤ 1e-10 | ✓ |
| Brown–Forsythe df2 | 16.41494807 | 16.41494807 | 2.2e-16 | rel ≤ 1e-10 | ✓ |
| Brown–Forsythe P (Satterthwaite) | 0.7968332735 | 0.7968332735 | 0 | rel ≤ 1e-09 | ✓ |
| ordinary F | 0.370497095 | 0.370497095 | 3e-16 | rel ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS material | 10683.72222 | 10683.72 | 0.0022 | abs ≤ 0.005 | ✓ |
| SS temperature | 39118.72222 | 39118.72 | 0.0022 | abs ≤ 0.005 | ✓ |
| SS interaction | 9613.777778 | 9613.78 | 0.0022 | abs ≤ 0.005 | ✓ |
| SS error | 18230.75 | 18230.75 | 0 | abs ≤ 0.005 | ✓ |
| F material | 7.911372269 | 7.91 | 0.0014 | abs ≤ 0.005 | ✓ |
| F temperature | 28.96769195 | 28.97 | 0.0023 | abs ≤ 0.005 | ✓ |
| F interaction | 3.5595354 | 3.56 | 0.00046 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Type 1 SS A | 9.982016903 | 9.982016903 | 0 | rel ≤ 1e-09 | ✓ |
| Type 1 F A | 3.528175337 | 3.528175337 | 0 | rel ≤ 1e-09 | ✓ |
| Type 1 SS B | 1.296317994 | 1.296317994 | 6.9e-16 | rel ≤ 1e-09 | ✓ |
| Type 1 F B | 0.9163753616 | 0.9163753616 | 7.3e-16 | rel ≤ 1e-09 | ✓ |
| Type 1 SS A × B | 7.298636813 | 7.298636813 | 3.7e-16 | rel ≤ 1e-09 | ✓ |
| Type 1 F A × B | 2.579726187 | 2.579726187 | 3.4e-16 | rel ≤ 1e-09 | ✓ |
| Type 2 SS A | 10.884375 | 10.884375 | 4.9e-16 | rel ≤ 1e-09 | ✓ |
| Type 2 F A | 3.847116652 | 3.847116652 | 4.6e-16 | rel ≤ 1e-09 | ✓ |
| Type 2 SS B | 1.296317994 | 1.296317994 | 1.2e-15 | rel ≤ 1e-09 | ✓ |
| Type 2 F B | 0.9163753616 | 0.9163753616 | 1.1e-15 | rel ≤ 1e-09 | ✓ |
| Type 2 SS A × B | 7.298636813 | 7.298636813 | 1.6e-15 | rel ≤ 1e-09 | ✓ |
| Type 2 F A × B | 2.579726187 | 2.579726187 | 1.5e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 SS A | 8.422022152 | 8.422022152 | 1.5e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 F A | 2.976790275 | 2.976790275 | 1.5e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 SS B | 1.57545878 | 1.57545878 | 1.8e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 F B | 1.113701743 | 1.113701743 | 1.8e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 SS A × B | 7.298636813 | 7.298636813 | 1.6e-15 | rel ≤ 1e-09 | ✓ |
| Type 3 F A × B | 2.579726187 | 2.579726187 | 1.5e-15 | rel ≤ 1e-09 | ✓ |
| 3-way Type III SS A × B × Cf | 2.484550797 | 2.484550797 | 1.8e-16 | rel ≤ 1e-09 | ✓ |
| 3-way residual SS | 15.96550557 | 15.96550557 | 1.1e-16 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| difference of marginal means | -0.1657892255 | -0.1657892255 | 0 | rel ≤ 1e-10 | ✓ |
| SE | 0.350180199 | 0.350180199 | 1.6e-16 | rel ≤ 1e-10 | ✓ |
| unadjusted P | 0.6403623008 | 0.6403623008 | 0 | rel ≤ 1e-09 | ✓ |
Multiple comparisons
tukey_vs_scipy_statsmodels (cross-check, pass)
Reference: scipy.stats.tukey_hsd and statsmodels pairwise_tukeyhsd (unequal n).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| P g0-g1 (scipy) | 0.7774835014 | 0.7774835014 | 4.7e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g0-g1 (scipy) | -2.31999541 | -2.31999541 | 4.3e-13 | abs ≤ 1e-06 | ✓ |
| P g0-g2 (scipy) | 0.04779725326 | 0.04779725326 | 8.9e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g0-g2 (scipy) | -3.268806196 | -3.268806196 | 4e-13 | abs ≤ 1e-06 | ✓ |
| P g0-g3 (scipy) | 0.961962849 | 0.961962849 | 2.9e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g0-g3 (scipy) | -1.751097687 | -1.751097687 | 3.7e-13 | abs ≤ 1e-06 | ✓ |
| P g1-g2 (scipy) | 0.3746588934 | 0.3746588934 | 2.1e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g1-g2 (scipy) | -2.859661548 | -2.859661548 | 4.4e-13 | abs ≤ 1e-06 | ✓ |
| P g1-g3 (scipy) | 0.9447387774 | 0.9447387774 | 4.1e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g1-g3 (scipy) | -1.355782507 | -1.355782507 | 4.1e-13 | abs ≤ 1e-06 | ✓ |
| P g2-g3 (scipy) | 0.09606225837 | 0.09606225837 | 8e-15 | abs ≤ 1e-06 | ✓ |
| CI lower g2-g3 (scipy) | -0.1886494865 | -0.1886494865 | 3.9e-13 | abs ≤ 1e-06 | ✓ |
| P g0-g2 (statsmodels) | 0.04779725326 | 0.04779725326 | 8.9e-15 | abs ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| q(0.95; 3, 10) | 3.87677675 | 3.877 | 0.00022 | abs ≤ 0.0005 | ✓ |
| q(0.95; 4, 20) | 3.958293561 | 3.958 | 0.00029 | abs ≤ 0.0005 | ✓ |
| q(0.95; 5, 20) | 4.231856749 | 4.232 | 0.00014 | abs ≤ 0.0005 | ✓ |
| q(0.95; 2, ∞) = 1.96·√2 | 2.771807649 | 2.771807671 | 2.2e-08 | abs ≤ 1e-06 | ✓ |
| P(Q ≤ 3.0; 3, 10) vs SciPy | 0.8650165848 | 0.8650165848 | 5.9e-15 | abs ≤ 1e-12 | ✓ |
| P(Q ≤ 4.5; 5, 20) vs SciPy | 0.9662705058 | 0.9662705058 | 1.2e-14 | abs ≤ 1e-12 | ✓ |
| P(Q ≤ 2.0; 2, 5) vs SciPy | 0.7835627707 | 0.7835627707 | 5.2e-15 | abs ≤ 1e-12 | ✓ |
| P(Q ≤ 5.5; 10, 60) vs SciPy | 0.9910892937 | 0.9910892937 | 2.3e-14 | abs ≤ 1e-12 | ✓ |
| P(Q ≤ 8.0; 3, 3) vs SciPy | 0.9778117209 | 0.9778117209 | 8.9e-15 | abs ≤ 1e-12 | ✓ |
| P(Q ≤ 1.0; 6, 30) vs SciPy | 0.02037459261 | 0.02037459261 | 3e-15 | abs ≤ 1e-12 | ✓ |
dunnett_tables (published, pass)
Reference: Dunnett (1955, 1964) two-sided tables at α = 0.05 (equal n), and one-sided df = 12.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| k = 2, df = ∞ | 2.212127747 | 2.21 | 0.0021 | abs ≤ 0.006 | ✓ |
| k = 3, df = ∞ | 2.34897059 | 2.35 | 0.001 | abs ≤ 0.006 | ✓ |
| k = 4, df = ∞ | 2.441770773 | 2.44 | 0.0018 | abs ≤ 0.006 | ✓ |
| k = 5, df = ∞ | 2.511463053 | 2.51 | 0.0015 | abs ≤ 0.006 | ✓ |
| k = 9, df = ∞ | 2.686223367 | 2.69 | 0.0038 | abs ≤ 0.006 | ✓ |
| k = 2, df = 12 | 2.50236676 | 2.5 | 0.0024 | abs ≤ 0.006 | ✓ |
| k = 3, df = 12 | 2.682870063 | 2.68 | 0.0029 | abs ≤ 0.006 | ✓ |
| k = 4, df = 12 | 2.807082619 | 2.81 | 0.0029 | abs ≤ 0.006 | ✓ |
| one-sided k = 2, df = 12 | 2.108057252 | 2.11 | 0.0019 | abs ≤ 0.006 | ✓ |
| k = 1 equals t(0.975, 12) | 2.17881283 | 2.17881283 | 9e-14 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| statistic a | 0.8570321259 | 0.8570321259 | 1.1e-16 | abs ≤ 1e-12 | ✓ |
| P a vs control | 0.62010198 | 0.6201269874 | 2.5e-05 | abs ≤ 0.0003 | ✓ |
| P b vs control | 0.005825360848 | 0.005822706866 | 2.7e-06 | abs ≤ 0.0003 | ✓ |
| CI lower b | 0.8397282064 | 0.8388691119 | 0.00086 | abs ≤ 0.003 | ✓ |
p_adjust_vs_statsmodels (cross-check, pass)
Reference: statsmodels.stats.multitest.multipletests.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| max | difference | bonferroni | 0 | 0 | 0 |
| max | difference | sidak | 0 | 0 | 0 |
| max | difference | holm | 0 | 0 | 0 |
| max | difference | holm_sidak | 0 | 0 | 0 |
| max | difference | hochberg | 0 | 0 | 0 |
| max | difference | fdr_bh | 1.387778781e-17 | 0 | 1.4e-17 |
| max | difference | fdr_by | 2.775557562e-17 | 0 | 2.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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| BH rejections | 4 | 4 | 0 | exact | ✓ |
| Bonferroni rejections | 3 | 3 | 0 | exact | ✓ |
k2_identities (analytic, pass)
Reference: With 2 groups Tukey = Student t test, Games–Howell = Welch t test, Dunn = Kruskal–Wallis.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Tukey P = Student P | 0.1757794584 | 0.1757794584 | 5.7e-15 | abs ≤ 1e-08 | ✓ |
| Games–Howell P = Welch P | 0.1437496694 | 0.1437496694 | 3.1e-15 | abs ≤ 1e-08 | ✓ |
| Dunn z² = H | 2.355742297 | 2.355742297 | 1.1e-15 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| F (sphericity assumed) | 38.02793296 | 38.028 | 6.7e-05 | abs ≤ 0.0005 | ✓ |
| Greenhouse–Geisser ε | 0.4854917648 | 0.4855 | 8.2e-06 | abs ≤ 5e-05 | ✓ |
| Huynh–Feldt ε | 0.6778074916 | 0.6778 | 7.5e-06 | abs ≤ 5e-05 | ✓ |
| Mauchly W | 0.03108445938 | 0.031084 | 4.6e-07 | abs ≤ 5e-07 | ✓ |
| Mauchly P | 0.04758466957 | 0.04765 | 6.5e-05 | abs ≤ 0.0001 | ✓ |
| Mauchly W (noise × deg) | 0.8937772493 | 0.89378 | 2.8e-06 | abs ≤ 5e-06 | ✓ |
| Mauchly P (noise × deg) | 0.638141785 | 0.6381 | 4.2e-05 | abs ≤ 5e-05 | ✓ |
rm_anova_vs_statsmodels (cross-check, pass)
Reference: statsmodels AnovaRM (one and two within factors); Box (1954) epsilon from the covariance matrix.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| one-way F | 6.626914358 | 6.626914358 | 1.3e-16 | rel ≤ 1e-10 | ✓ |
| one-way P | 0.002030216913 | 0.002030216913 | 2.3e-15 | rel ≤ 1e-09 | ✓ |
| GG ε vs Box's formula | 0.4437028356 | 0.4437028356 | 8.8e-16 | rel ≤ 1e-12 | ✓ |
| two-way F (a) | 0.4924913043 | 0.4924913043 | 2.7e-15 | rel ≤ 1e-10 | ✓ |
| two-way F (b) | 17.20933745 | 17.20933745 | 2.1e-16 | rel ≤ 1e-10 | ✓ |
| two-way F (a × b) | 0.9506289465 | 0.9506289465 | 1.4e-15 | rel ≤ 1e-10 | ✓ |
split_plot_hand_formulas (analytic, pass)
Reference: Classical split-plot sums of squares computed by hand formulas (balanced design).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SS group | 15.7034356 | 15.7034356 | 1.6e-15 | rel ≤ 1e-10 | ✓ |
| SS subjects within groups | 41.27294816 | 41.27294816 | 0 | rel ≤ 1e-10 | ✓ |
| SS time | 2.775627989 | 2.775627989 | 9.6e-16 | rel ≤ 1e-10 | ✓ |
| SS time × group | 2.895362973 | 2.895362973 | 6.1e-16 | rel ≤ 1e-10 | ✓ |
| SS total = sum of all rows | 104.0931066 | 104.0931066 | 1.4e-16 | rel ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| separate-error comparison P = paired t P | 0.0206027908 | 0.0206027908 | 0 | abs ≤ 1e-12 | ✓ |
| separate-error comparison t | -2.87710857 | -2.87710857 | 0 | abs ≤ 1e-12 | ✓ |
| mixed model REML log-likelihood (4 missing values) | -60.08499928 | -60.08499928 | 6.1e-14 | rel ≤ 1e-06 | ✓ |
| subject variance | 5.0240768 | 5.024070475 | 1.3e-06 | rel ≤ 0.001 | ✓ |
| residual variance | 1.362115718 | 1.362116336 | 4.5e-07 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| F time | 0.8740405301 | 0.8740405301 | 2.6e-12 | rel ≤ 0.0001 | ✓ |
| F group | 4.233426289 | 4.233426289 | 7.8e-12 | rel ≤ 0.0001 | ✓ |
| F time × group | 0.9965887762 | 0.9965887762 | 2.6e-12 | rel ≤ 0.0001 | ✓ |
| REML log-likelihood vs statsmodels formula API | -86.97672377 | -86.97672377 | 1.5e-12 | rel ≤ 1e-06 | ✓ |
Nonparametric tests
nonparametric_r_examples (published, pass)
Reference: R documentation examples (Hollander & Wolfe data) for wilcox.test, kruskal.test, friedman.test.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Mann–Whitney W (= U) | 35 | 35 | 0 | exact | ✓ |
| Mann–Whitney P (one-sided) | 0.1272061272 | 0.1272 | 6.1e-06 | abs ≤ 5e-05 | ✓ |
| Wilcoxon V (= W+) | 40 | 40 | 0 | exact | ✓ |
| Wilcoxon P (one-sided) | 0.01953125 | 0.01953 | 1.3e-06 | abs ≤ 5e-06 | ✓ |
| Kruskal–Wallis H | 0.7714285714 | 0.77143 | 1.4e-06 | abs ≤ 5e-06 | ✓ |
| Kruskal–Wallis P | 0.6799647736 | 0.68 | 3.5e-05 | abs ≤ 0.005 | ✓ |
| Friedman χ² | 11.14285714 | 11.143 | 0.00014 | abs ≤ 0.0005 | ✓ |
| Friedman P | 0.003805040776 | 0.003805 | 4.1e-08 | abs ≤ 5e-07 | ✓ |
nonparametric_vs_scipy (cross-check, pass)
Reference: scipy.stats mannwhitneyu, wilcoxon, kruskal, friedmanchisquare (with ties, normal approximation).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Mann–Whitney U | 316 | 316 | 0 | abs ≤ 1e-12 | ✓ |
| Mann–Whitney P (ties) | 0.4835763934 | 0.4835763934 | 0 | rel ≤ 1e-10 | ✓ |
| Mann–Whitney exact P | 0.06349206349 | 0.06349206349 | 0 | abs ≤ 1e-12 | ✓ |
| Wilcoxon P (ties) | 0.563071405 | 0.563071405 | 0 | rel ≤ 1e-10 | ✓ |
| Kruskal–Wallis H | 1.95891628 | 1.95891628 | 0 | rel ≤ 1e-10 | ✓ |
| Friedman χ² (ties) | 2.024390244 | 2.024390244 | 0 | rel ≤ 1e-10 | ✓ |
exact_null_distributions (analytic, pass)
Reference: Brute-force enumeration of all rank assignments / sign patterns.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Mann–Whitney pmf (4, 5): max abs error | 1.387778781e-17 | 0 | 1.4e-17 | abs ≤ 1e-15 | ✓ |
| signed-rank pmf (8): max abs error | 0 | 0 | 0 | abs ≤ 1e-15 | ✓ |
hodges_lehmann_definition (analytic, pass)
Reference: Hodges–Lehmann estimators and order-statistic CIs from their definitions.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| shift estimate = median of differences | 0.305 | 0.305 | 0 | abs ≤ 1e-12 | ✓ |
| CI lower = d_(c) | -0.15 | -0.15 | 0 | abs ≤ 1e-12 | ✓ |
| CI upper = d_(N+1-c) | 0.76 | 0.76 | 0 | abs ≤ 1e-12 | ✓ |
| achieved coverage | 0.96003996 | 0.96003996 | 0 | abs ≤ 1e-12 | ✓ |
Correlation
correlation_r_example (published, pass)
Reference: R cor.test documentation example (Hollander & Wolfe): Pearson, Kendall, Spearman.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Pearson r | 0.5711815576 | 0.5711816 | 4.2e-08 | abs ≤ 5e-08 | ✓ |
| Pearson t | 1.841082638 | 1.8411 | 1.7e-05 | abs ≤ 5e-05 | ✓ |
| Pearson P | 0.1081730543 | 0.1082 | 2.7e-05 | abs ≤ 5e-05 | ✓ |
| Pearson CI lower | -0.149742633 | -0.1497426 | 3.3e-08 | abs ≤ 5e-08 | ✓ |
| Pearson CI upper | 0.8955794618 | 0.8955795 | 3.8e-08 | abs ≤ 5e-08 | ✓ |
| Kendall tau | 0.4444444444 | 0.4444444 | 4.4e-08 | abs ≤ 5e-08 | ✓ |
| Kendall P (one-sided) | 0.05971946649 | 0.05972 | 5.3e-07 | abs ≤ 5e-06 | ✓ |
| Spearman rho | 0.6 | 0.6 | 0 | abs ≤ 1e-12 | ✓ |
| Spearman exact P | 0.09679783951 | 0.0968 | 2.2e-06 | abs ≤ 5e-05 | ✓ |
correlation_vs_scipy (cross-check, pass)
Reference: scipy.stats pearsonr (with CI), spearmanr, kendalltau.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Pearson P | 0.03949649129 | 0.03949649129 | 2.3e-15 | rel ≤ 1e-10 | ✓ |
| Pearson CI lower | 0.02041499791 | 0.02041499791 | 0 | abs ≤ 1e-12 | ✓ |
| Spearman rho | 0.3619577308 | 0.3619577308 | 0 | abs ≤ 1e-12 | ✓ |
| Spearman P (n > 9: t approximation) | 0.04935561207 | 0.04935561207 | 0 | rel ≤ 1e-10 | ✓ |
| Kendall tau-b | 0.2597701149 | 0.2597701149 | 0 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| χ² | 30.0701491 | 30.07 | 0.00015 | abs ≤ 0.005 | ✓ |
| χ² P | 2.953589183e-07 | 2.954e-07 | 4.1e-11 | abs ≤ 5e-10 | ✓ |
| Fisher P two-sided | 0.4857142857 | 0.4857 | 1.4e-05 | abs ≤ 5e-05 | ✓ |
| Fisher P one-sided | 0.2428571429 | 0.2429 | 4.3e-05 | abs ≤ 5e-05 | ✓ |
| conditional MLE odds ratio | 6.408319658 | 6.408309 | 1.1e-05 | abs ≤ 5e-05 | ✓ |
| exact CI lower | 0.2117355954 | 0.2117329 | 2.7e-06 | abs ≤ 5e-06 | ✓ |
| exact CI upper: P(X <= 3 | upper) = 0.025 | 0.025 | 0.025 | 3.5e-18 | abs ≤ 1e-10 |
| one-sided CI lower | 0.3135737675 | 0.3135693 | 4.5e-06 | abs ≤ 5e-06 | ✓ |
| Freeman–Halton P (4 × 4 job satisfaction) | 0.782684939 | 0.7827 | 1.5e-05 | abs ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| odds ratio | 1.832053942 | 1.83 | 0.0021 | abs ≤ 0.005 | ✓ |
| OR CI lower | 1.440042392 | 1.44 | 4.2e-05 | abs ≤ 0.005 | ✓ |
| OR CI upper | 2.33077975 | 2.33 | 0.00078 | abs ≤ 0.005 | ✓ |
| relative risk | 1.817801794 | 1.82 | 0.0022 | abs ≤ 0.005 | ✓ |
| Koopman lower | 2.939569192 | 2.94 | 0.00043 | abs ≤ 0.005 | ✓ |
| Koopman upper | 7.152223435 | 7.15 | 0.0022 | abs ≤ 0.005 | ✓ |
| Newcombe lower | 0.0524314724 | 0.0524 | 3.1e-05 | abs ≤ 5e-05 | ✓ |
| Newcombe upper | 0.333872654 | 0.3339 | 2.7e-05 | abs ≤ 5e-05 | ✓ |
| Wilson lower | 0.2552885199 | 0.2553 | 1.1e-05 | abs ≤ 5e-05 | ✓ |
| Wilson upper | 0.366209577 | 0.3662 | 9.6e-06 | abs ≤ 5e-05 | ✓ |
contingency_vs_scipy_statsmodels (cross-check, pass)
Reference: scipy chi2_contingency (Yates), scipy fisher_exact, statsmodels Table2x2 and mcnemar.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Yates χ² | 1.455996379 | 1.455996379 | 0 | rel ≤ 1e-12 | ✓ |
| Yates P | 0.2275682146 | 0.2275682146 | 0 | rel ≤ 1e-12 | ✓ |
| Woolf OR CI lower | 0.7335296471 | 0.7335296471 | 1.5e-16 | rel ≤ 1e-10 | ✓ |
| Katz RR CI upper | 3.043689035 | 3.043689035 | 4.4e-16 | rel ≤ 1e-10 | ✓ |
| G statistic | 2.460043008 | 2.460043008 | 0 | rel ≤ 1e-10 | ✓ |
| Fisher P [[8, 2], [1, 5]] | 0.03496503497 | 0.03496503497 | 0 | abs ≤ 1e-12 | ✓ |
| Freeman–Halton P = Fisher P [[8, 2], [1, 5]] | 0.03496503497 | 0.03496503497 | 1.5e-16 | abs ≤ 1e-12 | ✓ |
| Fisher P [[20, 15], [5, 30]] | 0.0003674340276 | 0.0003674340276 | 0 | abs ≤ 1e-12 | ✓ |
| Freeman–Halton P = Fisher P [[20, 15], [5, 30]] | 0.0003674340276 | 0.0003674340276 | 4.4e-18 | abs ≤ 1e-12 | ✓ |
| Fisher P [[0, 7], [6, 2]] | 0.006993006993 | 0.006993006993 | 0 | abs ≤ 1e-12 | ✓ |
| Freeman–Halton P = Fisher P [[0, 7], [6, 2]] | 0.006993006993 | 0.006993006993 | 4.3e-18 | abs ≤ 1e-12 | ✓ |
| McNemar χ² P (corrected) | 4.114562281e-05 | 4.114562281e-05 | 0 | rel ≤ 1e-12 | ✓ |
| McNemar exact P | 0.1459960938 | 0.1459960938 | 0 | abs ≤ 1e-12 | ✓ |
freeman_halton_vs_permutation (cross-check, pass)
Reference: scipy fisher_exact with 200,000 seeded Monte Carlo tables (2 × 3).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| exact P vs Monte Carlo | 0.00867441737 | 0.00860995695 | 6.4e-05 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Koopman upper limit unbounded (null) | 1 | 1 | 0 | exact | ✓ |
| Koopman lower limit finite and > 1 | 1 | 1 | 0 | exact | ✓ |
| Clopper–Pearson upper for 0/20 = 1 − 0.025^(1/20) | 0.168433471 | 0.168433471 | 8.3e-17 | abs ≤ 1e-12 | ✓ |
| Clopper–Pearson lower for 0/20 | 0 | 0 | 0 | exact | ✓ |
| Clopper–Pearson lower for 20/20 = 0.025^(1/20) | 0.831566529 | 0.831566529 | 1.1e-16 | abs ≤ 1e-12 | ✓ |
| Woolf interval uses the 0.5 correction | 1 | 1 | 0 | exact | ✓ |
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').
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| S(6) | 0.8571428571 | 0.857 | 0.00014 | abs ≤ 0.0005 | ✓ |
| S(7) | 0.8067226891 | 0.807 | 0.00028 | abs ≤ 0.0005 | ✓ |
| S(10) | 0.7529411765 | 0.753 | 5.9e-05 | abs ≤ 0.0005 | ✓ |
| S(13) | 0.6901960784 | 0.69 | 0.0002 | abs ≤ 0.0005 | ✓ |
| S(16) | 0.6274509804 | 0.627 | 0.00045 | abs ≤ 0.0005 | ✓ |
| S(22) | 0.5378151261 | 0.538 | 0.00018 | abs ≤ 0.0005 | ✓ |
| S(23) | 0.4481792717 | 0.448 | 0.00018 | abs ≤ 0.0005 | ✓ |
| Greenwood SE at 6 | 0.07636035483 | 0.0764 | 4e-05 | abs ≤ 5e-05 | ✓ |
| median 6-MP | 23 | 23 | 0 | exact | ✓ |
| median CI lower 6-MP | 16 | 16 | 0 | exact | ✓ |
| median placebo | 8 | 8 | 0 | exact | ✓ |
| median CI placebo lower | 4 | 4 | 0 | exact | ✓ |
| median CI placebo upper | 12 | 12 | 0 | exact | ✓ |
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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| log-rank χ² | 16.79294099 | 16.8 | 0.0071 | abs ≤ 0.05 | ✓ |
| Cox β (Efron) | 1.572125149 | 1.5721 | 2.5e-05 | abs ≤ 5e-05 | ✓ |
| Cox SE (Efron) | 0.4123967177 | 0.4124 | 3.3e-06 | abs ≤ 5e-05 | ✓ |
| Cox hazard ratio (Efron) | 4.816873898 | 4.817 | 0.00013 | abs ≤ 0.0005 | ✓ |
| Cox LR χ² (Efron) | 16.35169084 | 16.35 | 0.0017 | abs ≤ 0.005 | ✓ |
| Cox β (Breslow) | 1.509191413 | 1.509 | 0.00019 | abs ≤ 0.0005 | ✓ |
| Cox SE (Breslow) | 0.4095644064 | 0.41 | 0.00044 | abs ≤ 0.0005 | ✓ |
survival_vs_lifelines_statsmodels (cross-check, pass)
Reference: lifelines (KaplanMeierFitter, logrank_test, CoxPHFitter) and statsmodels survdiff.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| log-log CI lower at 6 | 0.6197179553 | 0.6197179553 | 1.1e-16 | abs ≤ 1e-10 | ✓ |
| log-log CI lower at 13 | 0.4316102225 | 0.4316102225 | 1.7e-16 | abs ≤ 1e-10 | ✓ |
| log-log CI lower at 23 | 0.188052006 | 0.188052006 | 8.3e-17 | abs ≤ 1e-10 | ✓ |
| logrank χ² vs lifelines | 16.79294099 | 16.79294099 | 6.3e-16 | rel ≤ 1e-10 | ✓ |
| logrank χ² vs statsmodels | 16.79294099 | 16.79294099 | 2.1e-16 | rel ≤ 1e-10 | ✓ |
| gehan_breslow_wilcoxon χ² vs lifelines | 13.45785205 | 13.45785205 | 2.6e-16 | rel ≤ 1e-10 | ✓ |
| gehan_breslow_wilcoxon χ² vs statsmodels | 13.45785205 | 13.45785205 | 2.6e-16 | rel ≤ 1e-10 | ✓ |
| tarone_ware χ² vs lifelines | 15.1235753 | 15.1235753 | 9.4e-16 | rel ≤ 1e-10 | ✓ |
| tarone_ware χ² vs statsmodels | 15.1235753 | 15.1235753 | 2.3e-16 | rel ≤ 1e-10 | ✓ |
| Cox β x1 vs lifelines | 0.5861818465 | 0.5861816644 | 3.1e-07 | rel ≤ 1e-05 | ✓ |
| Cox SE x2 vs lifelines | 0.2788071085 | 0.2788071023 | 2.2e-08 | rel ≤ 0.0001 | ✓ |
| concordance vs lifelines | 0.6983383042 | 0.6983383042 | 0 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| 3-group log-rank χ² | 1.474379361 | 1.474379361 | 9e-16 | rel ≤ 1e-10 | ✓ |
| 3-group df | 2 | 2 | 0 | exact | ✓ |
| S(0.6) with ties | 1 | 1 | 0 | abs ≤ 1e-12 | ✓ |
| S(3.6) with ties | 0.777666999 | 0.777666999 | 2.2e-16 | abs ≤ 1e-12 | ✓ |
| S(7) with ties | 0.5450751213 | 0.5450751213 | 2.2e-16 | abs ≤ 1e-12 | ✓ |
| S(14) with ties | 0.3815525849 | 0.3815525849 | 5.6e-17 | abs ≤ 1e-12 | ✓ |
| S(26) with ties | 0.214623329 | 0.214623329 | 8.3e-17 | abs ≤ 1e-12 | ✓ |
| trend χ² ≤ overall χ² (projection) | 0.7089040598 | 1.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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| AUC | 0.8931710615 | 0.893 | 0.00017 | abs ≤ 0.0005 | ✓ |
| SE (Hanley–McNeil) | 0.03248657961 | 0.032 | 0.00049 | abs ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| AUC = U/(n1 n0) | 0.6795833333 | 0.6795833333 | 0 | abs ≤ 1e-14 | ✓ |
| DeLong SE | 0.06427182248 | 0.06427182248 | 0 | rel ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| bias | -2.117647059 | -2.1 | 0.018 | abs ≤ 0.05 | ✓ |
| SD of differences | 38.76512987 | 38.8 | 0.035 | abs ≤ 0.05 | ✓ |
| lower limit | -79.64790681 | -79.7 | 0.052 | abs ≤ 0.1 | ✓ |
| upper limit | 75.41261269 | 75.5 | 0.087 | abs ≤ 0.1 | ✓ |
Linear regression
nist_lls_Norris (NIST, pass)
Reference: NIST StRD linear least squares 'Norris' (lower difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | -0.2623230738 | -0.2623230738 | LRE 12.3 | LRE ≥ 11 | ✓ |
| B1 | 1.002116818 | 1.002116818 | LRE 14.3 | LRE ≥ 11 | ✓ |
| SD(B0) | 0.2328182343 | 0.2328182343 | LRE 13.9 | LRE ≥ 11 | ✓ |
| SD(B1) | 0.0004297968482 | 0.0004297968482 | LRE 13.9 | LRE ≥ 11 | ✓ |
| residual SD | 0.8847963961 | 0.8847963961 | LRE 13.9 | LRE ≥ 11 | ✓ |
| R² | 0.9999937459 | 0.9999937459 | LRE 15.0 | LRE ≥ 11 | ✓ |
nist_lls_Pontius (NIST, pass)
Reference: NIST StRD linear least squares 'Pontius' (lower difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.0006735657895 | 0.0006735657895 | LRE 12.5 | LRE ≥ 11 | ✓ |
| B1 | 7.320591604e-07 | 7.320591604e-07 | LRE 15.0 | LRE ≥ 11 | ✓ |
| B2 | -3.160818713e-15 | -3.160818713e-15 | LRE 13.6 | LRE ≥ 11 | ✓ |
| SD(B0) | 0.000107938612 | 0.000107938612 | LRE 14.0 | LRE ≥ 11 | ✓ |
| SD(B1) | 1.578174e-10 | 1.578174e-10 | LRE 14.1 | LRE ≥ 11 | ✓ |
| SD(B2) | 4.8665285e-17 | 4.8665285e-17 | LRE 14.0 | LRE ≥ 11 | ✓ |
| residual SD | 0.0002051774241 | 0.0002051774241 | LRE 14.0 | LRE ≥ 11 | ✓ |
| R² | 0.9999999002 | 0.9999999002 | LRE 15.0 | LRE ≥ 11 | ✓ |
nist_lls_NoInt1 (NIST, pass)
Reference: NIST StRD linear least squares 'NoInt1' (average difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 2.074380165 | 2.074380165 | LRE 14.7 | LRE ≥ 11 | ✓ |
| SD(B0) | 0.01652892562 | 0.01652892562 | LRE 15.0 | LRE ≥ 11 | ✓ |
| residual SD | 3.56753034 | 3.56753034 | LRE 15.0 | LRE ≥ 11 | ✓ |
| R² | 0.9993654923 | 0.9993654923 | LRE 15.0 | LRE ≥ 11 | ✓ |
nist_lls_NoInt2 (NIST, pass)
Reference: NIST StRD linear least squares 'NoInt2' (average difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.7272727273 | 0.7272727273 | LRE 15.0 | LRE ≥ 11 | ✓ |
| SD(B0) | 0.04208273181 | 0.04208273181 | LRE 14.9 | LRE ≥ 11 | ✓ |
| residual SD | 0.3692744729 | 0.3692744729 | LRE 15.0 | LRE ≥ 11 | ✓ |
| R² | 0.9933481153 | 0.9933481153 | LRE 15.0 | LRE ≥ 11 | ✓ |
nist_lls_Filip (NIST, pass)
Reference: NIST StRD linear least squares 'Filip' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | -1467.489644 | -1467.489614 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B1 | -2772.179649 | -2772.179592 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B2 | -2316.371129 | -2316.371082 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B3 | -1127.973964 | -1127.973941 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B4 | -354.4782412 | -354.4782337 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B5 | -75.12420335 | -75.12420174 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B6 | -10.87531827 | -10.87531804 | LRE 7.7 | LRE ≥ 7 | ✓ |
| B7 | -1.06221501 | -1.062214986 | LRE 7.6 | LRE ≥ 7 | ✓ |
| B8 | -0.06701911702 | -0.06701911546 | LRE 7.6 | LRE ≥ 7 | ✓ |
| B9 | -0.002467810842 | -0.002467810783 | LRE 7.6 | LRE ≥ 7 | ✓ |
| B10 | -4.029625352e-05 | -4.029625251e-05 | LRE 7.6 | LRE ≥ 7 | ✓ |
| SD(B0) | 298.0845352 | 298.084531 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B1) | 559.7798735 | 559.7798655 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B2) | 466.4775788 | 466.4775721 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B3) | 227.2042778 | 227.2042745 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B4) | 71.64786714 | 71.64786609 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B5) | 15.2897181 | 15.28971787 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B6) | 2.236911632 | 2.236911598 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B7) | 0.2216243253 | 0.2216243219 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B8) | 0.01423637654 | 0.01423637632 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B9) | 0.0005356174175 | 0.0005356174089 | LRE 7.8 | LRE ≥ 7 | ✓ |
| SD(B10) | 8.96632852e-06 | 8.966328374e-06 | LRE 7.8 | LRE ≥ 7 | ✓ |
| residual SD | 0.003348010558 | 0.003348010513 | LRE 7.9 | LRE ≥ 7 | ✓ |
| R² | 0.9967274161 | 0.9967274162 | LRE 10.1 | LRE ≥ 7 | ✓ |
nist_lls_Longley (NIST, pass)
Reference: NIST StRD linear least squares 'Longley' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | -3482258.635 | -3482258.635 | LRE 12.3 | LRE ≥ 9 | ✓ |
| B1 | 15.06187227 | 15.06187227 | LRE 10.8 | LRE ≥ 9 | ✓ |
| B2 | -0.03581917929 | -0.03581917929 | LRE 11.9 | LRE ≥ 9 | ✓ |
| B3 | -2.020229804 | -2.020229804 | LRE 12.9 | LRE ≥ 9 | ✓ |
| B4 | -1.033226867 | -1.033226867 | LRE 13.1 | LRE ≥ 9 | ✓ |
| B5 | -0.05110410565 | -0.05110410565 | LRE 11.4 | LRE ≥ 9 | ✓ |
| B6 | 1829.151465 | 1829.151465 | LRE 12.3 | LRE ≥ 9 | ✓ |
| SD(B0) | 890420.3836 | 890420.3836 | LRE 13.5 | LRE ≥ 9 | ✓ |
| SD(B1) | 84.91492577 | 84.91492577 | LRE 12.6 | LRE ≥ 9 | ✓ |
| SD(B2) | 0.03349100777 | 0.03349100777 | LRE 13.4 | LRE ≥ 9 | ✓ |
| SD(B3) | 0.4883996817 | 0.4883996817 | LRE 12.8 | LRE ≥ 9 | ✓ |
| SD(B4) | 0.2142741632 | 0.2142741632 | LRE 13.0 | LRE ≥ 9 | ✓ |
| SD(B5) | 0.2260732001 | 0.2260732001 | LRE 13.2 | LRE ≥ 9 | ✓ |
| SD(B6) | 455.4784991 | 455.4784991 | LRE 13.4 | LRE ≥ 9 | ✓ |
| residual SD | 304.8540736 | 304.8540736 | LRE 12.9 | LRE ≥ 9 | ✓ |
| R² | 0.9954790046 | 0.9954790046 | LRE 14.8 | LRE ≥ 9 | ✓ |
nist_lls_Wampler1 (NIST, pass)
Reference: NIST StRD linear least squares 'Wampler1' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.9999999996 | 1 | LRE 9.4 | LRE ≥ 9 | ✓ |
| B1 | 0.9999999999 | 1 | LRE 10.1 | LRE ≥ 9 | ✓ |
| B2 | 1 | 1 | LRE 10.2 | LRE ≥ 9 | ✓ |
| B3 | 1 | 1 | LRE 11.0 | LRE ≥ 9 | ✓ |
| B4 | 1 | 1 | LRE 12.2 | LRE ≥ 9 | ✓ |
| B5 | 1 | 1 | LRE 13.9 | LRE ≥ 9 | ✓ |
| SD(B0) | 2.785904693e-10 | 0 | LRE 9.6 | LRE ≥ 9 | ✓ |
| SD(B1) | 3.059308448e-10 | 0 | LRE 9.5 | LRE ≥ 9 | ✓ |
| SD(B2) | 1.008758215e-10 | 0 | LRE 10.0 | LRE ≥ 9 | ✓ |
| SD(B3) | 1.313467664e-11 | 0 | LRE 10.9 | LRE ≥ 9 | ✓ |
| SD(B4) | 7.307574761e-13 | 0 | LRE 12.1 | LRE ≥ 9 | ✓ |
| SD(B5) | 1.453898266e-14 | 0 | LRE 13.8 | LRE ≥ 9 | ✓ |
| residual SD | 3.054898907e-10 | 0 | LRE 9.5 | LRE ≥ 9 | ✓ |
| R² | 1 | 1 | LRE 15.0 | LRE ≥ 9 | ✓ |
nist_lls_Wampler2 (NIST, pass)
Reference: NIST StRD linear least squares 'Wampler2' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 1 | 1 | LRE 15.0 | LRE ≥ 9 | ✓ |
| B1 | 0.1 | 0.1 | LRE 13.6 | LRE ≥ 9 | ✓ |
| B2 | 0.01 | 0.01 | LRE 12.9 | LRE ≥ 9 | ✓ |
| B3 | 0.001 | 0.001 | LRE 12.8 | LRE ≥ 9 | ✓ |
| B4 | 0.0001 | 0.0001 | LRE 13.1 | LRE ≥ 9 | ✓ |
| B5 | 1e-05 | 1e-05 | LRE 13.9 | LRE ≥ 9 | ✓ |
| SD(B0) | 4.744630559e-15 | 0 | LRE 14.3 | LRE ≥ 9 | ✓ |
| SD(B1) | 5.210260203e-15 | 0 | LRE 14.3 | LRE ≥ 9 | ✓ |
| SD(B2) | 1.718000283e-15 | 0 | LRE 14.8 | LRE ≥ 9 | ✓ |
| SD(B3) | 2.236946164e-16 | 0 | LRE 15.0 | LRE ≥ 9 | ✓ |
| SD(B4) | 1.244541589e-17 | 0 | LRE 15.0 | LRE ≥ 9 | ✓ |
| SD(B5) | 2.476111318e-19 | 0 | LRE 15.0 | LRE ≥ 9 | ✓ |
| residual SD | 5.202750382e-15 | 0 | LRE 14.3 | LRE ≥ 9 | ✓ |
| R² | 1 | 1 | LRE 15.0 | LRE ≥ 9 | ✓ |
nist_lls_Wampler3 (NIST, pass)
Reference: NIST StRD linear least squares 'Wampler3' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.9999999996 | 1 | LRE 9.5 | LRE ≥ 9 | ✓ |
| B1 | 1 | 1 | LRE 10.3 | LRE ≥ 9 | ✓ |
| B2 | 1 | 1 | LRE 10.2 | LRE ≥ 9 | ✓ |
| B3 | 1 | 1 | LRE 11.0 | LRE ≥ 9 | ✓ |
| B4 | 1 | 1 | LRE 12.2 | LRE ≥ 9 | ✓ |
| B5 | 1 | 1 | LRE 13.9 | LRE ≥ 9 | ✓ |
| SD(B0) | 2152.326247 | 2152.326247 | LRE 13.8 | LRE ≥ 9 | ✓ |
| SD(B1) | 2363.551735 | 2363.551735 | LRE 13.9 | LRE ≥ 9 | ✓ |
| SD(B2) | 779.3435243 | 779.3435243 | LRE 13.8 | LRE ≥ 9 | ✓ |
| SD(B3) | 101.4755076 | 101.4755076 | LRE 13.9 | LRE ≥ 9 | ✓ |
| SD(B4) | 5.645665122 | 5.645665122 | LRE 13.8 | LRE ≥ 9 | ✓ |
| SD(B5) | 0.1123248547 | 0.1123248547 | LRE 13.8 | LRE ≥ 9 | ✓ |
| residual SD | 2360.145024 | 2360.145024 | LRE 14.1 | LRE ≥ 9 | ✓ |
| R² | 0.999995559 | 0.999995559 | LRE 15.0 | LRE ≥ 9 | ✓ |
nist_lls_Wampler4 (NIST, pass)
Reference: NIST StRD linear least squares 'Wampler4' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.9999999987 | 1 | LRE 8.9 | LRE ≥ 8 | ✓ |
| B1 | 1.000000001 | 1 | LRE 8.8 | LRE ≥ 8 | ✓ |
| B2 | 0.9999999996 | 1 | LRE 9.4 | LRE ≥ 8 | ✓ |
| B3 | 1 | 1 | LRE 10.3 | LRE ≥ 8 | ✓ |
| B4 | 1 | 1 | LRE 11.6 | LRE ≥ 8 | ✓ |
| B5 | 1 | 1 | LRE 13.3 | LRE ≥ 8 | ✓ |
| SD(B0) | 215232.6247 | 215232.6247 | LRE 14.3 | LRE ≥ 8 | ✓ |
| SD(B1) | 236355.1735 | 236355.1735 | LRE 14.4 | LRE ≥ 8 | ✓ |
| SD(B2) | 77934.35243 | 77934.35243 | LRE 14.2 | LRE ≥ 8 | ✓ |
| SD(B3) | 10147.55076 | 10147.55076 | LRE 14.6 | LRE ≥ 8 | ✓ |
| SD(B4) | 564.5665122 | 564.5665122 | LRE 14.3 | LRE ≥ 8 | ✓ |
| SD(B5) | 11.23248547 | 11.23248547 | LRE 14.3 | LRE ≥ 8 | ✓ |
| residual SD | 236014.5024 | 236014.5024 | LRE 14.9 | LRE ≥ 8 | ✓ |
| R² | 0.9574784408 | 0.9574784408 | LRE 15.0 | LRE ≥ 8 | ✓ |
nist_lls_Wampler5 (NIST, pass)
Reference: NIST StRD linear least squares 'Wampler5' (higher difficulty).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| B0 | 0.9999999055 | 1 | LRE 7.0 | LRE ≥ 6 | ✓ |
| B1 | 1.000000148 | 1 | LRE 6.8 | LRE ≥ 6 | ✓ |
| B2 | 0.9999999512 | 1 | LRE 7.3 | LRE ≥ 6 | ✓ |
| B3 | 1.000000006 | 1 | LRE 8.2 | LRE ≥ 6 | ✓ |
| B4 | 0.9999999997 | 1 | LRE 9.5 | LRE ≥ 6 | ✓ |
| B5 | 1 | 1 | LRE 11.2 | LRE ≥ 6 | ✓ |
| SD(B0) | 21523262.47 | 21523262.47 | LRE 14.3 | LRE ≥ 6 | ✓ |
| SD(B1) | 23635517.35 | 23635517.35 | LRE 14.4 | LRE ≥ 6 | ✓ |
| SD(B2) | 7793435.243 | 7793435.243 | LRE 14.2 | LRE ≥ 6 | ✓ |
| SD(B3) | 1014755.076 | 1014755.076 | LRE 14.6 | LRE ≥ 6 | ✓ |
| SD(B4) | 56456.65122 | 56456.65122 | LRE 14.3 | LRE ≥ 6 | ✓ |
| SD(B5) | 1123.248547 | 1123.248547 | LRE 14.3 | LRE ≥ 6 | ✓ |
| residual SD | 23601450.24 | 23601450.24 | LRE 14.8 | LRE ≥ 6 | ✓ |
| R² | 0.002246689216 | 0.002246689216 | LRE 13.8 | LRE ≥ 6 | ✓ |
linear_regression_vs_statsmodels (cross-check, pass)
Reference: statsmodels OLS: confidence and prediction bands, comparison of slopes/intercepts (nested F tests).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| confidence band lower | 3.961891226 | 3.961891226 | 0 | rel ≤ 1e-10 | ✓ |
| prediction band upper | 6.176393178 | 6.176393178 | 0 | rel ≤ 1e-10 | ✓ |
| slope P | 0.0002067231672 | 0.0002067231672 | 2.1e-15 | rel ≤ 1e-09 | ✓ |
| slopes F | 4.938654892 | 4.938654892 | 1.3e-15 | rel ≤ 1e-10 | ✓ |
| intercepts F | 35.37369783 | 35.37369783 | 2e-16 | rel ≤ 1e-10 | ✓ |
| common slope | 0.6080020852 | 0.6080020852 | 3.7e-16 | rel ≤ 1e-10 | ✓ |
regression_diagnostics_vs_statsmodels (cross-check, pass)
Reference: statsmodels het_breuschpagan (Koenker form) and variance_inflation_factor.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Breusch–Pagan LM | 3.881504822 | 3.881504822 | 1.4e-15 | rel ≤ 1e-09 | ✓ |
| Breusch–Pagan P | 0.2745470291 | 0.2745470291 | 8.1e-16 | rel ≤ 1e-09 | ✓ |
| VIF x1 | 1.174975405 | 1.174975405 | 3.8e-16 | rel ≤ 1e-09 | ✓ |
| VIF x2 | 1.192640729 | 1.192640729 | 1.9e-16 | rel ≤ 1e-09 | ✓ |
| VIF x3 | 1.017586493 | 1.017586493 | 0 | rel ≤ 1e-09 | ✓ |
linear_regression_datasets (cross-check, pass)
Reference: Each line = linear_regression on that data set; scipy.stats.linregress.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| W1 slope = linear_regression | 0.008928144341 | 0.008928144341 | 0 | exact | ✓ |
| W1 slope CI upper = linear_regression | 0.01034033669 | 0.01034033669 | 0 | exact | ✓ |
| W1 slope vs linregress | 0.008928144341 | 0.008928144341 | 3.9e-16 | rel ≤ 1e-12 | ✓ |
| W1 slope SE vs linregress | 0.0005771324976 | 0.0005771324976 | 5.6e-16 | rel ≤ 1e-10 | ✓ |
| W1 R² vs linregress | 0.9755417289 | 0.9755417289 | 0 | rel ≤ 1e-12 | ✓ |
| W2 slope = linear_regression | 0.02008351648 | 0.02008351648 | 0 | exact | ✓ |
| W2 slope CI upper = linear_regression | 0.021918439 | 0.021918439 | 0 | exact | ✓ |
| W2 slope vs linregress | 0.02008351648 | 0.02008351648 | 3.5e-16 | rel ≤ 1e-12 | ✓ |
| W2 slope SE vs linregress | 0.0007498931821 | 0.0007498931821 | 1.5e-14 | rel ≤ 1e-10 | ✓ |
| W2 R² vs linregress | 0.9917043056 | 0.9917043056 | 1.1e-16 | rel ≤ 1e-12 | ✓ |
| W3 slope = linear_regression | 0.02928287734 | 0.02928287734 | 0 | exact | ✓ |
| W3 slope CI upper = linear_regression | 0.02989368245 | 0.02989368245 | 0 | exact | ✓ |
| W3 slope vs linregress | 0.02928287734 | 0.02928287734 | 1.2e-16 | rel ≤ 1e-12 | ✓ |
| W3 slope SE vs linregress | 0.0002496228487 | 0.0002496228487 | 6.3e-14 | rel ≤ 1e-10 | ✓ |
| W3 R² vs linregress | 0.9995641841 | 0.9995641841 | 0 | rel ≤ 1e-12 | ✓ |
| W4 slope = linear_regression | 0.04021453901 | 0.04021453901 | 0 | exact | ✓ |
| W4 slope CI upper = linear_regression | 0.04150838971 | 0.04150838971 | 0 | exact | ✓ |
| W4 slope vs linregress | 0.04021453901 | 0.04021453901 | 0 | rel ≤ 1e-12 | ✓ |
| W4 slope SE vs linregress | 0.0005287688253 | 0.0005287688253 | 3.5e-14 | rel ≤ 1e-10 | ✓ |
| W4 R² vs linregress | 0.9989637454 | 0.9989637454 | 1.1e-16 | rel ≤ 1e-12 | ✓ |
| W5 slope = linear_regression | 0.05109776 | 0.05109776 | 0 | exact | ✓ |
| W5 slope CI upper = linear_regression | 0.05209555203 | 0.05209555203 | 0 | exact | ✓ |
| W5 slope vs linregress | 0.05109776 | 0.05109776 | 1.4e-16 | rel ≤ 1e-12 | ✓ |
| W5 slope SE vs linregress | 0.0004077760412 | 0.0004077760412 | 8.8e-14 | rel ≤ 1e-10 | ✓ |
| W5 R² vs linregress | 0.9996180337 | 0.9996180337 | 0 | rel ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| β0 | 15.04290165 | 15.0429 | 1.6e-06 | abs ≤ 5e-05 | ✓ |
| β1 | -0.2321627442 | -0.2322 | 3.7e-05 | abs ≤ 5e-05 | ✓ |
| SE β0 | 7.378630132 | 7.3786 | 3e-05 | abs ≤ 5e-05 | ✓ |
| SE β1 | 0.1082364295 | 0.1082 | 3.6e-05 | abs ≤ 5e-05 | ✓ |
| residual deviance | 20.31519269 | 20.315 | 0.00019 | abs ≤ 0.0005 | ✓ |
| null deviance | 28.26715273 | 28.267 | 0.00015 | abs ≤ 0.0005 | ✓ |
logistic_vs_newton (cross-check, pass)
Reference: Independent Newton–Raphson maximum-likelihood fit written in this file (grouped binomial data).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| β0 | -0.2438602793 | -0.2438602793 | 0 | rel ≤ 1e-08 | ✓ |
| β1 | 0.8150750353 | 0.8150750353 | 2.7e-16 | rel ≤ 1e-08 | ✓ |
| β2 | -0.5622871086 | -0.5622871086 | 0 | rel ≤ 1e-08 | ✓ |
| SE β0 | 0.1365900068 | 0.1365900068 | 5.3e-11 | rel ≤ 1e-06 | ✓ |
| SE β1 | 0.09745699923 | 0.09745699924 | 1.2e-10 | rel ≤ 1e-06 | ✓ |
| SE β2 | 0.1908150964 | 0.1908150964 | 5.4e-11 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| intercept | 3.044522438 | 3.045 | 0.00048 | abs ≤ 0.0005 | ✓ |
| outcome2 | -0.4542552723 | -0.4543 | 4.5e-05 | abs ≤ 5e-05 | ✓ |
| outcome3 | -0.2929871247 | -0.293 | 1.3e-05 | abs ≤ 5e-05 | ✓ |
| residual deviance | 5.129141077 | 5.1291 | 4.1e-05 | abs ≤ 5e-05 | ✓ |
| null deviance | 10.58144586 | 10.5814 | 4.6e-05 | abs ≤ 5e-05 | ✓ |
| AIC | 56.7613184 | 56.76 | 0.0013 | abs ≤ 0.005 | ✓ |
poisson_vs_discrete_model (cross-check, pass)
Reference: statsmodels discrete Poisson model (Newton, separate code path from GLM/IRLS) with exposure offset.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| β0 | 0.158032922 | 0.158032922 | 1.9e-11 | rel ≤ 1e-06 | ✓ |
| β1 | 0.438836304 | 0.438836304 | 1.9e-12 | rel ≤ 1e-06 | ✓ |
| SE β1 | 0.08333673547 | 0.08333683925 | 1.2e-06 | rel ≤ 1e-05 | ✓ |
| log-likelihood | -101.888304 | -101.888304 | 0 | rel ≤ 1e-09 | ✓ |
PCA
pca_cross_checks (cross-check, pass)
Reference: Eigen-decomposition of the correlation matrix (numpy.linalg.eigh); statsmodels PCA.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| eigenvalue 1 vs eigh | 2.107385863 | 2.107385863 | 0 | rel ≤ 1e-10 | ✓ |
| eigenvalue 2 vs eigh | 1.789486981 | 1.789486981 | 2.5e-16 | rel ≤ 1e-10 | ✓ |
| eigenvalue 3 vs eigh | 0.9883500344 | 0.9883500344 | 1.8e-15 | rel ≤ 1e-10 | ✓ |
| eigenvalue 4 vs eigh | 0.06238015606 | 0.06238015606 | 4.8e-15 | rel ≤ 1e-10 | ✓ |
| eigenvalue 5 vs eigh | 0.05239696594 | 0.05239696594 | 5.6e-15 | rel ≤ 1e-10 | ✓ |
| variance proportion 1 vs statsmodels | 0.4214771725 | 0.4214771725 | 1.1e-15 | rel ≤ 1e-10 | ✓ |
| variance proportion 2 vs statsmodels | 0.3578973962 | 0.3578973962 | 4.7e-16 | rel ≤ 1e-10 | ✓ |
| variance proportion 3 vs statsmodels | 0.1976700069 | 0.1976700069 | 2.4e-15 | rel ≤ 1e-10 | ✓ |
| score covariance off-diagonal | 9.451129338e-16 | 0 | 9.5e-16 | abs ≤ 1e-10 | ✓ |
| Kaiser count = eigenvalues > 1 | 2 | 2 | 0 | exact | ✓ |
Area under curve
auc_analytic (analytic, pass)
Reference: Closed-form areas of piecewise-linear curves and ∫₀^π sin = 2.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| net area | 0 | 0 | 0 | abs ≤ 1e-15 | ✓ |
| positive area | 0.5 | 0.5 | 0 | abs ≤ 1e-15 | ✓ |
| alternating: positive | 0.75 | 0.75 | 0 | abs ≤ 1e-15 | ✓ |
| alternating: number of regions | 4 | 4 | 0 | exact | ✓ |
| ∫ sin (2001 points) | 1.999999589 | 2 | 4.1e-07 | abs ≤ 1e-06 | ✓ |
| area above baseline 2 | 7 | 7 | 0 | abs ≤ 1e-15 | ✓ |
| SE = sqrt(Σ (w·SE)²) | 0.2915475947 | 0.2915475947 | 0 | abs ≤ 1e-15 | ✓ |
auc_se_monte_carlo (cross-check, pass)
Reference: Monte Carlo SD of areas of 40,000 simulated curves (seeded).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| SE vs simulated SD | 2.05806341 | 2.057568912 | 0.00024 | rel ≤ 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).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| G | 2.468764611 | 2.4687 | 6.5e-05 | abs ≤ 0.0001 | ✓ |
| one-sided critical value | 2.031652002 | 2.032 | 0.00035 | abs ≤ 0.0005 | ✓ |
| outlier found | 1 | 1 | 0 | exact | ✓ |
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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t ratio (time 3) | 5.050673459 | 5.05 | 0.00067 | abs ≤ 0.005 | ✓ |
| t ratio (time 1) | 3.870721837 | 3.87 | 0.00072 | abs ≤ 0.005 | ✓ |
| t ratio (time 2) | 1.386727504 | 1.39 | 0.0033 | abs ≤ 0.005 | ✓ |
| P (time 1) | 0.003105506685 | 0.0031 | 5.5e-06 | abs ≤ 5e-05 | ✓ |
| P (time 3) | 0.0004987542606 | 0.0005 | 1.2e-06 | abs ≤ 5e-05 | ✓ |
| threshold rank 12, Q = 1% | 0.001538461538 | 0.0015 | 3.8e-05 | abs ≤ 5e-05 | ✓ |
| outliers at Q = 1% | 1 | 1 | 0 | exact | ✓ |
| outliers at Q = 5% | 2 | 2 | 0 | exact | ✓ |
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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t test power, n = 20, d = 1 | 0.8689530277 | 0.8689528 | 2.3e-07 | abs ≤ 5e-07 | ✓ |
| t test n for 90% power, d = 1 | 22.02108843 | 22.0211 | 1.2e-05 | abs ≤ 5e-05 | ✓ |
| Cohen n per group d = 0.5 | 63.76561019 | 64 | 0.23 | abs ≤ 1 | ✓ |
| Cohen n per group d = 0.8 | 25.52457184 | 26 | 0.48 | abs ≤ 1 | ✓ |
| Cohen n per group d = 0.2 | 393.405695 | 393 | 0.41 | abs ≤ 1 | ✓ |
| ANOVA n (4 groups, f = 0.5, 80%) | 11.92611117 | 11.92613 | 1.9e-05 | abs ≤ 0.0001 | ✓ |
| proportions n (0.5 vs 0.75, 90%) | 76.70691612 | 76.7 | 0.0069 | abs ≤ 0.05 | ✓ |
power_vs_statsmodels (cross-check, pass)
Reference: statsmodels.stats.power (TTestIndPower, TTestPower, FTestAnovaPower, NormalIndPower); Fleiss closed form.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| two-sample n | 63.76561019 | 63.76561059 | 6.2e-09 | rel ≤ 1e-06 | ✓ |
| two-sample power, ratio 2 | 0.4347675115 | 0.4347675115 | 0 | rel ≤ 1e-10 | ✓ |
| paired power | 0.5804271089 | 0.5804271089 | 0 | rel ≤ 1e-10 | ✓ |
| one-sided power | 0.5066865225 | 0.5066865225 | 0 | rel ≤ 1e-10 | ✓ |
| ANOVA power | 0.2535955192 | 0.2535955192 | 0 | rel ≤ 1e-10 | ✓ |
| arcsine n | 76.65294036 | 76.65294037 | 2e-10 | rel ≤ 1e-06 | ✓ |
| normal-approximation n vs Fleiss closed form | 76.70691612 | 76.70692845 | 1.6e-07 | rel ≤ 0.0001 | ✓ |
Simulation
coverage_t_and_effect_size (simulation, pass)
Reference: 95% CIs over 2,000 seeded data sets.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Welch CI of the difference (n = 8, 15; SD 1, 3) | 0.953 | 0.95 | 0.003 | abs ≤ 0.0156 | ✓ |
| Cohen's d noncentral-t CI (d = 0.8, n = 12 + 12) | 0.96 | 0.95 | 0.01 | abs ≤ 0.0156 | ✓ |
| paired CI (n = 10) | 0.958 | 0.95 | 0.008 | abs ≤ 0.0156 | ✓ |
coverage_rank_based (simulation, pass)
Reference: Hodges–Lehmann CIs over 2,000 seeded data sets (exact intervals: coverage = achieved level).
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Mann–Whitney shift CI (exponential, n = 10, 12) | 0.961 | 0.9574295673 | 0.0036 | abs ≤ 0.0145 | ✓ |
| signed-rank pseudo-median CI (t4, n = 15) | 0.942 | 0.9520874023 | 0.01 | abs ≤ 0.0153 | ✓ |
coverage_correlation_survival_roc (simulation, pass)
Reference: 95% CIs over 1,000 seeded data sets.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Pearson r Fisher-z CI (ρ = 0.5, n = 25) | 0.942 | 0.95 | 0.008 | abs ≤ 0.0217 | ✓ |
| Kaplan–Meier log-log CI at the true median (n = 60, ~30% censored) | 0.951 | 0.95 | 0.001 | abs ≤ 0.0217 | ✓ |
| AUC DeLong CI (binormal, AUC = 0.760, n = 40 + 40) | 0.945 | 0.95 | 0.005 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Welch ANOVA (unequal SDs and n) | 0.0485 | 0.05 | 0.0015 | abs ≤ 0.0156 | ✓ |
| Games–Howell family-wise (unequal SDs and n) | 0.0475 | 0.05 | 0.0025 | abs ≤ 0.0256 | ✓ |
| Tukey family-wise (4 groups) | 0.044 | 0.05 | 0.006 | abs ≤ 0.0156 | ✓ |
| Dunnett family-wise (3 vs control) | 0.04 | 0.05 | 0.01 | abs ≤ 0.0156 | ✓ |
| Holm–Šidák family-wise (6 comparisons; at most 0.05) | 0.032 | 0.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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| fraction of data sets with ≥ 1 false outlier (at most 0.03) | 0.015 | 0.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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| KM median (S = 0.5 on [2, 3)) | 2.5 | 2.5 | 0 | exact | ✓ |
| sensitivity 45/50 | 0.9 | 0.9 | 0 | abs ≤ 1e-15 | ✓ |
| specificity 90/100 | 0.9 | 0.9 | 0 | abs ≤ 1e-15 | ✓ |
| PPV 45/55 | 0.8181818182 | 0.8181818182 | 0 | abs ≤ 1e-15 | ✓ |
| LR+ = 0.9 / 0.1 | 9 | 9 | 1.8e-15 | abs ≤ 1e-12 | ✓ |
| PPV at prevalence 1% (Bayes) | 0.08333333333 | 0.08333333333 | 2.8e-17 | abs ≤ 1e-12 | ✓ |
| Mendel's peas χ² vs scipy | 0.4700239808 | 0.4700239808 | 0 | rel ≤ 1e-12 | ✓ |
| Mendel's peas P vs scipy | 0.9254258951 | 0.9254258951 | 0 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t = 0.3, df = 1 | 0.8144528418 | 0.8144528418 | 1.4e-16 | rel ≤ 1e-12 | ✓ |
| t = −0.3, df = 2 | 0.7924856608 | 0.7924856608 | 0 | rel ≤ 1e-12 | ✓ |
| t = 1, df = 1 | 0.5 | 0.5 | 2.2e-16 | rel ≤ 1e-12 | ✓ |
| t = −1, df = 2 | 0.4226497308 | 0.4226497308 | 1.3e-16 | rel ≤ 1e-12 | ✓ |
| t = 2.5, df = 1 | 0.2422378832 | 0.2422378832 | 0 | rel ≤ 1e-12 | ✓ |
| t = −2.5, df = 2 | 0.1296117202 | 0.1296117202 | 2.1e-16 | rel ≤ 1e-12 | ✓ |
| t = 12, df = 1 | 0.05292935212 | 0.05292935212 | 9.2e-16 | rel ≤ 1e-12 | ✓ |
| t = −12, df = 2 | 0.006872933677 | 0.006872933677 | 8.8e-16 | rel ≤ 1e-12 | ✓ |
| χ² = 0.5, df = 2 | 0.7788007831 | 0.7788007831 | 0 | rel ≤ 1e-12 | ✓ |
| χ² = 0.5, df = 1 | 0.4795001222 | 0.4795001222 | 2.3e-16 | rel ≤ 1e-12 | ✓ |
| χ² = 3.84146, df = 2 | 0.1465000645 | 0.1465000645 | 0 | rel ≤ 1e-12 | ✓ |
| χ² = 3.84146, df = 1 | 0.05 | 0.05 | 2.6e-15 | rel ≤ 1e-12 | ✓ |
| χ² = 10, df = 2 | 0.006737946999 | 0.006737946999 | 1.3e-16 | rel ≤ 1e-12 | ✓ |
| χ² = 10, df = 1 | 0.001565402258 | 0.001565402258 | 1.4e-16 | rel ≤ 1e-12 | ✓ |
| χ² = 40, df = 2 | 2.061153622e-09 | 2.061153622e-09 | 6e-16 | rel ≤ 1e-12 | ✓ |
| χ² = 40, df = 1 | 2.539628589e-10 | 2.539628589e-10 | 1.2e-15 | rel ≤ 1e-12 | ✓ |
| F = 0.7, df = (2, 5) | 0.5394796609 | 0.5394796609 | 2.1e-16 | rel ≤ 1e-12 | ✓ |
| F = 3.5, df = (2, 12) | 0.06346961597 | 0.06346961597 | 6.6e-16 | rel ≤ 1e-12 | ✓ |
| F = 9, df = (2, 30.5) | 0.0008472489443 | 0.0008472489443 | 5.1e-16 | rel ≤ 1e-12 | ✓ |
| z = 0.1, two-sided | 0.9203443254 | 0.9203443254 | 0 | rel ≤ 1e-12 | ✓ |
| z = 0.1, one-sided | 0.4601721627 | 0.4601721627 | 0 | rel ≤ 1e-12 | ✓ |
| z = 1.95996, two-sided | 0.05 | 0.05 | 8.3e-16 | rel ≤ 1e-12 | ✓ |
| z = 1.95996, one-sided | 0.025 | 0.025 | 8.3e-16 | rel ≤ 1e-12 | ✓ |
| z = 3.3, two-sided | 0.0009668482848 | 0.0009668482848 | 1.1e-16 | rel ≤ 1e-12 | ✓ |
| z = 3.3, one-sided | 0.0004834241424 | 0.0004834241424 | 1.1e-16 | rel ≤ 1e-12 | ✓ |
| z = 6, two-sided | 1.97317529e-09 | 1.97317529e-09 | 7.1e-15 | rel ≤ 1e-12 | ✓ |
| z = 6, one-sided | 9.86587645e-10 | 9.86587645e-10 | 7.1e-15 | rel ≤ 1e-12 | ✓ |
| r = 0.2, df = 2 | 0.8 | 0.8 | 1.4e-16 | rel ≤ 1e-12 | ✓ |
| r = -0.75, df = 2 | 0.25 | 0.25 | 1.1e-16 | rel ≤ 1e-12 | ✓ |
| r = 0.99, df = 2 | 0.01 | 0.01 | 1.2e-14 | rel ≤ 1e-12 | ✓ |
| r = 1 gives P = 0 | 0 | 0 | 0 | exact | ✓ |
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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t = 2.228139, df = 10 | 0.04999998745 | 0.05 | 1.3e-08 | abs ≤ 2e-07 | ✓ |
| t = 12.706205, df = 1 | 0.04999999897 | 0.05 | 1e-09 | abs ≤ 2e-08 | ✓ |
| z = 1.959964 | 0.04999999819 | 0.05 | 1.8e-09 | abs ≤ 2e-07 | ✓ |
| z = 1.644854, one-sided | 0.04999996153 | 0.05 | 3.8e-08 | abs ≤ 2e-07 | ✓ |
| χ² = 3.841459, df = 1 | 0.04999999465 | 0.05 | 5.3e-09 | abs ≤ 2e-07 | ✓ |
| χ² = 18.307038, df = 10 | 0.05000000082 | 0.05 | 8.2e-10 | abs ≤ 2e-08 | ✓ |
| F = 3.098391, df = (3, 20) | 0.05000000996 | 0.05 | 1e-08 | abs ≤ 2e-07 | ✓ |
| paired sleep: t = −4.0621, df = 9 | 0.00283300784 | 0.002833 | 7.8e-09 | abs ≤ 5e-06 | ✓ |
| Welch sleep: t = −1.8608, df = 17.776 | 0.07939657814 | 0.07939 | 6.6e-06 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| t = 2.1, df = 5 | 0.08975324988 | 0.08975324988 | 1.1e-15 | rel ≤ 1e-09 | ✓ |
| t = 0.8, df = 17.776 | 0.434272332 | 0.434272332 | 2.3e-15 | rel ≤ 1e-09 | ✓ |
| t = 4.5, df = 3.4 | 0.01561514417 | 0.01561514417 | 1e-15 | rel ≤ 1e-09 | ✓ |
| t = 1.3, df = 120 | 0.1960924778 | 0.1960924778 | 1.4e-16 | rel ≤ 1e-09 | ✓ |
| χ² = 7.2, df = 3 | 0.06578905269 | 0.06578905269 | 1.1e-15 | rel ≤ 1e-09 | ✓ |
| χ² = 1.1, df = 0.5 | 0.1402746003 | 0.1402746003 | 2e-16 | rel ≤ 1e-09 | ✓ |
| χ² = 25, df = 11.5 | 0.01169077124 | 0.01169077124 | 1e-15 | rel ≤ 1e-09 | ✓ |
| F = 2.7, df = (3, 26) | 0.06632843904 | 0.06632843904 | 8e-15 | rel ≤ 1e-09 | ✓ |
| F = 0.4, df = (4, 9.5) | 0.8043065466 | 0.8043065466 | 8.3e-16 | rel ≤ 1e-09 | ✓ |
| F = 11, df = (1, 40) | 0.001946198547 | 0.001946198547 | 2.5e-15 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Student t = raw | -1.860813467 | -1.860813467 | 1.2e-16 | rel ≤ 1e-12 | ✓ |
| Student df = raw | 18 | 18 | 0 | rel ≤ 1e-12 | ✓ |
| Student P = raw | 0.07918671422 | 0.07918671422 | 0 | rel ≤ 1e-10 | ✓ |
| Student CI lower = raw | -3.363874032 | -3.363874032 | 0 | rel ≤ 1e-12 | ✓ |
| Student CI upper = raw | 0.2038740323 | 0.2038740323 | 1.1e-15 | rel ≤ 1e-12 | ✓ |
| Student Cohen's d = raw | -0.8321810813 | -0.8321810813 | 1.3e-16 | rel ≤ 1e-12 | ✓ |
| Student Hedges' g CI lower = raw | -1.665171791 | -1.665171791 | 2.7e-16 | rel ≤ 1e-09 | ✓ |
| Student variance F test P = raw | 0.7427199317 | 0.7427199317 | 1.5e-15 | rel ≤ 1e-10 | ✓ |
| Student t vs ttest_ind_from_stats | -1.860813467 | -1.860813467 | 0 | rel ≤ 1e-12 | ✓ |
| Student P vs ttest_ind_from_stats | 0.07918671422 | 0.07918671422 | 0 | rel ≤ 1e-10 | ✓ |
| Welch t = raw | -1.860813467 | -1.860813467 | 2.4e-16 | rel ≤ 1e-12 | ✓ |
| Welch df = raw | 17.77647352 | 17.77647352 | 2e-16 | rel ≤ 1e-12 | ✓ |
| Welch P = raw | 0.07939414019 | 0.07939414019 | 1e-15 | rel ≤ 1e-10 | ✓ |
| Welch CI lower = raw | -3.365483231 | -3.365483231 | 0 | rel ≤ 1e-12 | ✓ |
| Welch CI upper = raw | 0.2054832307 | 0.2054832307 | 2.2e-15 | rel ≤ 1e-12 | ✓ |
| Welch Cohen's d = raw | -0.8321810813 | -0.8321810813 | 1.3e-16 | rel ≤ 1e-12 | ✓ |
| Welch Hedges' g CI lower = raw | -1.665171791 | -1.665171791 | 2.7e-16 | rel ≤ 1e-09 | ✓ |
| Welch variance F test P = raw | 0.7427199317 | 0.7427199317 | 1.5e-15 | rel ≤ 1e-10 | ✓ |
| Welch t vs ttest_ind_from_stats | -1.860813467 | -1.860813467 | 0 | rel ≤ 1e-12 | ✓ |
| Welch P vs ttest_ind_from_stats | 0.07939414019 | 0.07939414019 | 0 | rel ≤ 1e-10 | ✓ |
| one-sided Welch P (seeded) = raw | 0.9319647358 | 0.9319647358 | 0 | rel ≤ 1e-10 | ✓ |
| one-sided 90% CI lower (seeded) = raw | -2.272491593 | -2.272491593 | 0 | rel ≤ 1e-12 | ✓ |
| paired t = raw | -4.062127683 | -4.062127683 | 0 | rel ≤ 1e-12 | ✓ |
| paired P = raw | 0.002832890197 | 0.002832890197 | 0 | rel ≤ 1e-10 | ✓ |
| paired CI lower = raw | -2.459885763 | -2.459885763 | 0 | rel ≤ 1e-12 | ✓ |
| paired Cohen's d_z = raw | -1.284557563 | -1.284557563 | 0 | rel ≤ 1e-12 | ✓ |
| paired, published R t | -4.062127683 | -4.0621 | 2.8e-05 | abs ≤ 5e-05 | ✓ |
| paired, published R P | 0.002832890197 | 0.002833 | 1.1e-07 | abs ≤ 5e-07 | ✓ |
| one-sample from summary = t_test_one_sample | 0.06505988567 | 0.06505988567 | 1.7e-15 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| F (R anova) | 4.846087862 | 4.8461 | 1.2e-05 | abs ≤ 5e-05 | ✓ |
| P (R anova) | 0.01590995833 | 0.01591 | 4.2e-08 | abs ≤ 5e-06 | ✓ |
| F = raw | 4.846087862 | 4.846087862 | 5.5e-16 | rel ≤ 1e-10 | ✓ |
| SS within = raw | 10.49209 | 10.49209 | 0 | rel ≤ 1e-12 | ✓ |
| Welch F = raw | 5.180972408 | 5.180972408 | 0 | rel ≤ 1e-10 | ✓ |
| Welch df2 = raw | 17.12841862 | 17.12841862 | 4.1e-16 | rel ≤ 1e-10 | ✓ |
| Brown–Forsythe F* = raw | 4.846087862 | 4.846087862 | 1.8e-16 | rel ≤ 1e-10 | ✓ |
| ω² = raw | 0.204078846 | 0.204078846 | 5.4e-16 | rel ≤ 1e-10 | ✓ |
| Bartlett χ² vs scipy | 2.878573787 | 2.878573787 | 0 | rel ≤ 1e-10 | ✓ |
| Bartlett P vs scipy | 0.2370967736 | 0.2370967736 | 0 | rel ≤ 1e-10 | ✓ |
| Tukey ctrl−trt1 difference | 0.371 | 0.371 | 4.4e-16 | abs ≤ 5e-12 | ✓ |
| Tukey ctrl−trt1 lower (R) | -0.3202160514 | -0.3202161 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey ctrl−trt1 upper (R) | 1.062216051 | 1.0622161 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey ctrl−trt1 adjusted P (R) | 0.3908711442 | 0.3908711 | 4.4e-08 | abs ≤ 5e-07 | ✓ |
| Tukey ctrl−trt2 difference | -0.494 | -0.494 | 6.7e-16 | abs ≤ 5e-12 | ✓ |
| Tukey ctrl−trt2 lower (R) | -1.185216051 | -1.1852161 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey ctrl−trt2 upper (R) | 0.1972160514 | 0.1972161 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey ctrl−trt2 adjusted P (R) | 0.1979959913 | 0.197996 | 8.7e-09 | abs ≤ 5e-07 | ✓ |
| Tukey trt1−trt2 difference | -0.865 | -0.865 | 2.2e-16 | abs ≤ 5e-12 | ✓ |
| Tukey trt1−trt2 lower (R) | -1.556216051 | -1.5562161 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey trt1−trt2 upper (R) | -0.1737839486 | -0.1737839 | 4.9e-08 | abs ≤ 5e-07 | ✓ |
| Tukey trt1−trt2 adjusted P (R) | 0.01200642398 | 0.0120064 | 2.4e-08 | abs ≤ 5e-07 | ✓ |
| Dunnett trt1 adjusted P = raw | 0.3226956858 | 0.3226956858 | 6.9e-16 | rel ≤ 1e-09 | ✓ |
| Dunnett trt2 adjusted P = raw | 0.1534858615 | 0.1534858615 | 7.2e-16 | rel ≤ 1e-09 | ✓ |
| Games–Howell trt1−trt2 adjusted P = raw | 0.02370345474 | 0.02370345474 | 0 | rel ≤ 1e-09 | ✓ |
| F from SEM input = F from SD input | 4.846087862 | 4.846087862 | 0 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| seed 5: mean G1 | 9.543918567 | 9.543918597 | 3.2e-09 | rel ≤ 1e-05 | ✓ |
| seed 5: SE G1 (GLS) | 0.2814380842 | 0.2814381376 | 1.9e-07 | rel ≤ 0.0001 | ✓ |
| seed 5: mean G2 | 10.89269069 | 10.89269069 | 3.6e-11 | rel ≤ 1e-05 | ✓ |
| seed 5: SE G2 (GLS) | 0.3328739574 | 0.3328740162 | 1.8e-07 | rel ≤ 0.0001 | ✓ |
| seed 5: mean G3 | 8.539500282 | 8.539500272 | 1.1e-09 | rel ≤ 1e-05 | ✓ |
| seed 5: SE G3 (GLS) | 0.2606283254 | 0.2606283733 | 1.8e-07 | rel ≤ 0.0001 | ✓ |
| seed 5: subject variance | 0.1740463337 | 0.1740464724 | 8e-07 | rel ≤ 0.0001 | ✓ |
| seed 5: residual variance | 0.4148559982 | 0.414855939 | 1.4e-07 | rel ≤ 1e-05 | ✓ |
| seed 5: REML log-likelihood (statsmodels − ours ≤ 0) | -2.842170943e-13 | 0 | -2.8e-13 | ≤ reference + 1e-10 | ✓ |
| seed 6: mean G1 | 10.9531128 | 10.95311349 | 6.3e-08 | rel ≤ 1e-05 | ✓ |
| seed 6: SE G1 (GLS) | 0.2910563676 | 0.2910574661 | 3.8e-06 | rel ≤ 0.0001 | ✓ |
| seed 6: mean G2 | 11.3878297 | 11.38782926 | 3.8e-08 | rel ≤ 1e-05 | ✓ |
| seed 6: SE G2 (GLS) | 0.230005885 | 0.2300070199 | 4.9e-06 | rel ≤ 0.0001 | ✓ |
| seed 6: subject variance | 0.05828528324 | 0.05828782997 | 4.4e-05 | rel ≤ 0.0001 | ✓ |
| seed 6: residual variance | 0.4528270721 | 0.4528254728 | 3.5e-06 | rel ≤ 1e-05 | ✓ |
| seed 6: REML log-likelihood (statsmodels − ours ≤ 0) | -9.248157795e-11 | 0 | -9.2e-11 | ≤ reference + 1e-10 | ✓ |
| seed 6: difference | -0.4347169001 | -0.4347157772 | 2.6e-06 | rel ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| nested F = MS groups / MS subjects | 3.679356382 | 3.679356382 | 2.1e-15 | rel ≤ 1e-08 | ✓ |
| nested P | 0.06795481296 | 0.06795481296 | 4.9e-15 | rel ≤ 1e-08 | ✓ |
| df denominator = subjects − groups | 9 | 9 | 0 | exact | ✓ |
| subject variance = (MS_S − MS_E)/n | 0.488793821 | 0.488793821 | 4.5e-16 | rel ≤ 1e-08 | ✓ |
| residual variance = MS_E | 0.2258212222 | 0.2258212222 | 1.2e-16 | rel ≤ 1e-09 | ✓ |
| subjects-within-groups F vs anova_lm | 7.49355029 | 7.49355029 | 1.7e-15 | rel ≤ 1e-09 | ✓ |
| subjects-within-groups P vs anova_lm | 3.779624785e-05 | 3.779624785e-05 | 1.3e-14 | rel ≤ 1e-08 | ✓ |
| nested t = Student t on subject means | -2.136752362 | -2.136752362 | 4.2e-16 | rel ≤ 1e-08 | ✓ |
| nested P = Student P on subject means | 0.07649265092 | 0.07649265092 | 5.4e-16 | rel ≤ 1e-08 | ✓ |
| nested CI lower = Student CI on subject means | -2.875579776 | -2.875579776 | 0 | rel ≤ 1e-08 | ✓ |
| nested df | 6 | 6 | 0 | exact | ✓ |
| Tukey on the nested model = Tukey on subject means (P) | 0.07583989266 | 0.07583989266 | 7.3e-15 | rel ≤ 1e-07 | ✓ |
Parts of whole
fraction_of_total (cross-check, pass)
Reference: Exact fractions; Wilson and Clopper–Pearson intervals vs statsmodels proportion_confint.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| total | 100 | 100 | 0 | exact | ✓ |
| fraction of part 2 | 0.31 | 0.31 | 0 | abs ≤ 1e-15 | ✓ |
| percent of part 4 | 9 | 9 | 0 | abs ≤ 1e-13 | ✓ |
| fractions sum to 1 | 1 | 1 | 0 | abs ≤ 1e-15 | ✓ |
| Wilson lower, part 1 | 0.3279838267 | 0.3279838267 | 0 | abs ≤ 1e-12 | ✓ |
| Wilson upper, part 1 | 0.517935133 | 0.517935133 | 0 | abs ≤ 1e-12 | ✓ |
| Clopper–Pearson 90% lower, part 1 | 0.3364797451 | 0.3364797451 | 0 | abs ≤ 1e-12 | ✓ |
| Wilson lower, part 2 | 0.2277969721 | 0.2277969721 | 2.8e-17 | abs ≤ 1e-12 | ✓ |
| Wilson upper, part 2 | 0.4062605572 | 0.4062605572 | 0 | abs ≤ 1e-12 | ✓ |
| Clopper–Pearson 90% lower, part 2 | 0.2340091502 | 0.2340091502 | 5.6e-17 | abs ≤ 1e-12 | ✓ |
| Wilson lower, part 3 | 0.117002255 | 0.117002255 | 2.8e-17 | abs ≤ 1e-12 | ✓ |
| Wilson upper, part 3 | 0.2666735839 | 0.2666735839 | 0 | abs ≤ 1e-12 | ✓ |
| Clopper–Pearson 90% lower, part 3 | 0.119690778 | 0.119690778 | 0 | abs ≤ 1e-12 | ✓ |
| Wilson lower, part 4 | 0.04807254 | 0.04807254 | 1.4e-17 | abs ≤ 1e-12 | ✓ |
| Wilson upper, part 4 | 0.1622621285 | 0.1622621285 | 2.8e-17 | abs ≤ 1e-12 | ✓ |
| Clopper–Pearson 90% lower, part 4 | 0.04775663591 | 0.04775663591 | 0 | abs ≤ 1e-12 | ✓ |
| decimal parts: 0.3 of 1.0 (exact total) | 0.3 | 0.3 | 0 | abs ≤ 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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| livak: rows | 12 | 12 | 0 | exact | ✓ |
| livak: method | 1 | 1 | 0 | exact | ✓ |
| livak: max | delta_ct − reference | 0 | 0 | 0 | |
| livak: max | delta_delta_ct − reference | 0 | 0 | 0 | |
| livak: max | rq − reference | 0 | 0 | 0 | |
| pfaffl: rows | 12 | 12 | 0 | exact | ✓ |
| pfaffl: method | 1 | 1 | 0 | exact | ✓ |
| pfaffl: max | delta_ct − reference | 0 | 0 | 0 | |
| pfaffl: max | delta_delta_ct − reference | 0 | 0 | 0 | |
| pfaffl: max | rq − reference | 0 | 0 | 0 |
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.
| quantity | ours | reference | error | tolerance | |
|---|---|---|---|---|---|
| Welch IL6: P | 0.0001968475015 | 0.0001968475015 | 0 | rel ≤ 1e-10 | ✓ |
| Welch IL6: fold-change CI lower | 4.186851156 | 4.186851156 | 0 | rel ≤ 1e-12 | ✓ |
| Welch IL6: fold-change CI upper | 7.56100922 | 7.56100922 | 0 | rel ≤ 1e-12 | ✓ |
| IL6: fold change = 2^−mean ΔΔCt | 5.626439389 | 5.626439389 | 0 | rel ≤ 1e-12 | ✓ |
| IL6: mean ΔCt CI lower | 5.82584548 | 5.82584548 | 0 | rel ≤ 1e-12 | ✓ |
| Welch TNF: P | 0.0001130444664 | 0.0001130444664 | 0 | rel ≤ 1e-10 | ✓ |
| Welch TNF: fold-change CI lower | 1.322422851 | 1.322422851 | 0 | rel ≤ 1e-12 | ✓ |
| Welch TNF: fold-change CI upper | 1.500310269 | 1.500310269 | 0 | rel ≤ 1e-12 | ✓ |
| TNF: fold change = 2^−mean ΔΔCt | 1.408561175 | 1.408561175 | 7.9e-16 | rel ≤ 1e-12 | ✓ |
| TNF: mean ΔCt CI lower | 10.10217928 | 10.10217928 | 0 | rel ≤ 1e-12 | ✓ |
| Student IL6: P | 6.295988444e-05 | 6.295988444e-05 | 0 | rel ≤ 1e-10 | ✓ |
| Student IL6: fold-change CI lower | 4.275978823 | 4.275978823 | 0 | rel ≤ 1e-12 | ✓ |
| Student IL6: fold-change CI upper | 7.403409021 | 7.403409021 | 0 | rel ≤ 1e-12 | ✓ |
| Student TNF: P | 0.0001128815955 | 0.0001128815955 | 0 | rel ≤ 1e-10 | ✓ |
| Student TNF: fold-change CI lower | 1.322430063 | 1.322430063 | 0 | rel ≤ 1e-12 | ✓ |
| Student TNF: fold-change CI upper | 1.500302086 | 1.500302086 | 0 | rel ≤ 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).
| output | minimum agreement (significant digits) |
|---|---|
| Cmax, Tmax, Tlast, Clast, λz point count and its first and last times | exact |
| AUC0-t, AUCall | 14.9 |
| λz, t½, R², adjusted R², span ratio, predicted Clast | 14.8 |
| AUC0-∞ (observed and predicted Clast), % extrapolated | 14.6 |
| CL/F, Vz/F (observed and predicted) | 14.7 |
| group mean, SD, geometric mean and CV, median, min, max | 14.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.
| case | checks | adjusted means, SE, df, F, R² | slopes check, group slopes | Johnson–Neyman bounds | Tukey / Bonferroni / Holm | Dunnett | change / final alternatives |
|---|---|---|---|---|---|---|---|
| MASS::anorexia (Postwt ~ Treat + Prewt) | 80 | 6.2e-15 | 9.5e-14 | 3.2e-15 | 5.9e-08 | 2.0e-05 | 9.4e-15 |
| MASS::anorexia, HC3 | 80 | 1.6e-13 | 9.5e-14 | 3.2e-15 | 3.4e-08 | 1.8e-05 | 9.4e-15 |
| MASS::cats (Hwt ~ Sex + Bwt) | 38 | 1.4e-13 | 8.1e-15 | 1.4e-13 | 3.5e-13 | 3.7e-12 | 9.8e-16 |
| ChickWeight (day 21 ~ Diet + day 0) | 127 | 1.1e-13 | 6.6e-13 | — | 1.1e-10 | 2.4e-05 | 1.5e-15 |
| carData::Baumann (2 covariates) | 84 | 1.3e-14 | 3.9e-14 | — | 2.1e-09 | 5.0e-06 | 1.0e-15 |
| MASS::birthwt (race + smoke + lwt) | 64 | 9.5e-15 | 7.5e-14 | — | 2.1e-10 | 2.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):
| case | engine fit | adjusted 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, Satterthwaite | 5.4e-13 | 5.3e-13 | 1.6e-7; 2.5e-5; 4.3e-11 |
| mmrm::fev_data, no baseline × visit | mmrm, Satterthwaite | 4.3e-13 | 2.7e-13 | 8.5e-14; 1.5e-7; 3.0e-11 |
| ChickWeight days 2–8, adjusted for day 0 | mmrm, Satterthwaite | 4.4e-16 | 3.2e-16 | 1.7e-5; 2.6e-7; 2.8e-11 |
| 30 of fev's subjects (seeded), Kenward–Roger | mmrm, Kenward–Roger | 3.7e-13 | 6.6e-13 | 3.3e-13; 2.4e-13; 3.7e-14 |
| mlmRev::Exam schools 1–30, clustered | lmer, Satterthwaite | 8.2e-7 | 2.7e-7 | 5.4e-7; 1.9e-4; 3.8e-6 |
| nlme::BodyWeight, 16 rats over 10 days | lmer (compound symmetry), Satterthwaite | 7.1e-7 | 1.6e-6 | 1.1e-4; 5.4e-7; 6.2e-8 |
| nlme::BodyWeight, Kenward–Roger | lmer, Kenward–Roger (pbkrtest) | 1.1e-7 | 1.1e-6 | 1.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 truth | result | nominal |
|---|---|---|
| 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 set | 0.95 |
| Group F test rejects under the null (3 groups, n = 8) | 0.053 | 0.05 |
| Dunnett family-wise error under the null (2 comparisons with the control) | 0.057 | 0.05 |
| Slopes check alarms under parallel slopes | 0.065 | 0.05 |
| Tukey simultaneous coverage (4 groups, n = 10, unequal planted effects) | 0.957 | 0.95 |
| Coverage with unequal variances (SD 1.5 vs 3.75, n 8 vs 16): model-based / HC3 | 0.987 / 0.962 | 0.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:
| quantity | values | largest relative difference |
|---|---|---|
| per-animal growth rates; rate difference, Welch CI, df, P; rate-based T/C and CI | 231 | 1.9e-13 |
| growth-rate inhibition with Fieller CI | 30 | 7.0e-15 |
| T/C % (mean, Fieller CI), TGI % (ΔT/ΔC, Fieller CI), geometric T/C (Welch CI, P) | 960 | 1.7e-14 |
| T/C % (median), TGI % (1 − T/C) | 194 | 4.3e-15 |
| adjusted and carry-forward AUC ratios, CIs, P | 80 | 5.6e-15 |
| mixed model slope differences, SE, df, P, CI, rate-based T/C; group slopes | 106 | 3.1e-05 |
| exponential fit; Gompertz parameters, SE, RSS | 126 | 5.0e-06 |
| time to endpoint: log-rank χ², P, HR (O/E) and CI, medians | 58 | 3.7e-14 |
| mRECIST best response, best average response and category (study animals and 849 PDXE curves) | 2,051 | 4.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).
| quantity | agreement |
|---|---|
| parallel-model residual SS; ln EC50 differences (log potency) on S.alba, spinach, G.aparine, S.alba 3PL | 1e-9; 1e-8 |
| log potency SE, CI ends, P (Gauss–Newton) vs nlsLM | 1e-8 to 1e-6 |
potency, delta and Fieller CIs (observed-Hessian covariance) vs drc EDcomp | 1e-6 (drc's numerical Hessian: SE to 4e-4) |
parallelism F per pair vs drc anova | 1.5e-5 (the engine's unconstrained fit reaches a lower minimum than drc's) |
| slope ratio and asymptote differences with 90% CIs vs nlsLM | 1e-6 |
parallel-line potency and Fieller CI, F test vs lm | 1e-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:
| quantity | values | largest relative difference |
|---|---|---|
| F, df, P of every effect: linear model, Type III; sums of squares | 152 | 9.3e-15 |
| F, Kenward–Roger df, P: mixed model; F, df, P: Error() strata | 132 | 0 (the same R libraries) |
| ART-C estimate, SE, df, t (linear, mixed and Error() models) | 2,472 | 1.6e-13 |
| ART-C P: Tukey (studentized range; below 1e-6 compared absolutely, R ptukey's precision), Holm, Bonferroni, Šidák, Scheffé, FDR, none | 618 | 3.8e-6 (tail: 3.1e-12 absolute) |
| ART-C CIs: Tukey (R qtukey, accurate to 4 decimals of q); Bonferroni, Šidák, Scheffé, none | 860 | 2.8e-6; 2.1e-14 |
| aligned responses; aligned ranks (every row and effect) | 3,236 | 2.3e-13; exact |
| alignment check: column sums and F of the effects not aligned for (~0), unbalanced F | 277 | 3.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:
| quantity | values | largest relative difference |
|---|---|---|
| coefficients; SE (robust with a cluster); z; P | 104 | 1.1e-8 (P 1.0e-7) |
| likelihood-ratio, Wald (robust with a cluster), score and robust score χ² | 30 | 9.8e-9 |
| concordance within strata; concordant, discordant and tied pairs | 40 | exact |
| cox.zph χ² and P per coefficient, within strata (km, the served scale; and rank) | 104 | 5.2e-9 |
| subjects, events, strata and per-stratum counts (missing values and missing strata dropped as R does) | 112 | exact |
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:
| quantity | values | largest relative difference |
|---|---|---|
| ICC estimates (6 forms × 4 datasets), two-way ANOVA mean squares | 64 | 8.1e-15 |
| ICC F, df, P against 0 and 0.3 (irr, psych) | 216 | 2.9e-14 |
| ICC CIs: 6 forms vs psych, 5 vs irr | 88 | 1.6e-12 |
| REML variance components; ICC, F, P and CIs with missing ratings vs psych (lmer) | 132 | 1.9e-9 |
| Fleiss' kappa, agreement, Gwet SE and CI; Conger's kappa, SE and CI (irrCAC, 3 weights, missing ratings) | 165 | 3.2e-14 |
| Fleiss' kappa, z, exact; per-category kappa and z (irr, complete subjects) | 48 | 2.1e-14 |
| Cohen's kappa and z (irr); kappa and variance over the full scale (psych) | 56 | 2.0e-14 |
| P values vs irr (relative; absolute below 1e-6, where irr's 2·(1 − pnorm) loses digits) | 35 | 9.2e-12 |
| Bland–Altman bias, limits, bias CI (BlandAltmanLeh) | 15 | 1.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.