Statistical Validation

A transparent, reproducible comparison of selected browser-engine calculations with SciPy. This is automated parity evidence, not independent human review or certification.

Current validation scope

The public manifest contains 17 reference cases: 7 generated with SciPy 1.18.0, plus 10 browser-engine cases independently reproduced with a named package or an embedded transparent formula. Release tests recompute every stored result and compare the browser engine with the same values.

  • 2 Pearson chi-square cases, including expected frequencies, p-values, degrees of freedom, and Cramér's V.
  • 4 two-sided Fisher exact cases covering a small classic table, equal central modes, a zero cell, and skewed margins.
  • 1 directional Somers' d case using SciPy's row-independent, column-dependent convention and its transpose.
  • 10 additional cases covering Yates' correction, the likelihood-ratio G-test, Woolf odds-ratio intervals, signed phi, Pearson's contingency coefficient, pooled lambda, gamma, tau-b and tau-c, pooled Theil's U, and adjusted standardized residuals.

Open the machine-readable reference manifest. Its numeric tolerance is the larger of 1e-14 absolute or 1e-10 relative error.

Reference cases

Pearson chi-square, 2×2 balanced margins

[[20,30],[30,20]]

χ² = 4; df = 1; p = 0.0455002638964; Cramér's V = 0.2. Pearson calculation uses correction=false.

Pearson chi-square, 3×3 table

[[50,10,5],[20,30,10],[5,15,25]]

χ² = 67.869010619; df = 4; p = 6.392728e-14; Cramér's V = 0.446782650866. Pearson calculation uses correction=false.

Fisher's exact test, classic 2×2 table

[[3,1],[1,3]]

Sample odds ratio = 9; two-sided p = 0.485714285714.

Fisher's exact test, equal-probability central modes

[[20000,19999],[19999,20000]]

Sample odds ratio = 1.0001000075; two-sided p = 1.

Fisher's exact test, zero cell

[[0,5],[10,15]]

Sample odds ratio = 0; two-sided p = 0.140036209002.

Fisher's exact test, skewed margins

[[1,99],[8,92]]

Sample odds ratio = 0.116161616162; two-sided p = 0.0348991519721.

Somers' d, SciPy hotel-cleanliness example

[[27,25,14,7,0],[7,14,18,35,12],[1,3,2,7,17]]

d(column|row) = 0.603276611151; d(row|column) = 0.4704595186; symmetric d = 0.528653579219.

Yates continuity-corrected chi-square, 2x2 table

[[12,5],[29,2]]

chiSquare = 2.98601643647; degreesOfFreedom = 1; pValue = 0.083986541715.

Reference: SciPy 1.18.0. Method: scipy.stats.chi2_contingency(table, correction=True)

Likelihood-ratio G-test, 3x3 table

[[50,10,5],[20,30,10],[5,15,25]]

gStatistic = 67.6208218592; degreesOfFreedom = 4; pValue = 7.211644e-14.

Reference: SciPy 1.18.0. Method: scipy.stats.chi2_contingency(table, correction=False, lambda_='log-likelihood')

Sample odds ratio with Woolf 95% confidence interval

[[40,10],[10,40]]

oddsRatio = 16; ciLower = 6.00497758162; ciUpper = 42.6312998709.

Reference: Python standard-library math 3.13.13. Method: OR=(a*d)/(b*c); CI=exp(log(OR) +/- 1.96*sqrt(1/a+1/b+1/c+1/d))

Signed phi coefficient, negative association

[[5,50],[50,5]]

phi = -0.818181818182.

Reference: Python standard-library math 3.13.13. Method: phi=(a*d-b*c)/sqrt((a+b)*(c+d)*(a+c)*(b+d))

Pearson contingency coefficient, 3x3 table

[[50,10,5],[20,30,10],[5,15,25]]

contingencyCoefficient = 0.534154419466.

Reference: SciPy 1.18.0 plus Python standard-library math 1.18.0. Method: chi2=scipy.stats.chi2_contingency(table, correction=False).statistic; C=sqrt(chi2/(chi2+N))

Goodman-Kruskal pooled lambda, 3x3 table

[[30,2,3],[4,20,6],[8,5,22]]

symmetric = 0.544715447154; rowDependent = 0.569230769231; colDependent = 0.51724137931.

Reference: NumPy 2.5.1. Method: pooled=(sum(column maxima)+sum(row maxima)-max(row totals)-max(column totals))/(2*N-max(row totals)-max(column totals)); directional lambdas use their corresponding proportional error reduction

Goodman-Kruskal gamma, ordinal 3x3 table

[[30,10,5],[10,20,10],[5,10,30]]

gamma = 0.69696969697.

Reference: Python standard-library arithmetic 3.13.13. Method: gamma=(concordant-discordant)/(concordant+discordant), with pair counts recomputed by direct four-loop enumeration

Kendall tau-b and Stuart tau-c, ordinal 2x4 table

[[20,10,5,2],[5,10,20,30]]

kendallTauB = 0.542832333959; kendallTauC = 0.63629373318.

Reference: Python standard-library arithmetic 3.13.13. Method: tau_b=(C-D)/sqrt((C+D+T_row)*(C+D+T_col)); tau_c=2*m*(C-D)/(N^2*(m-1)); pair and tie counts use direct enumeration

Pooled and directional Theil uncertainty coefficients

[[30,5],[10,5],[5,45]]

symmetric = 0.339807206285; rowGivenCol = 0.286987204028; colGivenRow = 0.416455931073.

Reference: NumPy plus Python standard-library math 2.5.1. Method: I=H(row)+H(column)-H(joint); U(row|column)=I/H(row); U(column|row)=I/H(column); pooled U=2*I/(H(row)+H(column))

Adjusted standardized residuals, 3x3 table

[[50,10,5],[20,30,10],[5,15,25]]

residuals = [[6.777799374399998,-3.720866942175243,-3.830094678535809],[-2.091475318010698,3.632408916720151,-1.557933303179625],[-5.200344867856302,0.163943497448759,5.906464660549895]].

Reference: NumPy 2.5.1. Method: r_ij=(O_ij-E_ij)/sqrt(E_ij*(1-R_i/N)*(1-C_j/N)), where E_ij=R_i*C_j/N

What this does not prove

  • The selected cases do not cover every statistic, input shape, numerical edge case, export, or interface.
  • The cases assume nonnegative frequency-count tables with positive row and column margins.
  • Ordinal measures depend on the supplied row and column category order.
  • The checks do not provide complex-survey variance estimation or establish that a statistic is appropriate for a particular study.
  • Agreement with a reference implementation is not a substitute for a named statistical owner, independent reviewer, or domain-specific review.

Named statistical review is still pending. Read the broader methods and assumptions, and report a discrepancy to support@crosstabs.com.

Independent review packet

The public Phase-1 review request binds the complete statistical scope, Python tool catalog, release artifacts, and current deployment identity in machine-readable JSON. It is preparation material for a qualified reviewer and deliberately does not claim that a review has occurred.

Open the revision-bound independent review request. A genuine approval record must be published by the named reviewer on an independent evidence origin after they inspect the bound revision.

Reference documentation

Formula-backed cases publish the exact equation and generating runtime in each manifest entry; their Python recomputation deliberately uses a separate implementation from the browser engine.

Reference manifest generated .