Specialized Tools

Beyond the general means/proportions/correlation calculators, the module includes specialised sample-size tools for designs with their own distinct methodology: animal experiments, prevalence surveys, survival analysis, ROC curves, and repeated-measures ANOVA.


Mead's Method for Animal Experiments

For animal and preclinical studies where ethical and cost constraints make minimising animal numbers a priority. Uses Mead's resource equation rather than conventional effect-size power calculation.

The resource equation:

E = N - B - T

df_error (E) = total - 1 - df_treatment - df_blocking
df_treatment = number of groups - 1

The optimal range: searches per-group size (n from 2 upward) for smallest design with error df between 10 and 20:

Error df (E) Verdict
10-20 Optimal
> 20 (or >= 10 when 10-20 can't be hit) Sufficient
< 10 Potentially insufficient

Fallback: smallest design with E >= 10, or per group = ceil((10 + 1 + df_treatment + df_blocking) / number of groups).

When a reliable effect size is unavailable (common in early preclinical work), the resource equation provides a defensible sample size based on achieving adequate error degrees of freedom.


Survey Sample Size (Prevalence Studies)

For prevalence and survey studies -- estimating proportion of a population with some characteristic to within a target precision.

Inputs: expected prevalence (p), margin of error, confidence level, optionally population size.

Formula (infinite population):

d = margin of error / 100
z = normal quantile at (1 - (1 - confidence/100)/2)
n = ceil( z^2 * p * (1-p) / d^2 )

Finite population correction (when population size N supplied):

n_adjusted = ceil( (n * N) / (n + N - 1) )

Reduces required sample when population is small relative to sample. Labels precision based on margin of error (< 5% = high, < 10% = moderate).


Sample Size for Survival Analysis (Hazard Ratio)

For time-to-event/survival studies comparing two groups via hazard ratio, using the event-driven Schoenfeld approach.

Inputs: target hazard ratio, probability of event occurring, power, alpha.

Formula:

events needed = (z_alpha + z_beta)^2 * 4 / (ln(HR))^2
total sample size = ceil( events needed / event probability )
per group = ceil( total sample size / 2 )

Power depends on number of events, not number of participants. A study with few events (low event probability) needs many participants.

Interpretation:

Hazard ratio Label
< 0.5 Strong treatment effect (large hazard reduction)
0.5 - 0.75 Moderate treatment effect
0.75 - 1.0 Small treatment effect
> 1.5 Strong increased risk
1.0 - 1.5 Increased risk

Sample Size for ROC Curve (AUC)

For diagnostic-accuracy studies estimating or testing area under the ROC curve, using Hanley and McNeil variance method.

Inputs: null AUC, alternative (target) AUC, ratio of controls to cases, power, alpha.

Method (Hanley-McNeil AUC variance):

Q1 = AUC / (2 - AUC)
Q2 = 2*AUC^2 / (1 + AUC)

variance = [AUC(1-AUC) + (ratio-1)(Q1-AUC^2) + (ratio-1)(Q2-AUC^2)] / ratio

Variances under null and alternative AUC feed sample-size formula, yielding cases needed with controls = ceil(cases * ratio).

Correctly accounts for non-normal sampling distribution of AUC and correlation structure from using same cases/controls across the curve.


Repeated Measures ANOVA

For within-subject designs where same subjects are measured under multiple conditions or time points.

Method: computes repeated-measures ANOVA from supplied measurements:

df_between = k - 1    (k = number of measurements/conditions)
eta2 = SS_between / SS_total

Includes sphericity assessment -- when violated, degrees of freedom are corrected before computing p-value. Reports F-value, corrected p-value, and eta-squared as effect size.


Summary of specialized methods

Tool Core method
Mead's Method Resource equation (error df in 10-20)
Prevalence Survey Proportion precision + finite population correction
Survival (HR) Schoenfeld event-driven formula
ROC (AUC) Hanley-McNeil AUC variance
Repeated Measures ANOVA Within-subject ANOVA with sphericity correction

Choosing the methodology matching your design is essential -- a general means or proportions calculator would not correctly size an animal experiment, survival study, or diagnostic-accuracy study.