Why a Test and an Interval Can Give the Same Answer
A two-sided one-sample t test asks whether a population mean is compatible with a specified value, using the sample mean and its estimated standard error. A t confidence interval uses those same ingredients to give a range of plausible values for the population mean. When the test and interval use matching levels, they are two ways of expressing the same comparison: does the interval include the hypothesized mean?
For example, a test at significance level \(\alpha=0.05\) corresponds to a 95% two-sided t confidence interval. If the null mean lies outside that interval, the sample result is statistically significant at the 5% level. If it lies inside, the test does not reject the null at that level. The relationship is useful as a check on calculations and as a way to see which mean values are inconsistent with the data at a chosen level.
The Test and the Matching Interval
Suppose a quantitative outcome is measured on a random sample of \(n\) independent individuals from a population. Let \(\mu\) be the population mean, \(\bar{x}\) the sample mean, and \(s\) the sample standard deviation. For a two-sided test of \(H_0:\mu=\mu_0\) against \(H_a:\mu\ne\mu_0\), the one-sample t statistic is \(t=(\bar{x}-\mu_0)/(s/\sqrt{n})\), with \(df=n-1\).
The standard one-sample t procedures require independent observations and a sampling process appropriate for inference to the population of interest. For a small sample, the population distribution should be approximately normal, with no severe outliers; for a sufficiently large sample, the t procedure is generally robust to moderate departures from normality. The conditions should be assessed before using either the test or interval. The test’s exact t reference distribution assumes a random sample from a normally distributed population; the same normal-population model gives the exact t interval. Earlier material on one-sample t test conditions and diagnostics develops these checks.
For the matching test, the two-sided p-value is the probability, under \(H_0\), of a t statistic at least as far from zero as the observed statistic: \(P(|T|\ge |t_{\mathrm{obs}}|)\), where \(T\) follows a t distribution with \(n-1\) degrees of freedom under the null model. Equivalently, the critical-value rule compares \(|t_{\mathrm{obs}}|\) with \(t^*_{1-\alpha/2,\ n-1}\). A small p-value indicates that the observed sample mean is far from \(\mu_0\) relative to its estimated standard error.
Why the Decisions Match
The connection follows by rearranging the test statistic inequality. Write \(SE=s/\sqrt{n}\) and \(t^*=t^*_{1-\alpha/2,\ n-1}\). The two-sided test rejects when the absolute test statistic exceeds the critical value. The steps below show that this condition is exactly the condition that \(\mu_0\) lies beyond an endpoint of the matching interval.
For a two-sided test at level \(\alpha\), reject using the critical-value rule when \(\left|(\bar{x}-\mu_0)/SE\right|>t^*\).
Because \(SE>0\), the inequality is equivalent to \(|\bar{x}-\mu_0|>t^*SE\).
\(|\bar{x}-\mu_0|>t^*SE\) means either \(\mu_0<\bar{x}-t^*SE\) or \(\mu_0>\bar{x}+t^*SE\). Those are precisely the lower and upper endpoints of the matching t interval.
Therefore, the test rejects when \(\mu_0\) is outside the interval, and does not reject when \(\mu_0\) is inside it. The test and interval must be matched: the confidence level is \(100(1-\alpha)\%\), the test is two-sided, and both use the same sample, standard error, and degrees of freedom. The p-value gives the same information another way: it is below \(\alpha\) when the observed statistic is beyond the matching critical value.
At the exact boundary, \(|t_{\mathrm{obs}}|=t^*\), the null mean equals an interval endpoint and the two-sided p-value equals \(\alpha\). Decision conventions differ over whether to describe equality as rejection or non-rejection. The equivalence is exact when the test and interval use consistent boundary conventions; in ordinary continuous-data applications an exact tie has probability zero. Away from this boundary, the conclusion is unambiguous.
Worked Examples
Worked Example: A 5% Test and a 95% Interval
Hypothetical data: A random sample of 16 independent packages has a mean fill weight of \(\bar{x}=52.4\) grams and sample standard deviation \(s=8.0\) grams. The sample appears reasonably symmetric with no severe outliers, and the sampling process supports treating the observations as independent. Test \(H_0:\mu=48\) grams against \(H_a:\mu\ne48\) grams at \(\alpha=0.05\), then check the result with the matching interval.
The standard error is \(SE=s/\sqrt{n}=8.0/\sqrt{16}=2.0\) grams. With \(df=16-1=15\), the test statistic is $$ t=\frac{52.4-48}{2.0}=2.20. $$ The two-sided 5% critical value is approximately \(t^*_{0.975,15}=2.131\). Since \(|2.20|>2.131\), the critical-value rule rejects \(H_0\). The two-sided p-value is approximately 0.044, which is below 0.05 and gives the same decision.
The matching 95% interval is $$ 52.4\pm 2.131(2.0)=52.4\pm4.262=[48.138,\ 56.662]\text{ grams}. $$ Rounded to two decimal places, this is approximately \([48.14,\ 56.66]\) grams. The hypothesized mean of 48 grams is below the interval, so the interval check also indicates rejection at the 5% level. In context, the data provide evidence that the population mean fill weight differs from 48 grams; they do not establish that the difference is practically important.
Worked Example: A 1% Test and a 99% Interval
Hypothetical data: A random sample of 25 independent bulbs has a mean lifetime of \(\bar{x}=104.2\) hours and sample standard deviation \(s=8.0\) hours. Suppose the sample distribution has no severe outliers and is reasonably compatible with the t procedure. Compare \(H_0:\mu=100\) hours with \(H_a:\mu\ne100\) hours at \(\alpha=0.01\).
The standard error is \(8.0/\sqrt{25}=1.6\) hours, and \(df=24\). Thus $$ t=\frac{104.2-100}{1.6}=2.625. $$ For a two-sided test at \(\alpha=0.01\), the critical value is approximately \(t^*_{0.995,24}=2.797\). Because \(2.625<2.797\), the test does not reject \(H_0\) at the 1% level. The two-sided p-value is approximately 0.015, which is greater than 0.01.
The corresponding 99% interval is $$ 104.2\pm2.797(1.6)=104.2\pm4.4752 \approx[99.7248,\ 108.6752]\text{ hours}. $$ Using the more precise margin of error, approximately 4.4751 hours, the endpoints are approximately 99.7249 and 108.6751 hours. Rounded to two decimal places, the interval is \([99.72,\ 108.68]\) hours. The hypothesized mean of 100 hours lies inside this interval, agreeing with the test’s non-rejection at the 1% level. This does not show that the population mean is exactly 100 hours; it says the sample does not provide sufficiently strong evidence against that value at this stringent significance level.
Worked Example: The Conclusion Changes When the Level Changes
Hypothetical data: A random sample of 10 independent measurements has \(\bar{x}=12.6\) millimeters and \(s=2.4\) millimeters. Assume the small-sample diagnostics show no severe outliers and a roughly symmetric distribution. Test whether the population mean differs from 11 millimeters, first at \(\alpha=0.05\) and then at \(\alpha=0.10\).
The standard error is \(SE=2.4/\sqrt{10}\approx0.7589\) millimeters, and \(df=9\). The test statistic is $$ t=\frac{12.6-11}{0.7589}\approx2.108. $$ At \(\alpha=0.05\), \(t^*_{0.975,9}\approx2.262\). Since \(2.108<2.262\), the test does not reject at 5%. The 95% interval is $$ 12.6\pm2.262(0.7589)\approx12.6\pm1.717=[10.883,\ 14.317]\text{ millimeters}. $$ The value 11 millimeters is inside that interval.
At \(\alpha=0.10\), the matching interval is 90%, and \(t^*_{0.95,9}\approx1.833\). The margin of error is \(1.833(0.7589)\approx1.391\) millimeters, so the interval is approximately \([12.6-1.391,\ 12.6+1.391]=[11.209,\ 13.991]\) millimeters. Now 11 millimeters lies outside the interval, so the test rejects at the 10% level. The two-sided p-value is approximately 0.064: it exceeds 0.05 but is below 0.10. The data therefore meet the rejection threshold at 10% but not at 5%. This change is not a contradiction; the more stringent 5% test requires stronger evidence.
What the Match Does—and Does Not—Say
A confidence interval is a range produced by a procedure that, over repeated random samples under its assumptions, covers the fixed population mean at the stated rate. A 95% interval does not mean there is a 95% probability that the fixed mean is in this particular interval. Its connection to a test is about the decisions made by procedures based on the same data and model.
The match applies specifically to a two-sided test and a two-sided interval at the corresponding levels. A one-sided test does not generally match a two-sided interval at the same confidence level. Also, a non-rejected null value is not thereby proved or established as correct. The interval identifies values that are not rejected by the corresponding tests; values outside it are rejected by those tests at the matched level.
This relationship matters in reporting and checking analysis. A test gives a direct decision about one specified null value, while an interval shows the range of values that remain compatible with the data at a chosen confidence level. Reporting both can make the direction and precision of the estimate clearer, provided the confidence level and test level match.
Common Mistake
A frequent error is to compare a 5% test with a 90% interval, or a two-sided test with a one-sided interval, and expect the decisions to agree. The critical values are then different, so the procedures answer different threshold questions. To check a two-sided test at level \(\alpha\), use the two-sided \(100(1-\alpha)\%\) t interval based on the same sample and degrees of freedom. A second mistake is to say that an interval containing \(\mu_0\) proves \(H_0\) true. It only indicates that this test does not reject that value at the matched level.
Check Your Understanding
Answer each question using the test and interval relationship.
- A two-sided one-sample t test uses \(\alpha=0.05\). What confidence level should the matching t interval use?
- A hypothesized mean falls below the lower endpoint of the matching interval. What does that imply about the test decision?
- Why must a test and interval use the same sample standard deviation and degrees of freedom for the equivalence to hold?
- A 95% interval contains the null mean. Does this prove that the population mean equals the null value? Explain.
- A p-value is 0.08. At which of the levels 0.05 and 0.10 would the two-sided test reject, and what should happen to the matching intervals?