Understand the idea
Before you collect any data, four numbers are locked together: how big an effect you expect (in standardized units), how many observations you will collect, how strict your significance threshold is, and how likely you are to actually detect the effect if it's real (power). Fix any three of those and the fourth is determined by the mathematics of the test: this tool solves for whichever one you leave blank.
The most common question is 'how many people/samples do I need?' You supply the effect size you care about, your desired power (usually 80%), and your alpha (usually .05), and it tells you the sample size. But you can just as easily ask the reverse: 'I can only afford 40 subjects per group: what power does that actually give me?'
Power answers a conditional question, not an absolute one: '80% power' means IF an effect of the size you assumed really exists, you have an 80% chance of your study detecting it. It says nothing about whether the effect is actually real: that is what the study itself, once run, is for.
A power and sample size tool works as a sample size calculator: an a priori power analysis, done before collecting data, finds how many observations you need. The same calculation run the other way gives the minimum detectable effect: the smallest effect your planned sample has a good chance of finding.
Practitioner explanation
KernelStats supports four designs: one-sample/two-sample/paired t-test (Cohen's d), one-way ANOVA (Cohen's f), two independent proportions (Cohen's h, the arcsine-transformed gap), and chi-square goodness-of-fit (Cohen's w). It solves for any one of {effect_size, sample_size, power, alpha} given the other three (the solve-for option names which). Solving for sample size rounds the exact analytic requirement UP to the next whole number, so the achieved power at that rounded n is always slightly ABOVE the requested target, never below: a deliberate, conservative rounding convention. For two-sample and two-proportion designs the reported n is PER GROUP (with the total also shown); for one-sample, paired, ANOVA, and chi-square it is the total (number of pairs, for paired).
This is a pure design calculator: no data table is read, and every quantity is a planning VALUE the user types, not a column. The power/sample-size mathematics inherits the parametric assumptions of whichever underlying test is selected: approximate normality and (for the pooled forms) equal variances for the t-tests and ANOVA, and a large-enough n for the normal/chi-square approximation underlying the proportion and goodness-of-fit tests. If those assumptions fail once real data is collected, the ACTUAL power of the eventual analysis can differ from the nominal value this calculator reports: it answers 'what power would this design have if its assumptions hold', not a guarantee about the specific dataset you will end up with.
The effect size is always a planning ASSUMPTION supplied by the user (from a pilot study, prior literature, or the smallest effect size worth detecting): KernelStats does not estimate it from data here, and the honest failure mode is reverse-engineering an effect size from an affordable n rather than from a genuine judgment about what effect matters.
When to use it
Consider it when
Before collecting data, to determine how many observations are needed to detect an effect of a stated size with adequate power, or to check what power a fixed, budgeted sample size will actually deliver, or what the smallest detectable effect would be at a given n.
Use caution when
AFTER collecting data, to compute 'observed' or 'post-hoc' power from the effect you actually found: that number is a deterministic function of your p-value and adds no new information. Also do not use it to reverse-engineer an effect size from the sample size you can afford; the effect size must come from prior knowledge, a pilot study, or a considered judgment about the smallest effect worth detecting.
Formulas and symbols
Statistical power
beta the Type II error rate (the chance of missing a real effect of the assumed size).
Cohen's d (t-test family)
The standardized mean difference the calculator solves against for one-sample, two-sample, and paired t-test designs.
Required sample size (solved quantity)
g the closed-form or numerically inverted sample-size function for the selected test family; the analytic result is rounded UP to a whole number, so achieved power at the reported n is at or slightly above the target.
Assumptions and checks
- Sample-size and power results are a PLANNING calculation done before data collection; reinterpreting a non-significant result's own p-value as 'observed / post-hoc power' after the fact adds no new information: it is a deterministic, and misleading, function of the p-value already obtained.
In KernelStats: Stated directly on every card as a standing 'A priori design (not post-hoc power)' reminder; KernelStats does not report an observed-power number anywhere in the product.
- The whole calculation rests on the assumed effect size; understating it, or fitting the assumed effect to whatever sample size happens to be affordable, produces a study that is confidently underpowered with no warning from the arithmetic itself.
In KernelStats: Not checked by KernelStats: the effect size is a required input the analyst supplies; the card flags only the degenerate case of a below-small assumed effect.
- Normality (of residuals, not of the raw data). The t- and F-based power formulas assume approximately normal data (or a large enough n for the CLT); strong skew or outliers at small planned n make the true achieved power differ from the reported nominal value.
In KernelStats: Not checked by KernelStats: there is no data to check yet at the planning stage; the card states the assumption directly for t-test and ANOVA designs and suggests a nonparametric design as the fallback.
- Homogeneity of variance (homoscedasticity). Pooled two-sample-t and one-way-ANOVA power formulas assume equal group variances; with unequal variances the true required sample size differs from a Welch-based design's requirement.
In KernelStats: Not checked by KernelStats: stated directly for two-sample-t and ANOVA designs; switch to a Welch-based design assumption when variances are expected to differ.
- Independence of observations. Every design here assumes independent observations (with pairing modeled explicitly only in the paired-design option); clustered or repeated measurements need a design that accounts for the correlation, which changes the effective sample size required.
In KernelStats: Not checked by KernelStats: stated directly on every card regardless of test type.
- Adequate expected counts (chi-square). The two-proportions and chi-square-goodness-of-fit power formulas use large-sample normal / chi-square approximations that become unreliable when expected counts per cell are small (a common rule of thumb is at least 5).
In KernelStats: Not checked by KernelStats: stated directly only for two-proportions and chi-square-goodness-of-fit designs.
Alternatives
- Bootstrap Confidence Interval. You already have pilot or historical data and want an empirical estimate of variability to plug into the effect-size assumption, rather than a pure a-priori planning calculation.
Worked example
Scenario
Planning a two-sample t-test to detect a medium effect (Cohen's d = 0.5) at alpha = .05 with 80% power, solving for sample size.
Result
n = 64 per group (128 total), achieved power = 80.2% at the rounded n.
Interpretation
Recruiting 64 participants per group gives at least the requested 80% chance of detecting a true medium-sized difference between the two groups, assuming the eventual data satisfy the t-test's usual assumptions (approximate normality, similar variances). If a pilot study suggests the variances differ substantially, this nominal power should be treated as approximate.
Common misconceptions
Misconception
I ran a non-significant test, so computing 'observed power' from my actual effect size tells me whether I just missed a real effect.
Correction
Observed (post-hoc) power computed from the OBSERVED effect is a one-to-one mathematical function of the p-value itself: a large p-value always yields a low observed power, by construction. It adds no information beyond the p-value you already have. Power analysis is an a-priori planning tool, run BEFORE data collection with an assumed (not observed) effect size.
Read more: Misconception: post-hoc power tells you whether a non-significant study was well-designed
Misconception
80% power means there is an 80% chance the effect I'm studying is real.
Correction
Power is a CONDITIONAL probability: IF an effect of the assumed size truly exists, you have an 80% chance your study design will detect it. It says nothing about the probability that the effect exists in the first place: that is not a question power analysis can answer.
References
- Statistical Power Analysis for the Behavioral Sciences, Cohen, J. (1988).
- The abuse of power: the pervasive fallacy of power calculations for data analysis, Hoenig, J. M. and Heisey, D. M. (2001), The American Statistician, 55(1), 19-24.
