A possibly randomized statistical test has rejection probability after observing . Its statistical power at parameter is , and its test size is the supremum of that statistical power over the null parameter set.
For simple hypotheses with densities , the Neyman-Pearson lemma states that a level- test is most powerful if it rejects where , accepts where , and randomizes on equality to obtain null rejection probability . Here is chosen to reach that test size. To prove optimality, let be this test and any test of level at most . Pointwise,
Integrating and using gives . This proves maximal statistical power. For , equality also forces any equally powerful test to use all its allowed test size and agree with the indicated decisions away from the likelihood-ratio tie set, up to null sets.
For the Poisson sample, and, for every fixed , the likelihood ratio is
It increases strictly with . Choose an integer so that , and reject for , with boundary rejection probability
This has exact test size . Its rejection ordering and calibration do not depend on which is selected, so the lemma proves it uniformly most powerful for the whole one-sided alternative. Randomization is generally needed for an exact arbitrary test size in a discrete model.
For the approximate design, the central limit theorem under gives critical sum . Under , the sum is approximately normal with mean and variance . Target statistical power therefore gives
or . Thus the requested design expression is
Round upward to obtain an integer design. This is a normal approximation to the requested statistical power, rather than an exact discrete sample-size guarantee; the exact Poisson test above provides its exact calibration.
Put . For interior parameters , the alternative-to-null likelihood ratio is
The second base is greater than one, so this is strictly increasing in . The Neyman-Pearson lemma therefore gives an upper-tail rejection rule. Under the null hypothesis, , and an ordinary conservative threshold can be chosen as
There is an important discrete qualification: an integer cutoff need not have test size exactly . To obtain exact size, choose an integer with , reject certainly when , and at reject with probability
This randomized statistical test is a most powerful test at exact size ; when a binomial upper tail equals , no randomization is needed and the stated region is literal. Otherwise the unrandomized upper-tail region has size at most , and the exact-size result includes the boundary randomization. Endpoint parameter cases retain the same upper-tail ordering by taking limits, with ties resolved on the null-supported outcomes.
For two simple statistical hypotheses with joint probability density functions and , fix a significance level . A randomized statistical test is the conditional probability of rejection given the data. Choose and, if necessary, randomization on the equality set so that
The Neyman-Pearson lemma says that this is a most powerful test among all tests with test size at most :
Thus the optimal ordering rejects where the alternative-to-null likelihood ratio is largest. On null-impossible observations with , the rejection probability is one. Randomization is dispensable whenever an ordinary threshold already attains the required test size.
The Neyman-Pearson lemma concerns a simple hypothesis against another simple hypothesis . For a continuous statistical sample, put for the joint probability density functions, . A randomized statistical test is a measurable , the conditional probability of rejection after observing . Its test size is and its statistical power is .
Choose and boundary randomization so that
Then is most powerful among all tests of size at most . Thus one rejects for sufficiently large alternative-to-null likelihood ratio. If the equality set has zero probability under , the test needs no randomization. Continuous observations alone do not guarantee that their likelihood ratio has a continuous probability distribution.
For the proof, let be any competing test with . At every ,
Indeed, on the first factor is ; on it is ; and on equality the product is zero. Integration gives
which proves the claimed optimality. Moreover, when , equality of statistical power forces equality of test size and forces almost everywhere where : otherwise the nonnegative integrand would have positive integral. This proves the usual necessity assertion as well, up to equality sets and sets of zero probability under both hypotheses.
A randomized statistical test specifies a measurable rejection probability for each possible data value. It can be implemented by rejecting when an independent uniform random variable on satisfies . A deterministic test has only the values zero and one. Under a simple hypothesis , its rejection probability is , which is its test size for and its statistical power for .
The Neyman-Pearson lemma permits randomization on an equality set of the form to reach a prescribed test size. Continuous observations do not rule out an equality set of positive probability: if both hypotheses give the same probability density function, their likelihood ratio is identically one. This explains why a precise statement of the lemma includes boundary randomization even for continuous data.
Statistical hypothesis test Created 2026-10-14 Updated 2026-11-05
A statistical hypothesis test is a decision rule calibrated to distinguish a null hypothesis from a specified alternative hypothesis. A randomized statistical test gives a rejection probability for possible data . Its power function of a statistical test is , and a level- test satisfies
The supremum is the size of a statistical test. Controlling it limits type I error; a useful test also has high statistical power against scientifically relevant alternatives.
For ten independent Bernoulli trials with success probability , test against by rejecting for at least nine successes. The upper-tail probability increases with , so the largest null rejection probability occurs at and equals
It is therefore a conservative level-0.05 test. Rejecting at eight successes would have size . This illustrates why discrete calibration need not attain the advertised level exactly. A p-value is a null-tail probability for the observation, not a probability that the null hypothesis is true. The decision also does not measure the size or practical importance of an effect.