STATISTICS / INTERACTIVE LAB

Sample size and statistical power

Repeat virtual trials and see how the true difference, variability and sample size affect detection.

1−β

Simulation settings

01 / SIMULATION

Independent normal populations with equal SD; population mean A is 0. Using the same parameters and random seed reproduces results.

Simulated detection rate—
Significant / simulations—
Monte Carlo standard error—
02 / VIRTUAL TRIALS

Repeated trial results

Each bar is an independent virtual trial: height is the sample mean difference, and color indicates whether the two-sided Welch t test reaches α = 0.05.

P < 0.05P ≥ 0.05

Sample mean difference B − A per trial · Bars extend downward for negative sample mean differences.

i

How to interpret

The detection rate is the frequency of rejecting equal means under the specified simulation conditions; when the true difference is 0, it represents the simulated false-positive rate. It does not guarantee success in a single trial or establish clinical importance.

A finite simulation has Monte Carlo variation; standard error is approximately √[p̂(1−p̂)/number of simulations].

Synthetic educational data. Actual sample size planning also requires clinical effect, design, attrition, test method and prior evidence.

NIST: sample size and power ↗