Procedures catalogue

40 procedures. A “free” badge marks those in the free edition.

Means

One-sample t-test free

n80 calc ttest-1

power from the noncentral t distribution, δ = (μ − μ0)/σ · √n, n−1 degrees of freedom

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample sizen30
Expected dropoutdropout0
Difference to detect (μ − μ0)diff5
Standard deviation σsd10

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Lawrence Erlbaum. Owen DB. (1965) A special case of a bivariate non-central t-distribution. Biometrika 52:437-446.

Paired t-test free

n80 calc ttest-paired

power from the noncentral t distribution; σ_d = √(σ1² + σ2² − 2ρσ1σ2), δ = Δ/σ_d · √n

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of pairsn30
Expected dropoutdropout0
Mean difference to detectdiff5
SD condition 1 (σ1)sd110
SD condition 2 (σ2)sd210
Correlation between measurements ρcorr0.5

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Owen DB. (1965) Biometrika 52:437-446.

Two-sample t-test (independent groups) free

n80 calc ttest-2

power from the noncentral t distribution, δ = Δ / (σ √(1/n1 + 1/n2)), n1 + n2 − 2 degrees of freedom

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n30
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Difference in means to detectdiff5
Common standard deviation σsd10

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed. Owen DB. (1965) Biometrika 52:437-446.

Welch t-test (unequal variances)

n80 calc ttest-welch

noncentral t with Satterthwaite degrees of freedom evaluated at the assumed sample sizes and variances (approximation)

Approximation: the exact distribution of the Welch statistic is not a noncentral t; the gap to simulation is typically about 0.5 power points.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n30
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Difference in means to detectdiff5
SD of group 1sd110
SD of group 2sd215

Welch BL. (1947) Biometrika 34:28-35. Satterthwaite FE. (1946) Biometrics Bulletin 2:110-114. Moser BK, Stevens GR, Watts CL. (1989) Commun Stat Theory Methods 18:3763-3767.

Two-sample z-test (known σ)

n80 calc ztest-2

power Φ(|Δ|/SE − z_{1−α/2}) with SE = √(σ1²/n1 + σ2²/n2)

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n30
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Difference in means to detectdiff5
SD of group 1sd110
SD of group 2sd210

Chow S-C, Shao J, Wang H, Lokhnygina Y. (2018) Sample Size Calculations in Clinical Research, 3rd ed. CRC Press, ch. 3.

Wilcoxon–Mann–Whitney test

n80 calc mann-whitney

asymptotic relative efficiency (ARE): power of the t-test at sample sizes n·ARE (ARE = 3/π for a normal parent, π²/9 logistic, 3/2 Laplace, 1 uniform); or Noether's approximation: z = |p − ½| √(12 c (1−c) N), p = P(X < Y)

