Validation method

Reference document to cite and reproduce the validation of n80. n80 1.0.1 · packages SHA256SUMS : fbf525c0886383f059d73dd8e0cc08fdae0c82b55093ad18cc5f1560ddc45909

1. What is verified

Each n80 procedure computes a quantity (power, sample size, detectable effect). Validation checks that this quantity equals that of a reference independent of n80's code. It does not check that the chosen procedure is the right one for your study: that is the statistician's job.

2. Levels of evidence

  1. Rewritten formula — the same quantity recomputed with SciPy's noncentral laws (t, F, chi-square), the binomial law and SciPy's Fisher test. Tolerance: 1e-6.
  2. Enumeration — for exact tests, power is recomputed by walking every possible table with SciPy's tests (binomtest, fisher_exact).
  3. Published values — PowerTOST (bioequivalence), classic sizes (64 per group for d = 0.5, 385 for a ±5 % survey, 59 for 95/95, 93 for Wilks, 247 events for a hazard ratio of 0.7).
  4. Monte-Carlo simulation of the test itself when no exact formula exists; tolerance of four simulation standard errors.
  5. Cross-check with a driven G*Power — see below.

3. G*Power protocol

G*Power 3.1.9.6 for macOS, downloaded from the Düsseldorf university site (psychologie.hhu.de), archive SHA-256: 841390e00110ccdd5201f334af985b54837b9f9b4ffb3151d49e28efb9bb3964. The programme (Intel, run under Rosetta) is driven by the script tests/gpower_gui.py: it picks the test family and the test, the “Post hoc: achieved power” analysis, fills the fields by their labels, clicks “Calculate” and reads the displayed power. n80 computes the same quantity from the same inputs; the gap is recorded. A gap is never adjusted away: it is published and explained, or flagged as unexplained.

A first attempt compared n80 with the G*Power manual's values as reported by a third party (the Spower CRAN vignette): an apparent 1.7-point gap on two independent correlations (0.709 vs 0.726). Actually running G*Power 3.1.9.6 returned 0.7087795, identical to n80: the gap came from the third-party source, not from G*Power. This is why the comparison relies on the software itself.

4. Cross-check results

23 cases out of 25 identical to G*Power (tolerance 2e-5 on power).

Casen80G*PowerGap
t à deux groupes (d = 0,5 ; 64 par groupe)0.80145960.8014596-4.21e-08✓
t à deux groupes déséquilibré (d = 0,4 ; 40 et 70)0.51606020.5160602-2.62e-08✓
t à deux groupes unilatéral (d = 0,3 ; 80 par groupe)0.59653180.5965318-3.99e-08✓
t à un échantillon (d = 0,4 ; n = 25)0.48401830.4840183-1.93e-08✓
t apparié (dz = 0,5 ; 30 paires)0.75396470.7539647+1.57e-08✓
ANOVA à un facteur (f = 0,3 ; N = 48 ; 4 groupes)0.3548840.354884+3.83e-08✓
Régression multiple, R² ≠ 0 (f² = 0,25/0,75 ; N = 40 ; 3 prédicteurs)0.83867540.8386754+4.92e-08✓
Mesures répétées, intra-sujet (f = 0,25 ; N = 20 ; m = 4 ; ρ = 0,5)0.72884260.7288426-7.87e-09✓
Khi-deux d'ajustement (w = 0,3 ; N = 120 ; df = 2)0.8457320.845732-2.79e-09✓
Binomial exact (p0 = 0,5 ; p1 = 0,7 ; n = 60)0.83818210.8381821+3.94e-08✓
Fisher exact (p1 = 0,2 ; p2 = 0,55 ; 25 par groupe)0.65938060.6593806+4.89e-08✓
McNemar exact, mode G*Power (n = 80 ; discordantes 0,2 / 0,08)0.50036940.5003694+1.61e-08✓
McNemar exact unilatéral, mode G*Power (n = 80)0.67531290.6753129+4.36e-08✓
McNemar exact, mode par défaut de n80 (moyenne sur les paires discordantes)
écart de méthode, expliqué : G*Power fixe le nombre de paires discordantes à ⌈ψ·n⌉ = 23 ; n80 moyenne sur sa loi binomiale (mode « comme G*Power » disponible, method=3)
0.45211580.5003694-4.83e-02≠ explained
Corrélation, modèle binormal exact (ρ = 0,3 ; N = 84)0.8003390.800339-4.66e-08✓
Corrélation exacte, H0 : ρ = 0,60 ; ρ1 = 0,65 ; N = 19290.95012390.9501239+1.39e-08✓
Corrélation exacte unilatérale (ρ = 0,3 ; N = 60)0.76277490.7627749+4.91e-08✓
Deux corrélations indépendantes (0,5 contre 0,2 ; 100 + 100)0.67496280.6749628-2.65e-08✓
Variance, un échantillon (rapport 2 ; n = 40)0.87721430.8772143+3.26e-08✓
Deux variances (rapport 2,5 ; 40 par groupe)0.8065520.806552-4.26e-08✓
Régression multiple, augmentation de R² (R² 0,30 contre 0,25 ; N = 90 ; α = 0,01)0.24129650.2412965-8.30e-09✓
Pente de régression (β = 0,5 ; σx = 2 ; σy = 3,5 ; N = 60)
écart de méthode, expliqué : G*Power utilise √N pour la non-centralité, n80 √(n−1) (somme des carrés centrée d'un x aléatoire) ; avec √N, n80 retrouve 0,6221401
0.6148980.6221401-7.24e-03≠ explained
Wilcoxon-Mann-Whitney, parent normal (d = 0,5 ; 64 par groupe)0.78284960.7828496-2.87e-08✓
Wilcoxon-Mann-Whitney, parent Laplace (d = 0,5 ; 64 par groupe)0.93143650.9314365+2.17e-08✓
Deux proportions, test z (0,3 contre 0,5 ; 94 par groupe)
comparé à la « puissance par formule normale » affichée par n80 ; n80 calcule par défaut la puissance exacte du test z par énumération
0.80424690.8042469+2.39e-08✓

5. Limits

6. Citing

@software{n80_1_0_1,
  title   = {n80: sample size and statistical power},
  version = {1.0.1},
  year    = {2026},
  doi     = {10.5281/zenodo.23895274},
  url     = {https://n80.toolguild.online/en/method},
  note    = {Validation method: https://n80.toolguild.online/en/method}
}

Validation archive (scripts and results), deposited on Zenodo: DOI of this version 10.5281/zenodo.23895274; DOI of all versions (always resolves to the latest) 10.5281/zenodo.23895273. Cite the second for n80 in general; the first to reproduce these exact results.

7. Reproduce

python3 tests/verify_dist.py ./build/dist_cli     # probability laws vs SciPy
python3 tests/verify_procs.py ./n80               # procedures
python3 tests/verify_gpower.py ./n80              # examples from the G*Power manual
python3 tests/gpower_gui.py ./n80                 # driven G*Power (macOS, accessibility)