Tutorials › VEE Mathematical Statistics › Two-Sided Tests and Confidence Interval Duality

VEE Mathematical Statistics · Hypothesis Testing Principles · Tutorial 605 of 880

Two-Sided Tests and Confidence Interval Duality

Connect two-sided test decisions to confidence intervals by inverting the test’s acceptance rule, then apply the relationship in normal models.

Intermediate 13 min read

What You'll Learn

  • Match the significance level of a two-sided test to the confidence level of its interval.
  • Invert a test’s acceptance region to define a confidence set.
  • Use a known-variance normal model to compare test decisions with interval membership.
  • Apply the same duality to a t interval for an unknown-variance normal mean.
  • Invert a chi-square test to obtain a confidence interval for a normal variance.
  • Recognize why interval membership does not assign a probability to a fixed parameter.

Why Two-Sided Tests and Confidence Intervals Match

A two-sided hypothesis test asks whether a specified parameter value is compatible with the data in either direction. A confidence interval gives a range of parameter values compatible with the data under a stated coverage procedure. When the test and interval are constructed from the same model and the same tail allocation, these are two ways to express the same calculation: the test rejects a proposed value precisely when that value lies outside the matching confidence interval.

The confidence level must match the test’s significance level. A level-\(\alpha\) two-sided test corresponds to a \(1-\alpha\) confidence interval, not an interval with an unrelated confidence level. The interval also depends on the chosen model and test statistic; an arbitrary interval and an arbitrary test need not have this relationship.

Definition: A confidence interval procedure with confidence level \(1-\alpha\) is a rule that, over repeated samples from the stated model, covers the fixed parameter \(\theta\) with probability \(1-\alpha\) (or at least \(1-\alpha\) for a conservative procedure). A matching level-\(\alpha\) two-sided test of \(H_0:\theta=\theta_0\) rejects exactly when \(\theta_0\) is outside the interval calculated from the same data and procedure.

The interval is random before data are collected because its endpoints depend on the sample. Once the data are observed, the endpoints are fixed. The confidence level describes the long-run coverage of the procedure; it is not the probability that a fixed parameter lies in the already calculated interval.

Inverting a Two-Sided Test

Suppose a test uses a statistic \(T_{\theta_0}\) whose null distribution is the same for every value \(\theta_0\), and suppose larger absolute values indicate stronger evidence against \(H_0:\theta=\theta_0\). Let \(c\) be chosen so that, under that null model, \(P(|T_{\theta_0}|\leq c)=1-\alpha\). The test rejects when \(|T_{\theta_0}|>c\); its non-rejection region is \(|T_{\theta_0}|\leq c\).

For the observed data, collect every proposed value \(\theta_0\) that would not be rejected. That collection is the confidence set. Its coverage follows directly from the test’s acceptance probability:

$$ C(X)=\{\theta_0: |T_{\theta_0}(X)|\leq c\}, \qquad P_\theta\{\theta\in C(X)\} =P_\theta\{|T_\theta(X)|\leq c\} =1-\alpha. $$

The middle expression uses the true value \(\theta\) as the candidate null value. Under that value, the test statistic has its null distribution, so the probability of falling in the acceptance region is \(1-\alpha\). This proves the coverage claim when the test has exact size \(\alpha\). If a test is conservative, the resulting coverage is at least \(1-\alpha\).

1
Choose the model and test.
State the sampling assumptions, parameter, significance level, and two-sided rejection rule.
2
Keep the observed data fixed.
Write the test’s non-rejection condition as an inequality involving a candidate value \(\theta_0\).
3
Solve for candidate values.
The values satisfying the inequality form the matching confidence interval or confidence set.
4
Check the decision.
A candidate inside the set is not rejected; a candidate outside it is rejected by the matching test.

Known-Variance Normal Mean

Let \(X_1,\ldots,X_n\) be independent observations from a normal distribution with mean \(\mu\) and known variance \(\sigma^2\). Then \(\bar X\) has mean \(\mu\) and variance \(\sigma^2/n\). For testing \(H_0:\mu=\mu_0\) against \(H_1:\mu\neq\mu_0\), the standardized statistic is \(Z=(\bar X-\mu_0)/(\sigma/\sqrt n)\). Under the null, \(Z\) has a standard normal distribution.

If \(z_{1-\alpha/2}\) is the standard normal quantile with cumulative probability \(1-\alpha/2\), the equal-tail test rejects when \(|Z|>z_{1-\alpha/2}\). Solving the non-rejection inequality for \(\mu_0\) gives the interval:

$$ \left|\frac{\bar X-\mu_0}{\sigma/\sqrt n}\right| \leq z_{1-\alpha/2} \quad\Longleftrightarrow\quad \bar X-z_{1-\alpha/2}\frac{\sigma}{\sqrt n} \leq\mu_0\leq \bar X+z_{1-\alpha/2}\frac{\sigma}{\sqrt n}. $$