For a normal parent, the ARE method matches a simulation of the test (0.7828 vs 0.7836 simulated for d = 0.5, 64 per group) and G*Power; Noether's approximation is more pessimistic (0.7726). Without ties.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n30
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Methodmethod1 = Asymptotic relative efficiency (Cohen's d) / 2 = Noether (P(X < Y))
Parent distributionparent1 = Normal / 2 = Logistic / 3 = Laplace / 4 = Uniform
Cohen's d (difference / SD)d0.5
P(X < Y) under the alternativeprob0.7

Lehmann EL. (1975) Nonparametrics: Statistical Methods Based on Ranks. Faul F et al. (2009) Behav Res Methods 41:1149-1160 (G*Power 3.1, ARE method). Noether GE. (1987) Sample size determination for some common nonparametric tests. J Am Stat Assoc 82:645-647. Rosner B, Glynn RJ. (2009) Biometrics 65:188-197.

ANOVA and regression

One-way ANOVA (fixed effects) free

n80 calc anova-1

power from the noncentral F distribution: λ = f² · N, df = (k − 1, N − k); f = σ_means / σ

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Sample size per groupn20
Expected dropoutdropout0
Define the effect bymode0 = Cohen's f / 1 = The group means
Number of groupsk3
Cohen's ff0.25
Group meansmeans10, 12, 14
Within-group SD σsd4

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed., ch. 8. Faul F, Erdfelder E, Lang A-G, Buchner A. (2007) G*Power 3. Behav Res Methods 39:175-191.

General linear model F-test (regression, factorial ANOVA, ANCOVA) free

n80 calc glm-f

f² = (R²_full − R²_reduced)/(1 − R²_full); λ = f² · N; df = (u, N − p − 1); noncentral F

Factorial ANOVA: u = df of the tested effect, p = total df of all model effects. ANCOVA: add covariates to p.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Total sample size Nn60
Expected dropoutdropout0
R² of the full modelr2full0.25
R² of the reduced model (without tested predictors)r2red0
Predictors tested (numerator df)u3
Total predictors in the modelp3

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed., ch. 9. Faul F et al. (2009) Statistical power analyses using G*Power 3.1. Behav Res Methods 41:1149-1160.

Simple linear regression slope

n80 calc reg-slope

noncentral t: δ = β σ_x √(n−1) / σ_e, n − 2 degrees of freedom

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of observationsn40
Expected dropoutdropout0
Slope to detect βslope0.5
SD of xsdx2
Residual SD σ_esde3

Dupont WD, Plummer WD. (1998) Power and sample size calculations for studies involving linear regression. Control Clin Trials 19:589-601.

Repeated-measures ANOVA (within factor)

n80 calc rm-anova

noncentral F: λ = f² N m ε/(1 − ρ); df = ((m−1)ε, (N−1)(m−1)ε), ε = sphericity correction

Compound symmetry: all measurements share the same correlation ρ. f = SD of the measurement means / σ.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Number of subjectsn20
Expected dropoutdropout0
Within-subject effect ff0.25
Number of repeated measurementsm4
Correlation among measurements ρrho0.5
Sphericity correction ε (1 = sphericity)eps1

Faul F et al. (2007) G*Power 3. Behav Res Methods 39:175-191. Muller KE, Barton CN. (1989) Approximate power for repeated-measures ANOVA lacking sphericity. J Am Stat Assoc 84:549-555.

Equivalence and non-inferiority

Equivalence of means (TOST)

n80 calc tost-means

exact TOST power by integration over the chi-square distribution of the estimated SD (Schuirmann; Phillips)

ParameterCléDefault
Level of each one-sided test (alpha)alpha0.05
Target powerpower0.9
Sample size of group 1 (or pairs)n40
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Designdesign1 = Parallel groups / 2 = Paired / one sample
True mean differencediff0
Equivalence margin ± θmargin5
SD σ (of differences if paired)sd10

Schuirmann DJ. (1987) A comparison of the two one-sided tests procedure and the power approach for assessing the equivalence of average bioavailability. J Pharmacokinet Biopharm 15:657-680. Phillips KF. (1990) Power of the two one-sided tests procedure in bioequivalence. J Pharmacokinet Biopharm 18:137-144.

Bioequivalence: 2×2 crossover (ABE, geometric mean ratio)

n80 calc be-2x2

exact TOST on the log scale: σ_w² = ln(CV² + 1), SE = σ_w √(½(1/n1 + 1/n2)), N − 2 degrees of freedom

ParameterCléDefault
Level of each one-sided test (alpha)alpha0.05
Target powerpower0.8
Total number of subjects Nn40
Expected dropoutdropout0
Within-subject coefficient of variation (CV)cv0.3
True Test/Reference ratiotheta00.95
Lower equivalence limitlo0.8
Upper equivalence limithi1.25

Diletti E, Hauschke D, Steinijans VW. (1991) Sample size determination for bioequivalence assessment by means of confidence intervals. Int J Clin Pharmacol Ther Toxicol 29:1-8. Schuirmann DJ. (1987) J Pharmacokinet Biopharm 15:657-680. FDA Guidance: Statistical Approaches to Establishing Bioequivalence (2001).

Non-inferiority or superiority by margin (two means)

n80 calc noninf-means

one-sided noncentral t: δ = (Δ + M)/SE for non-inferiority, (Δ − M)/SE for superiority by margin

ParameterCléDefault
One-sided level (alpha)alpha0.025
Target powerpower0.8
Sample size of group 1 (treatment)n100
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Hypothesistype1 = Non-inferiority (H0: Δ ≤ −M) / 2 = Superiority by margin (H0: Δ ≤ M)
True difference Δ (treatment − control)diff0
Margin M (positive)margin3
Common SD σsd10

Chow S-C, Shao J, Wang H, Lokhnygina Y. (2018) Sample Size Calculations in Clinical Research, 3rd ed., ch. 3. FDA Guidance: Non-Inferiority Clinical Trials (2016). ICH E9 (1998).

Two proportions: non-inferiority, superiority by margin, equivalence

n80 calc noninf-props

normal approximation with null variance from restricted maximum likelihood (Farrington & Manning); equivalence: two one-sided tests

A higher proportion is assumed to be better (response, cure). For adverse events, swap the groups.
ParameterCléDefault
One-sided level (alpha)alpha0.025
Target powerpower0.8
Sample size of group 1 (treatment)n200
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Hypothesistype1 = Non-inferiority (H0: p1 − p2 ≤ −δ) / 2 = Superiority by margin (H0: p1 − p2 ≤ δ) / 3 = Equivalence (|p1 − p2| < δ)
True treatment proportion p1p10.8
True control proportion p2p20.8
Margin δ (positive)margin0.1

Farrington CP, Manning G. (1990) Test statistics and sample size formulae for comparative binomial trials with null hypothesis of non-zero risk difference or non-unity relative risk. Stat Med 9:1447-1454. Miettinen O, Nurminen M. (1985) Comparative analysis of two rates. Stat Med 4:213-226. Chow S-C et al. (2018) ch. 4.

Proportions and tables

One proportion vs a reference value (z-test) free

n80 calc prop-1

normal approximation: power Φ((|p1 − p0|√n − z·√(p0 q0)) / √(p1 q1)); optional continuity correction

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample sizen100
Expected dropoutdropout0
Reference proportion p0 (null)p00.5
True proportion p1p10.65
Continuity correctioncc0 = No / 1 = Yes

Fleiss JL, Levin B, Paik MC. (2003) Statistical Methods for Rates and Proportions, 3rd ed. Wiley. Chow S-C, Shao J, Wang H, Lokhnygina Y. (2018) Sample Size Calculations in Clinical Research, 3rd ed., ch. 4.

One proportion: exact binomial test

n80 calc prop-1-exact

exact power: sum of binomial probabilities under p1 over the exact rejection region (probability-based p-value)

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample sizen60
Expected dropoutdropout0
Reference proportion p0p00.5
True proportion p1p10.7

Clopper CJ, Pearson ES. (1934) Biometrika 26:404-413. Fleiss JL, Levin B, Paik MC. (2003) Statistical Methods for Rates and Proportions. Chow S-C et al. (2018) ch. 4.

Two proportions: comparison (z, corrected z, Fisher exact) free

n80 calc prop-2

exact power by enumeration of tables (pooled z, unpooled z, continuity-corrected z, Fisher exact); normal formula for very large samples

The exact calculation enumerates all possible tables: it reflects the true power of the chosen test (sawtooth included), not an approximation.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n100
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Testmethod1 = z, pooled variance / 2 = z, unpooled variance / 3 = pooled z, continuity correction / 4 = Fisher exact
Define the effect byparam1 = p2 (proportion in group 2) / 2 = Odds ratio / 3 = Relative risk
Proportion in group 1 (control) p1p10.3
Proportion in group 2 p2p20.5
Odds ratio (group 2 / group 1)or2.33
Relative risk (group 2 / group 1)rr1.67

Fleiss JL, Levin B, Paik MC. (2003) Statistical Methods for Rates and Proportions, 3rd ed. Wiley. Chow S-C et al. (2018) Sample Size Calculations in Clinical Research, ch. 4. Fisher RA. (1935) J R Stat Soc 98:39-82. Gail M, Gart JJ. (1973) Biometrics 29:441-448.

Paired binary data: McNemar test

n80 calc mcnemar

exact: number of discordant pairs ~ Bin(n, ψ), then conditional binomial test; or Connor's normal approximation

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of pairsn150
Expected dropoutdropout0
Methodmethod1 = Exact conditional (averaged over the number of discordant pairs) / 2 = Normal approximation (Connor) / 3 = Exact, number of discordant pairs fixed at ⌈ψ·n⌉ (as G*Power)
Discordant pairs (+/−) p10p100.2
Discordant pairs (−/+) p01p010.1

McNemar Q. (1947) Psychometrika 12:153-157. Connor RJ. (1987) Sample size for testing differences in proportions for the paired-sample design. Biometrics 43:207-211. Fagerland MW, Lydersen S, Laake P. (2013) The McNemar test for binary matched-pairs data: mid-p and asymptotic are better than exact conditional. BMC Med Res Methodol 13:91.

Chi-square test (Cohen's w) free

n80 calc chi2-w

noncentral chi-square: λ = w² N, given degrees of freedom (r × c table: (r−1)(c−1))

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Total sample size Nn120
Expected dropoutdropout0
Cohen's ww0.3
Degrees of freedomdf2

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed., ch. 7. Faul F et al. (2007) G*Power 3. Behav Res Methods 39:175-191.

Chi-square goodness of fit (category probabilities)

n80 calc chi2-gof

w = √Σ (p1_i − p0_i)²/p0_i; noncentral chi-square λ = w² N, k − 1 − (estimated parameters) df

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Total sample size Nn150
Expected dropoutdropout0
Probabilities under H0 (sum = 1)p00.25, 0.25, 0.25, 0.25
Probabilities under H1 (sum = 1)p10.35, 0.25, 0.20, 0.20
Estimated parameters removed from dfest0

Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed., ch. 7.

Logistic regression: one continuous covariate

n80 calc logistic

Hsieh et al.: n = (z_{1−α/2} + z_{1−β})² / (P1 (1 − P1) β*²) / (1 − R²), β* = ln OR per SD

Approximate formula: good for moderate odds ratios (< 3 per SD) and a normal covariate.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of observationsn300
Expected dropoutdropout0
Event probability at the mean of X (P1)p10.3
Odds ratio for a one-SD increaseor1.5
R² of X with the other covariatesr20

Hsieh FY, Bloch DA, Larsen MD. (1998) A simple method of sample size calculation for linear and logistic regression. Stat Med 17:1623-1634. Demidenko E. (2007) Sample size determination for logistic regression revisited. Stat Med 26:3385-3397.

Special designs

2×2 crossover: treatment difference

n80 calc crossover-2x2

noncentral t: SE = σ_w √(½(1/n1 + 1/n2)), N − 2 degrees of freedom, σ_w = within-subject SD

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Total number of subjects Nn24
Expected dropoutdropout0
Treatment difference to detectdiff5
Within-subject SD σ_wsdw8

Chow S-C, Liu J-P. (2009) Design and Analysis of Bioavailability and Bioequivalence Studies, 3rd ed. CRC Press. Jones B, Kenward MG. (2014) Design and Analysis of Cross-Over Trials, 3rd ed.

Cluster-randomised trial (two means)

n80 calc cluster-means

design effect D = 1 + (m − 1)·ICC; effective sample size per arm k·m/D; noncentral t, 2(k − 1) degrees of freedom

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Clusters per arm (k)n10
Expected dropoutdropout0
Subjects per cluster (m)m20
Intracluster correlation (ICC)icc0.05
Difference in means to detectdiff5
Total SD σsd10

Donner A, Klar N. (2000) Design and Analysis of Cluster Randomization Trials in Health Research. Arnold. Eldridge SM, Ashby D, Kerry S. (2006) Sample size for cluster randomized trials: effect of coefficient of variation of cluster size. Int J Epidemiol 35:1292-1300.

Cluster-randomised trial (two proportions)

n80 calc cluster-props

design effect D = 1 + (m − 1)·ICC; effective sample size per arm k·m/D; normal formula with pooled variance

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Clusters per arm (k)n15
Expected dropoutdropout0
Subjects per cluster (m)m30
Intracluster correlation (ICC)icc0.03
Control-arm proportion p1p10.3
Treated-arm proportion p2p20.2

Donner A, Klar N. (2000) Design and Analysis of Cluster Randomization Trials in Health Research. Arnold. Hayes RJ, Moulton LH. (2017) Cluster Randomised Trials, 2nd ed. CRC Press.

Correlation and variance

Pearson correlation: test of a coefficient free

n80 calc corr-1

exact distribution of the sample correlation (bivariate normal model; Hotelling) with exact critical values; Fisher z transformation as an option: δ = |atanh ρ1 − atanh ρ0| √(n − 3)

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of observationsn60
Expected dropoutdropout0
Methodmethod1 = Exact distribution (bivariate normal model) / 2 = Fisher z transformation (approximation)
Correlation under H0 (ρ0)rho00
True correlation (ρ1)rho10.3

Hotelling H. (1953) New light on the correlation coefficient and its transforms. J R Stat Soc B 15:193-232. Johnson NL, Kotz S. (1970) Continuous Univariate Distributions-2. Fisher RA. (1921) Metron 1:3-32. Cohen J. (1988) Statistical Power Analysis for the Behavioral Sciences, 2nd ed., ch. 3. Bonett DG, Wright TA. (2000) Psychometrika 65:23-28.

Comparison of two independent correlations

n80 calc corr-2

δ = |atanh ρ1 − atanh ρ2| / √(1/(n1 − 3) + 1/(n2 − 3))

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n100
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Correlation in group 1rho10.5
Correlation in group 2rho20.2

Cohen J. (1988) ch. 4. Fisher RA. (1921) Metron 1:3-32.

Variance vs a reference value (chi-square)

n80 calc var-1

(n − 1) s²/σ0² ~ (σ²/σ0²) χ²_{n−1}; rejection regions from the central law

Very sensitive to non-normality.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample sizen40
Expected dropoutdropout0
Variance ratio σ² / σ0²r2

Chow S-C et al. (2018) Sample Size Calculations in Clinical Research, 3rd ed., ch. 3. Bonett DG. (2006) Approximate confidence interval for standard deviation of nonnormal distributions. Comput Stat Data Anal 50:775-782.

Comparison of two variances (F-test)

n80 calc var-2

s1²/s2² ~ (σ1²/σ2²) F_{n1−1, n2−1}

Very sensitive to non-normality.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Sample size of group 1n40
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Variance ratio σ1² / σ2²r2.5

Chow S-C et al. (2018) ch. 3. Sheskin DJ. (2011) Handbook of Parametric and Nonparametric Statistical Procedures, 5th ed.

Rates and counts

Two event rates (Poisson or negative binomial)

n80 calc rates-2

Var(ln λ̂_i) = (1/(t λ_i) + φ)/n_i; z = |ln(λ2/λ1)| / √(Var1 + Var2) (φ = 0: Poisson; φ > 0: negative binomial)

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Subjects in group 1n100
Allocation ratio n2 / n1ratio1
Expected dropoutdropout0
Rate of group 1 (events per unit time)l11
Rate of group 2l20.7
Follow-up time per subjectt1
Dispersion φ (0 = Poisson)phi0

Zhu H, Lakkis H. (2014) Sample size calculation for comparing two negative binomial rates. Stat Med 33:376-387. Signorini DF. (1991) Sample size for Poisson regression. Biometrika 78:446-450.

Survival and events

Log-rank: required number of events (Schoenfeld)

n80 calc logrank-events

Schoenfeld: Var(ln HR̂) = 1/(d q1 q2); power Φ(|ln HR| √(d q1 q2) − z_{1−α/2})

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of events (deaths, relapses…)n200
Expected dropoutdropout0
Hazard ratio to detect (experimental / control)hr0.7
Allocation ratio experimental / controlratio1

Schoenfeld DA. (1981) The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika 68:316-319. 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. Stat Med 1:121-129.

Log-rank: sample size with accrual and follow-up (exponential survival)

n80 calc logrank-accrual

expected events d = n (q1 P1 + q2 P2), P_i = 1 − (e^{−λ_i(T−A)} − e^{−λ_i T})/(λ_i A); then Schoenfeld power

Assumptions: proportional hazards, exponential survival, no loss to follow-up (use dropout to inflate the sample).
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Total number of patientsn400
Expected dropoutdropout0
Hazard ratio to detect (experimental / control)hr0.7
Median survival of the control arm (months)m012
Accrual duration A (months)acc18
Total study duration T (months)tot36
Allocation ratio experimental / controlratio1

Schoenfeld DA. (1983) Biometrics 39:499-503. Lachin JM, Foulkes MA. (1986) Evaluation of sample size and power for analyses of survival with allowance for nonuniform patient entry, losses to follow-up, noncompliance, and stratification. Biometrics 42:507-519.

Cox regression: one covariate (required events)

n80 calc cox

Hsieh & Lavori: power Φ(|ln HR| √(d σ² (1 − R²)) − z_{1−α/2}), σ² = covariate variance

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of eventsn150
Expected dropoutdropout0
Covariatetype1 = Continuous (SD) / 2 = Binary (prevalence)
Hazard ratio (per unit, or exposed / unexposed)hr1.5
SD of the covariatesdx1
Prevalence of the binary covariateprev0.5
R² of the covariate with othersr20

Hsieh FY, Lavori PW. (2000) Sample-size calculations for the Cox proportional hazards regression model with nonbinary covariates. Control Clin Trials 21:552-560. Schmoor C, Sauerbrei W, Schumacher M. (2000) Sample size considerations for the evaluation of prognostic factors in survival analysis. Stat Med 19:441-452.

Diagnostics and agreement

ROC curve: test of an area under the curve (Hanley–McNeil)

n80 calc roc-auc

SE(A)² = [A(1−A) + (n_d−1)(Q1−A²) + (n_h−1)(Q2−A²)]/(n_d n_h), Q1 = A/(2−A), Q2 = 2A²/(1+A); normal power under H0 and H1

Approximation valid for score distributions close to negative exponential; check by simulation for AUC > 0.9.
ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of diseased subjectsn60
Ratio healthy / diseasedratio1
Expected dropoutdropout0
AUC under H0 (0.5 = chance)auc00.5
True AUCauc10.75

Hanley JA, McNeil BJ. (1982) The meaning and use of the area under a receiver operating characteristic (ROC) curve. Radiology 143:29-36. Obuchowski NA. (2005) ROC analysis. AJR 184:364-372.

Diagnostic test: precision of a sensitivity or specificity

n80 calc sens-spec

Buderer: half-width = z √(S(1−S)/n_diseased); n_total = n_diseased / prevalence (sensitivity) or n_healthy / (1 − prevalence) (specificity)

ParameterCléDefault
Level (1 − confidence level)alpha0.05
Target half-widthhw0.05
Total sample sizen400
Expected dropoutdropout0
Measurewhat1 = Sensitivity / 2 = Specificity
Expected sensitivity (or specificity)s0.9
Disease prevalenceprev0.2

Buderer NMF. (1996) Statistical methodology: I. Incorporating the prevalence of disease into the sample size calculation for sensitivity and specificity. Acad Emerg Med 3:895-900. Flahault A, Cadilhac M, Thomas G. (2005) Sample size calculation should be performed for design accuracy in diagnostic test studies. J Clin Epidemiol 58:859-862.

Intraclass correlation (one-way model)

n80 calc icc

F = MSB/MSW ~ (1 + kθ) F_{n−1, n(k−1)}, θ = ρ/(1 − ρ); exact power

ParameterCléDefault
Significance level (alpha)alpha0.05
Target powerpower0.8
Testsides2 = Two-sided / 1 = One-sided
Number of subjectsn40
Expected dropoutdropout0
Measurements (raters) per subjectk3
ICC under H0 (ρ0)rho00.6
True ICC (ρ1)rho10.8

Walter SD, Eliasziw M, Donner A. (1998) Sample size and optimal designs for reliability studies. Stat Med 17:101-110. Donner A, Eliasziw M. (1987) Sample size requirements for reliability studies. Stat Med 6:441-448. Shrout PE, Fleiss JL. (1979) Intraclass correlations: uses in assessing rater reliability. Psychol Bull 86:420-428.

Precision and surveys

Confidence interval for a mean: precision free

n80 calc ci-mean

half-width = t_{1−α/2, n−1} s/√n, with s the assurance quantile of the chi-square law (50 % assurance = expected width)

ParameterCléDefault
Level (1 − confidence level)alpha0.05
Target half-widthhw2
Sample sizen30
Expected dropoutdropout0
Standard deviation σsd10
Assurance (probability the width stays within target)assur0.5

Kupper LL, Hafner KB. (1989) How appropriate are popular sample size formulas? Am Stat 43:101-105. Beal SL. (1989) Sample size determination for confidence intervals on the population mean and on the difference between two population means. Biometrics 45:969-977.

Confidence interval for a proportion: precision

n80 calc ci-prop

Wald, Wilson (score) or Clopper–Pearson (exact) half-width at the expected proportion

ParameterCléDefault
Level (1 − confidence level)alpha0.05
Target half-widthhw0.05
Sample sizen400
Expected dropoutdropout0
Methodmethod1 = Wald / 2 = Wilson (score) / 3 = Clopper–Pearson (exact)
Expected proportionp0.5

Brown LD, Cai TT, DasGupta A. (2001) Interval estimation for a binomial proportion. Stat Sci 16:101-133. Wilson EB. (1927) J Am Stat Assoc 22:209-212. Clopper CJ, Pearson ES. (1934) Biometrika 26:404-413.

Survey: sample size for a margin of error free

n80 calc survey

margin = z √(D · v / n · (N − n)/(N − 1)), v = p(1 − p) for a proportion or σ² for a mean; D = design effect

ParameterCléDefault
Level (1 − confidence level)alpha0.05
Target margin of error (±)margin0.05
Sample sizen385
Expected non-responsedropout0
Estimatewhat1 = A proportion / 2 = A mean
Expected proportion (0.5 = most conservative)p0.5
Population SD σsd10
Population size (0 = unlimited)pop0
Design effectdeff1

Cochran WG. (1977) Sampling Techniques, 3rd ed. Wiley. Kish L. (1965) Survey Sampling. Wiley. Lohr SL. (2019) Sampling: Design and Analysis, 2nd ed. CRC Press.

Quality and reliability

Reliability demonstration (success-run, zero or c failures)

n80 calc success-run

achieved confidence = 1 − P(X ≤ c | n, 1 − R), X ~ Binomial; zero failures: n = ln(1 − C)/ln(R)

ParameterCléDefault
Target confidence Cconf0.95
Number of units to testn59
Reliability (or conformity) to demonstrate Rrel0.95
Failures allowed in the test (c)c0

Clopper CJ, Pearson ES. (1934) Biometrika 26:404-413. ISO 2859-1 and ISO 16269-6. FDA Guidance: Process Validation (2011). GHTF/SG3/N99-10 (2004) Quality Management Systems — Process Validation Guidance.

Nonparametric tolerance interval (Wilks)

n80 calc wilks

one-sided: C = 1 − P^n; two-sided (min, max): C = 1 − n P^{n−1} + (n − 1) P^n

ParameterCléDefault
Target confidenceconf0.95
Number of observationsn93
Target population coverage (P)cov0.95
Intervalsides2 = Two-sided (min, max) / 1 = One-sided (maximum)

Wilks SS. (1941) Determination of sample sizes for setting tolerance limits. Ann Math Stat 12:91-96. Wilks SS. (1942) Statistical prediction with special reference to the problem of tolerance limits. Ann Math Stat 13:400-409.