Hypothesis tests and rejection regions

The question
Choose a rule before seeing the measurements it will judge.
- 1 SeeSet a boundary; compare the two errors.
- 2 TryTest a detector with discrete outcomes.
- 3 ProveBuild the likelihood-ratio argument.
- 4 ApplyCalculate cutoffs, power, and randomization.
Before you start · 3 quick checks on standard errors, normal areas, and coverage
Two ideas before you start
2 ideasA hypothesis specifies a population
Switch between two possible sampling densities for a statistic.
The observed statistic will be one value. A hypothesis supplies the distribution used to judge possible values.
Exact definition
The null hypothesis \(H_0\) is the population claim against which the test is calibrated. The alternative \(H_1\) specifies the competing claim. A simple hypothesis fixes the entire distribution; a composite hypothesis allows several distributions. Here both hypotheses are simple. The curves are possible distributions, not probabilities that the hypotheses are true.
A rejection region is a decision rule
A statistic axis with a shaded set of values that trigger rejection.
Switch the shaded set. Values inside it trigger rejection; values outside it do not.
Exact definition
A deterministic test rejects exactly when its data or statistic belong to a specified set \(R\), the rejection region. Its Type I error probability is \(P_0(R)\): rejection when the null model is true. Its Type II error probability is \(\beta=P_1(R^c)\): no rejection when the specified alternative is true. Its power against that alternative is \(P_1(R)=1-\beta\). The subscripts identify the model under which an area is calculated.
Sampling model and notation
For the normal activity, observations are independent and identically distributed normal variables with unknown mean \(\mu\) and known population SD \(\sigma\gt0\). The sample size \(n\ge1\), hypotheses, and testing rule are chosen before observing the sample. Write \(s=\sigma/\sqrt n\) for the standard error and \(Z=(\bar X-\mu_0)/s\) for the test statistic. The null is \(\mu=\mu_0\); the alternative is one specified larger mean \(\mu_1\).
Under the null, Z is standard normal. Under the alternative it is normal with mean \(\delta=(\mu_1-\mu_0)/s\gt0\) and variance one. The lesson on sampling distributions explains the standard error. The normal distribution lesson explains the CDF \(\Phi\). Normality here is an assumption, so no large-sample approximation is needed. Replacing the known SD with an estimated SD requires a different calibration.
Place the rejection boundary
- Choose the cutoff with the slider, then evaluate your boundary.
- Once you act, the two panels show the error areas for your current rule.
- Keep the null rejection probability within the budget and make the alternative miss probability as small as possible on the slider grid.
Moving the cutoff to the right removes outcomes from the rejection set. Both models then reject less often: false alarms fall, but misses rise. The two errors use different probability distributions. Their sum is not required to equal one. The complement of the Type II error is power, evaluated under the same alternative.
A significance level is an upper bound on the null rejection probability. A test can have size below that bound. For a simple null, its size is just its Type I error probability; for a composite null, size is the supremum (least upper bound) of rejection probabilities over the null models. This activity has a simple null, so there is only one null curve to calibrate.
A detector with two possible reports
- Make a prediction about a rule that must always give the same decision for the same report.
- After checking, choose a conditional rejection probability to meet each goal.
A randomized test adds an independent random draw after seeing the report. Let γ be the probability of rejecting when the report is “signal.” Do not reject when the report is “quiet.” The rule and γ are fixed in advance. Randomizing does not change the detector's distribution; it changes the decision taken on some identical reports.
Use what you found above
Power depends on which alternative is specified. A rule that maximizes power against one alternative need not maximize it against another. If both increases and decreases matter, an upper-tail region alone does not express that scientific question. Specify the direction before looking at the sign of the observed change.
Why compare likelihood ratios?
Refresher: density ratios and randomized tests
Write \(f_0(x)\) and \(f_1(x)\) for the density, or probability mass, of the complete data x under each simple hypothesis. A likelihood ratio \(f_1(x)/f_0(x)\) compares how much probability weight the same outcome receives under the two models. It is not a posterior probability. For densities, a point itself has zero probability; probabilities come from integrals over sets.
A test function \(\varphi(x)\in[0,1]\) is the conditional probability of rejecting after observing x. A deterministic rule uses only zero and one. Its rejection probability under model j is \(E_j\varphi=\int\varphi(x)f_j(x)\,dx\). For a discrete model replace the integral by a sum. These definitions supply everything needed below.
Consider two simple hypotheses with positive densities or masses \(f_0,f_1\) on the same support. Fix \(0\lt\alpha\lt1\) and \(k\gt0\). Suppose a rule \(\varphi_*\) rejects where \(f_1\gt kf_0\), does not reject where \(f_1\lt kf_0\), and randomizes on equality so that \(E_0\varphi_*=\alpha\). Then it has at least as much power as every test \(\psi\in[0,1]\) with \(E_0\psi\le\alpha\).
Define \(\Delta_j=E_j\varphi_*-E_j\psi\). The target is \(\Delta_1\ge0\). The theorem allows ties and identical tests; it claims optimality, not uniqueness. It assumes that the stated threshold rule attains the budget, with randomization if needed.
Build the comparison point by point, then add it up. The first two choices concern only points where the competing decisions differ strictly. Equality cases contribute zero and are included when integrating.
On the equality set, the density difference is zero regardless of either test's randomization. Elsewhere the threshold rule chooses the sign that makes the product nonnegative. Integrating uses the same data space under both models. The null-budget inequality then converts that pointwise comparison into a comparison of power.
For the normal experiment, the full-sample likelihood ratio is a strictly increasing function of the sample mean when the alternative mean is larger and the variance is known and common. Equivalently, the induced ratio for Z is \(\exp(\delta z-\delta^2/2)\). Thus an upper-tail cutoff implements the likelihood-ratio rule. The exact null quantile uses the full budget; the slider approximates it on a finite grid.
Specify the rule, then calculate
Enter decimals without units or percent signs. Each task states its assumptions and accepted error. A probability is entered on the scale from zero to one. Use unrounded quantiles internally, then round the requested answer.
What a decision does and does not establish
“Do not reject” does not establish that the null is true. Under a specified alternative it can be a Type II error. “Reject” does not establish that the alternative is certain. Even a calibrated rule rejects some samples generated by the null. The error rates describe repeated use of the fixed rule under specified models; they are not the probabilities that either hypothesis is true after this sample.
There is a matching interval interpretation. In the known-SD normal model, a two-sided level-α test rejects \(\mu_0\) when it falls outside the central confidence interval with coverage \(1-\alpha\). An upper-tail level-α test instead matches a one-sided lower confidence bound. The confidence intervals lesson explains coverage; keep the sidedness consistent when connecting intervals to tests.
Choosing a cutoff after seeing the result, or repeatedly testing until a rejection appears, changes the rule being used. The error calculation on this page applies to the fixed sampling plan and specified test. It does not automatically apply to such a modified procedure.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, chapter 8, “Hypothesis Testing.”