Most textbook t and chi-square tables are one-tail tables: the column header is the probability in a single upper tail. A two-sided test at level α splits its rejection probability across two tails, α/2 in each, and so the boundary you need is the one-tail critical value at α/2—for α = 0.05, you read the 0.025 column, not the 0.05 column. The panel above does this translation for the current settings and shows both values so you can see which one the shaded boundary actually is.
Flipping the toggle to one-sided visibly slides the boundary inward (from the α/2 value to the α value) and power goes up when the truth lies in the favored direction. That gain is exactly why the direction must be chosen before the data are seen: choosing it afterward, to match where the data fell, quietly doubles the real α.
Under the null, the t statistic is the familiar Student t—that is what the table tabulates. Under the alternative, the numerator no longer has mean zero, and so the statistic follows a different law: the noncentral t, indexed by a noncentrality parameter δ = (μ₁ − μ₀)√n/σ that measures how many standard errors the truth sits from the null. Power is the area of that noncentral curve beyond the critical values.
It is not simply a shifted t: dividing by an estimated s skews the curve, which you can check here—the orange curve is visibly asymmetric at small n and settles toward a shifted normal as n grows. Tables never printed the noncentral t (one page per δ), which is why textbooks shipped OC charts instead—see tab ③.
The statistic (n−1)S²/σ₀² has a chi-square null distribution, which is itself skewed: its lower tail is short (squeezed against zero) and its upper tail is long. A two-sided test therefore uses two different critical values—the χ²(α/2) and χ²(1−α/2) columns of the table—where a t table would give one number to use with a ±.
This is also the χ² test with a genuine sidedness choice. The count-based χ² tests (goodness of fit, independence) only ever reject for large values: any disagreement between observed and expected counts inflates the statistic. Here the statistic tracks S² itself, and so a suspiciously small value is evidence too—of a variance below σ₀²—which is why the two-sided and lower-tail versions exist.
The same skewness makes power asymmetric in the variance ratio: at the same n, detecting σ₁² = 2σ₀² and detecting σ₁² = σ₀²/2 are not equally easy. Set the true variance to double the null, note the power, and then set it to half the null and compare, or look at the power curve on tab ②, which is visibly lopsided around the ratio 1.
The test statistic is a count, and so only whole-number critical values exist, and the test cannot spend exactly α—it uses the largest rejection region whose error probability stays ≤ α. How much of α is actually attainable jumps around as n changes: going from n to n+1 sometimes forces a more conservative cutoff, and power drops.
Tab ② plots power against n at single-n resolution so the sawtooth is visible. “The minimum n for 80% power” therefore has a subtle answer: the first n that reaches the target may be followed by an n that dips below it again, and so the solve-for-n panel reports both the first crossing and the first n after which the power never dips again.
The critical values here come from the binomial distribution itself, not from any printed z or t table—the normal-approximation test in some textbooks is a different (and at small n, noticeably worse-calibrated) procedure.
The chi-square goodness-of-fit statistic only approximately follows a chi-square law (and, under the alternative, a noncentral chi-square)—the approximation is the large-n limit of a statistic built from counts. At small n the simulated histogram is the exact truth and the smooth curve is the approximation, and you can watch the gap close as you push n up. This is the one test on this page where the “analytic answer” is itself an approximation, and so a formula-based sample-size recipe applied at n = 30 inherits the same error.
α and β live under different curves. α is set by you and spent under the null: it is the chance the test cries wolf when nothing is going on. You do not get to choose β: it is the area of the alternative curve that falls inside the acceptance region, and it depends on everything at once—the effect size, σ, n, α, and the sidedness. Power = 1 − β. Because α and β are areas under different curves, no arithmetic ties power to 1 − α; a test can have α = 0.05 and power 0.10, and the plot above will happily show you one. In the language of machine-learning classifiers, power is the test's sensitivity (its recall, or true-positive rate), β is its false-negative rate, and α its false-positive rate.
The simulation makes the definition concrete: each replication draws a full dataset from the alternative, runs the test exactly as you would on real data, and records reject or not. The rejection fraction estimates power. A second, independent run under the null estimates the attained α—for a well-calibrated test it should hover near the nominal level, and for the discrete binomial test it sits visibly below.
The orange line is the running rejection fraction after each batch of replications; the band is its 95% (Wilson) confidence interval, which narrows like 1/√m. Where a teal line is drawn, it is the exact answer from distribution theory, and the estimate settles onto it because the formula and the simulation are two routes to the same number. The formula is faster and exact, but it exists only for tests whose statistic has known distribution theory under the alternative. The simulation needs nothing but the ability to generate data, which is why it still works on tab ⑤, where no formula exists at all.
An OC chart plots β—the probability of failing to reject—against the standardized effect, one curve per sample size. Before software, this was how a power analysis was done: pick the curve for your n, run a finger up from your effect size, read β off the axis. Do that lookup here, and then notice it is the same point as on the power curve of tab ② flipped upside down: power = 1 − β. In classifier terms, an OC chart plots a false-negative rate, and reading power off it is reading sensitivity.
Power is a function of four things at once—effect size, n, α, and sidedness—and a sheet of paper can hold only two axes. A printed OC chart freezes α and the sidedness (that is why textbooks print separate charts for α = 0.05 and α = 0.01, one-sided and two-sided), spends its axes on effect and β, and handles n by printing a family of curves. This page draws the same slice live—change α or the sidedness in tab ① and the whole chart redraws, which is the manipulation no printed chart can offer.
Reading β at your effect and n here, and reading power on tab ②, are the same lookup: every OC chart is a power curve drawn upside down.
A power analysis is typically done to determine the number of samples that an experiment will need. However, the analysis requires information about the variance in each population being sampled, and those variances are often unknown before the experiment has been run. Consequently, a power analysis often depends on a pilot study, a small sample collected first to estimate exactly those variances.
An example for parametric testing of means. Imagine that your goal is to test whether a population's mean deviates significantly from a null hypothesis (a one-sample t-test). For a power analysis, you may have to run a pilot study to sample enough individuals from that population to estimate its standard deviation. Similarly, if you paired individuals from two populations to estimate the mean difference in a response to a shared stimulus, a power analysis would require pilot data on the standard deviation of the paired differences. Pairs like these can come from: matched individuals in a real experiment; a real system's outputs paired against a simulation driven by the same inputs, as in validation; or—the special case explored at the bottom of this page—two configurations of a simulated system sharing common random numbers.
The textbox below gathers data for both cases: a single list of numbers, written down a column or across one line, or two columns (comma, tab, or space separated) of paired data that differences will be taken over. Either summary can be sent to tab ① for the power analysis of a one-sample t-test (i.e., for either raw values or the differences between each pair). A two-column summary can also be sent to the bottom of this page for the power analysis of a paired t-test and an investigation of how correlation within pairs can be leveraged for more efficient simulation studies—fewer runs for the same power.
To compare two configurations of a system, run both under the same input conditions and test the paired differences D = X₁ − X₂ with the one-sample t-test of tab ①. What the pairing buys is variance: the differences have
So positive correlation ρ between the paired observations shrinks σd, and every bit of shrinkage is pure power—or, run the other direction, fewer runs for the same power. In contrast, the method of antithetic variates induces negative correlation between paired runs to reduce the variance of their average. Whereas common random numbers aim to reduce the runs needed to detect a small difference between two systems, antithetic variates aim to reduce the runs needed for a high-precision estimate of a single system's performance—the σ-of-a-pair-mean readout below tracks that side of the story.
Power for generalized linear models—logistic, Poisson, or gamma regression—generally has no clean closed form, and simulation is the standard professional route. This panel runs the Wald t-test of H₀: β₁ = 0 in a gamma regression, the GLM for a positive, right-skewed response such as a service time or a repair cost, with mean exp(β₀ + β₁x) and shape k. It runs through exactly the same Monte Carlo engine as tab ① (same seed field, same counting); the only difference is that no teal line will appear on the trace because there is no exact value to draw. The estimate and its interval are the answer.
Multiple regression. The power to detect one coefficient depends not only on
that coefficient but on how correlated its predictor is with the other predictors:
correlation inflates the standard error of the estimate (the variance-inflation factor), and so
the same slope can be easy to detect in one design and hopeless in another. Sample-size
recipes that take only “the effect” are silently assuming uncorrelated predictors. R handles
the general case through pwr::pwr.f2.test (Cohen's f² formulation) and Python
through statsmodels.stats.power.FTestPower; both leave translating your design
into f² to you, and simulation sidesteps that translation entirely.
Multiple comparisons. When a study tests many hypotheses at once, the per-comparison α must shrink for the family-wise error rate to stay at the nominal level—Bonferroni divides α by the number of tests; Tukey and Dunnett are the sharper procedures for all-pairs and against-a-control comparisons—and power falls accordingly, and so the n from any single-test analysis on this page is an underestimate for a multi-comparison study. This page does not compute family-wise power.
| Tool | Covers | GLM power (logistic, Poisson, gamma) | Multiple regression | Multiple comparisons |
|---|---|---|---|---|
MATLAB sampsizepwrStatistics and Machine Learning Toolbox |
the z, t, two-sample t, variance, and proportion tests of tab ①—exactly the five this page labels with a MATLAB id—solving in either direction depending on which argument is left [] |
no—simulate (the toolbox's fitglm in a loop) |
no | no |
R: stats + pwr |
power.t.test, power.prop.test, power.anova.test in base; the pwr package adds chi-square, correlation, and general f² cases |
no standard function—simulate with glm in a loop |
yes—pwr::pwr.f2.test |
no family-wise power; adjusted-α power via the same functions with α/k |
Python: statsmodels.stats.power |
t, two-sample t, z, ANOVA, chi-square GOF classes, each with one solve_power that solves for whichever argument is None—the two directions of this page in one call |
no standard function—simulate with statsmodels GLM in a loop |
yes—FTestPower with f² |
no family-wise power |
| G*Power standalone, point-and-click |
the standard test families (t, F, χ², z, exact), a priori and post-hoc, with plots—the tool students meet in psychology and biology courses | logistic and Poisson regression under its “z tests” family (approximations, not simulation) | yes—fixed-model R² cases | per-comparison α only |
Everything on this page reduces to one pattern: a test is a classifier, and a power analysis measures that classifier on labeled data. Generate datasets from the null model, generate more from the alternative, run the same decision rule on both, and count—the rejection rate on the null draws estimates the attained α, and the rejection rate on the alternative draws estimates power. The template arrives filled in with tab ①'s default t test so its output can be checked against this page (exact power 0.5645); replace the two generators and the classifier with your own model—a queueing simulation, a custom statistic—and nothing else changes.