Worked Example: Known-Variance Test and Interval

A hypothetical operations team models processing times as independent normal observations with unknown mean \(\mu\) and known standard deviation \(\sigma=12\) minutes. A sample of \(n=36\) observations has \(\bar X=54.1\) minutes. At \(\alpha=0.05\), construct the matching interval and test \(H_0:\mu=50\), \(H_0:\mu=52\), and \(H_0:\mu=60\), each against a two-sided alternative. Use \(z_{0.975}=1.96\).

Method and interval. The model assumptions are independent normal observations and a known standard deviation of 12 minutes. The standard error is \(\sigma/\sqrt n=12/\sqrt{36}=12/6=2\) minutes. The margin of error is \(1.96(2)=3.92\) minutes. Thus the 95% interval is \(54.1\pm3.92\), or \([50.18,58.02]\) minutes.

Test of 50. The test statistic is \(Z=(54.1-50)/2=4.1/2=2.05\). Since \(|2.05|>1.96\), reject. The value 50 is below the interval’s lower endpoint, as the duality predicts.

Test of 52. Here \(Z=(54.1-52)/2=2.1/2=1.05\). Since \(|1.05|<1.96\), do not reject. The value 52 lies inside the interval.

Test of 60. Here \(Z=(54.1-60)/2=-5.9/2=-2.95\). Since \(|-2.95|>1.96\), reject. The value 60 lies above the interval.

Check. The interval contains exactly the tested values not rejected: it contains 52 but excludes 50 and 60. The common mistake avoided here is to use a one-sided critical value for a two-sided test; at the 5% level, the 2.5% tail in each direction gives the critical value 1.96.

Unknown-Variance Normal Mean

When the population is normal but \(\sigma^2\) is unknown, replace \(\sigma\) with the sample standard deviation \(S\). For independent observations from a normal population, the statistic \(T=(\bar X-\mu_0)/(S/\sqrt n)\) has a Student \(t\) distribution with \(n-1\) degrees of freedom under \(H_0:\mu=\mu_0\). The equal-tail level-\(\alpha\) test uses the critical value \(t_{1-\alpha/2,n-1}\), and inversion gives \(\bar X\pm t_{1-\alpha/2,n-1}S/\sqrt n\).

This exact result relies on a normal population and independent observations. The \(t\) critical value accounts for estimating the standard deviation; using the standard normal critical value instead does not give this exact small-sample procedure.

Worked Example: A t Interval and Candidate Means

A hypothetical quality study records independent measurements from a normal population with unknown mean \(\mu\) and unknown variance. For \(n=16\), the sample mean is \(\bar X=82.4\) units and the sample standard deviation is \(S=8.0\) units. At \(\alpha=0.10\), construct the matching interval and test \(\mu_0=80\) and \(\mu_0=86\). Use \(t_{0.95,15}=1.753\).

Method and interval. The standard error is \(S/\sqrt n=8/\sqrt{16}=8/4=2\). The margin is \(1.753(2)=3.506\). Therefore the 90% interval is \(82.4\pm3.506\), or \([78.894,85.906]\) units, rounded to three decimals.

Test of 80. The statistic is \(T=(82.4-80)/2=2.4/2=1.2\). Since \(|1.2|<1.753\), do not reject. The candidate mean 80 is inside the interval.

Test of 86. The statistic is \(T=(82.4-86)/2=-3.6/2=-1.8\). Since \(|-1.8|>1.753\), reject. The candidate mean 86 is outside the interval. The observed test statistic is negative, but the test is two-sided, so its absolute value is compared with the positive critical value.

Check. Both decisions agree with the interval endpoints. The common mistake avoided is using a 95% interval for a 10% test; the matching confidence level is \(1-\alpha=0.90\).

Variance Tests and Asymmetric Intervals

The duality does not require a symmetric interval. Suppose \(X_1,\ldots,X_n\) are independent observations from a normal population with unknown mean and variance \(\sigma^2\), and let \(S^2\) be the usual sample variance. Under \(H_0:\sigma^2=\sigma_0^2\), the statistic \((n-1)S^2/\sigma_0^2\) has a chi-square distribution with \(n-1\) degrees of freedom. A two-sided equal-tail test rejects when the statistic is below the \(\alpha/2\) quantile or above the \(1-\alpha/2\) quantile.

Writing those quantiles as \(\chi^2_{\alpha/2,n-1}\) and \(\chi^2_{1-\alpha/2,n-1}\), respectively, and solving the non-rejection inequality for \(\sigma_0^2\) gives:

$$ \frac{(n-1)S^2}{\chi^2_{1-\alpha/2,n-1}} \leq \sigma_0^2\leq \frac{(n-1)S^2}{\chi^2_{\alpha/2,n-1}}. $$

The reversed placement of the quantiles in the denominators matters: dividing by the larger quantile gives the lower endpoint. Because the chi-square distribution is not symmetric, this interval is generally not centered at \(S^2\).

Worked Example: Inverting a Chi-Square Variance Test

A hypothetical laboratory models independent readings as normal with unknown mean and variance \(\sigma^2\). A sample of \(n=11\) readings has \(S^2=4.00\) squared units. At \(\alpha=0.10\), construct the matching interval and test \(\sigma_0^2=2\) and \(\sigma_0^2=8\). For 10 degrees of freedom, use \(\chi^2_{0.05,10}=3.940\) and \(\chi^2_{0.95,10}=18.307\).

Method and interval. The numerator is \((n-1)S^2=10(4.00)=40.00\). The lower endpoint is \(40/18.307=2.184\), and the upper endpoint is \(40/3.940=10.152\). The 90% interval is \([2.184,10.152]\) squared units, rounded to three decimals.

Test of 2. The statistic is \(40/2=20.000\), which exceeds the upper critical value 18.307. Reject. The candidate variance 2 is below the interval.

Test of 8. The statistic is \(40/8=5.000\), which lies between 3.940 and 18.307. Do not reject. The candidate variance 8 is inside the interval.

Check. The test decisions match interval membership. A frequent error is to put 3.940 in the denominator of the lower endpoint; that reverses the endpoints. The lower endpoint must be \(40/18.307\), not \(40/3.940\).

What the Duality Does—and Does Not—Say

For a fixed data set and a matching procedure, interval membership gives the test decision without a second calculation. If \(\theta_0\) is inside the interval, the corresponding test does not reject \(H_0:\theta=\theta_0\). If it is outside, the test rejects. A boundary value is normally not rejected when the test rejects only for a strict inequality; endpoint conventions should follow the stated rule.

This conclusion is specific to the matching construction. The test and interval must use the same probability model, statistic, significance level, and tail allocation. For example, an equal-tail 95% interval matches a two-sided 5% equal-tail test. A one-sided test is instead associated with a one-sided confidence bound, and a different interval procedure may produce different decisions.

The interval does not show that every value inside is equally plausible, nor does a non-rejection establish that the null value is true. It says that the particular matching test does not reject those values at the stated level. Interpreting a failure to reject as acceptance is a separate issue from this decision equivalence.

Key takeaway: Invert the non-rejection condition of a level-\(\alpha\) two-sided test to obtain its matching \(1-\alpha\) confidence set. For the same data and assumptions, a candidate parameter value is rejected if and only if it lies outside that set.

Check Your Understanding

For each problem, use the stated model and critical value, and compare the test decision with interval membership.

  1. Independent normal observations have known \(\sigma=10\), \(n=25\), and \(\bar X=103.2\). At \(\alpha=0.05\), use \(z_{0.975}=1.96\) to find the interval and decide whether \(\mu_0=107\) is rejected. (Answer: 95% interval \([99.28,107.12]\); 107 is inside, so do not reject.)
  2. A normal population has unknown variance. A sample has \(n=9\), \(\bar X=14\), and \(S=3\). At \(\alpha=0.10\), use \(t_{0.95,8}=1.860\). Find the interval and decide about \(\mu_0=16\). (Answer: 90% interval \([12.14,15.86]\); 16 is outside, so reject.)
  3. Independent normal observations have unknown mean and variance; \(n=8\) and \(S^2=6\). At \(\alpha=0.10\), use \(\chi^2_{0.05,7}=2.167\) and \(\chi^2_{0.95,7}=14.067\). Find the 90% interval for \(\sigma^2\), rounded to three decimals. (Answer: \([42/14.067,42/2.167]=[2.985,19.382]\).)
  4. Independent normal observations have known \(\sigma=8\), \(n=64\), and \(\bar X=21.5\). At \(\alpha=0.01\), use \(z_{0.995}=2.576\). Find the interval and decide whether \(\mu_0=24.5\) is rejected. (Answer: standard error \(=1\); 99% interval \([18.924,24.076]\); 24.5 is outside, so reject.)
  5. A normal population has unknown variance. For \(n=12\), \(\bar X=6.8\) and \(S=1.5\). At \(\alpha=0.05\), use \(t_{0.975,11}=2.201\). Find the interval, rounded to three decimals, and decide about \(\mu_0=5.8\). (Answer: standard error \(=1.5/\sqrt{12}=0.4330\), margin \(=0.953\), interval \([5.847,7.753]\); 5.8 is outside, so reject.)
Clinical Biostats