Hypothesis tests and confidence intervals work together on the same sample.
1
Duality of Tests and Confidence Intervals
Duality means a two-sided hypothesis test and a confidence interval are the exact same distance check started from opposite ends. Suppose we test a blood pressure pill on 100 patients where normal random variation (95% of samples, or about two standard errors in each direction) is 3 points, and our sample average drop lands at +4.
Duality of Tests and Confidence Intervals
Text solution
Center the noise on the null value 0Adding and subtracting the 3-point margin around 0 shows where 95% of sample averages land by random chance when the pill does nothing:
0±3=[−3,3]
Center the same noise on the sample +4Because distance is the same in both directions, centering the 3-point margin on our sample collects every null value whose own 3-point interval would reach +4:
4±3=95% confidence interval[1,7]
Read the test result from the intervalEvery null value outside [1,7] (such as 0 or +8) is rejected in a two-sided test at α=0.05 with p-value<0.05, and every null value inside [1,7] (such as +2 or +6) is not rejected and has p-value>0.05.
As you slide the null value along the number line, its 3-point zone of normal noise reaches the sample at +4 only when the null value sits inside the sample's [1,7] confidence interval.
A null value's normal noise reaches the sample for the exact same values that sit inside the sample's confidence interval.
2
Confidence Levels, P-Values, and One-Sided Tests
A single 95% confidence interval only tells us whether a two-sided p-value is below or above 0.05. To trap a p-value between two cutoffs or check a one-sided test, we match the confidence percentage inside the interval to the error percentage sitting in the outer tails.
Confidence Levels, P-Values, and One-Sided Tests
Text solution
Match the confidence level to the two-sided αThe confidence level inside the interval and the total error α outside the interval add up to 100%:
Trap the two-sided p-value for 0.5 between nested intervalsAround our sample at +4, the 95% interval is [1,7] and the wider 99% interval (about 2.6 standard errors, or 3.9 points) is [0.1,7.9]. Because 0.5 sits outside [1,7] (rejected at 0.05) but inside [0.1,7.9] (not rejected at 0.01), its p-value sits between the two cutoffs:
0.01<p-value<0.05
Double the one-sided tail to find the matching confidence levelA one-sided test of μ>0 at α=0.05 only rejects null values that sit too far below the sample, so with the noise centered on the sample, all 5% of its rejection region goes in the lower tail, and a symmetric confidence interval puts an equal 5% in the upper tail:
100%−(5%+5%)=90% confidence interval
Watch out: if you only have a standard 95% confidence interval, its 5% outside error is split into 2.5% in each tail, so checking whether its bottom edge sits above 0 is running a one-sided test at α=0.025, not 0.05.
Slide the confidence level on the interval centered at +4 to see how the inside percentage and the two equal tail percentages trade off, trapping 0.5 between the 95% and 99% edges and matching a one-sided α=0.05 test to a 90% interval.
Drag the interval wider or narrower to see how the confidence level and the two outer tails trade off, and which null values stay inside.
3
Why Proportion Tests and Intervals Can Disagree
For a mean μ, a two-sided test and its matching confidence interval always give the exact same answer, because both get their width from the same standard error (SE). For a proportion p, however, a null value landing right on the edge of the confidence interval can occasionally be rejected by the test while barely staying inside the interval (or the other way around).
Why Proportion Tests and Intervals Can Disagree
For a mean μ, the test centered on 0 and the confidence interval centered on xˉ both use the sample standard deviation s:
SE=ns
For a proportion p, the hypothesis test starts by assuming the null value p0 is true, whereas the confidence interval plugs in the sample proportion p^:
Using p0 instead of p^ gives the two intervals slightly different widths, so when p0 sits right on the boundary, the confidence interval can barely include p0 while the test reports p-value=0.049.
4
Statistical vs. Practical Significance
Rejecting 0 only tells us an effect is not literally zero. To know what a study actually proves for real decisions, we compare the confidence interval against two cutoffs on the number line: statistical significance (0, whether we can tell the effect apart from zero) and practical significance (here +5 points of blood pressure, the smallest drop big enough to matter to patients).
Statistical vs. Practical Significance
Statistical
significance
Practical
significance
average drop
−2
0
2
4
5
6
8
10
12
Statistical
significance
Practical
significance
−2
10
−1
2
7
11
n=15
[0.97,1.03]
n=1,000,000
−2
0
2
4
5
6
8
10
Text solution
Above both cutoffs: [7,11]Because 0 is outside the interval (p<0.05) and the entire interval sits above +5, even the lowest plausible drop (+7) beats the doctors' threshold, so the pill is both statistically and practically significant.
Shrink the interval with a huge sample (n=1,000,000): [0.97,1.03]Dividing by 1,000,000=1000 instead of 100=10 makes the standard error 100 times smaller, so the 3-point margin shrinks to 0.03 points in each direction:
SE=ns=1,000,000s
Around a sample average of +1.0, the narrow interval [0.97,1.03] is far above 0 (p<0.0000001, statistically significant), but every plausible value lies well below +5, proving with high precision that the pill's effect is too small to be useful.
Stay below the practical threshold while crossing 0:[−1,2]Because 0 is inside the interval and even the largest plausible effect (+2) is below +5, the pill is neither statistically nor practically significant and can be dropped.
Cross both cutoffs in a small sample (n=15): [−2,10]With only 15 patients around a sample average of +4, random noise makes the interval wide enough to contain 0 (p>0.05) alongside large worthwhile effects like +8 and +10. The study has low power, and claiming "no effect" risks a Type II error; we need a larger sample to narrow the interval.
A narrow 95% confidence interval that sits above 0 while staying entirely below +5 proves a real effect that is too small to matter in practice, whereas a wide interval crossing both 0 and +5 shows the study is too imprecise to rule out either 0 or a large worthwhile effect.
Around the same small sample average, a narrow interval shows the effect is real but too small to matter, while a wide one is too imprecise to rule out either zero or a worthwhile effect.
5
Multiple Testing and the Bonferroni Correction
A single 95% confidence interval has a 5% (1 in 20) chance of missing a true null value of 0 by random chance (a Type I error, or false alarm). When researchers test 20 independent health outcomes on a useless sugar pill (where every true effect is 0), the chance of at least one false alarm grows with every added test, and the Bonferroni correction keeps the overall false-alarm risk at 5% by splitting the error budget equally among the tests.
Multiple Testing and the Bonferroni Correction
95%
α=0.05
−4
−2
0
2
4
6
Text solution
Multiply the probabilities of zero false alarms across all 20 independent testsEach individual 95% confidence interval has a 0.95 probability of including 0:
Subtract from 1 to find the overall risk of at least one false alarmIf even one interval misses 0 by random chance (like Test 14, Tuesday mood), we get a false alarm:
P(at least one false alarm)=1−0.36=0.64(64%)
Split the 5% error budget equally across the 20 testsDividing the 0.05 total error budget by 20 sets the Bonferroni p-value cutoff for each individual test:
Bonferroni per-test cutoff200.05=0.0025=0.25%
Widen every confidence interval to match the smaller per-test errorSubtracting the 0.25% per-test error from 100% gives each interval's required confidence level:
100%−0.25%=99.75% confidence interval
Widening all 20 intervals from 95% (about 2 standard errors) to 99.75% (about 3 standard errors) stretches Test 14's interval back across 0, so the false alarm disappears.
Add outcomes from 1 to 20 around the true null value of 0 to see uncorrected 95% intervals produce a random false alarm on Test 14 (Tuesday mood) as the overall risk climbs to 64%, while Bonferroni-corrected intervals widen with each added test to pull Test 14 back across 0.
Testing a useless sugar pill in more ways makes a false alarm likely by chance, unless you widen every interval to share the error budget.
6
Summary: Tests and Intervals Together
Putting all of these pieces onto one number line lets us read the hypothesis test, the p-value bounds, the practical importance, and the multiple-testing adjustment directly from the confidence interval.
Summary: Tests and Intervals Together
95%
−2
0
1
2
4
6
7
8
10
Key concepts
Everything here comes down to reading one sample-centered interval against the cutoffs on the number line:
Duality (two-sided test vs. confidence interval)
A confidence interval with 100%−α inside is the exact set of null values not rejected at significance level α (4±3=[1,7] rejects 0 with p<0.05 and keeps +2 with p>0.05). For a mean μ, the test and interval never disagree because both use SE=ns; only for a proportion p can a boundary value like p0=0.20 disagree slightly because the test uses np0(1−p0) while the interval uses np^(1−p^).
Trapping p-values and matching tails
When a null value sits between two nested confidence intervals, its two-sided p-value sits between their α levels (0.5 outside 95%[1,7] but inside 99%[0.1,7.9] means 0.01<p<0.05). Keep the 95% interval as-is for a two-sided test at α=0.05, but for a one-sided test at α=0.05 (5% in one tail), double the tail error (5%+5%=10% outside) and check the edge of a 90% confidence interval.
Practical vs. statistical significance
Sitting above 0 only proves the effect is not zero. Compare the whole interval to the practical threshold +5: a huge sample can make [0.97,1.03] statistically significant (p<0.0000001) while proving the effect is too tiny to matter, whereas a small sample giving [−2,10] crosses both 0 and +5, showing low power rather than "no effect."
Multiple testing (Bonferroni correction)
Use α=0.05 directly only when testing a single pre-planned outcome. When testing k outcomes at once (where the chance of at least one false alarm is 1−0.95k, or 64% for k=20), split the error budget to kα (200.05=0.0025) and widen every interval to 100%−kα (99.75%).
7
Practice
1
In a study of a cholesterol drug on 100 patients, the sample average drop is +12 points, and normal random variation (about two standard errors in each direction, covering 95% of samples) is 5 points. What is the 95% confidence interval for the true average drop, and what will a two-sided hypothesis test at α=0.05 conclude for testing null values of 0,+8, and +19 (including whether each p-value is less than or greater than 0.05)?
Where do you center the 5-point margin to get every plausible null value at once?
Center the 5-point margin of normal variation directly on the sample average of +12:
12±5=[7,17]
(Watch out: A common mistake is centering the 5-point margin on the null value 0 to get [−5,5] and calling that the confidence interval; the confidence interval is always centered on the sample +12.)
By duality, we check whether each null value sits inside or outside [7,17]:
+8 is inside [7,17], so a two-sided test fails to reject +8 and its p-value>0.05.
0 and +19 are both outside [7,17], so a two-sided test rejects both 0 and +19, and each has p-value<0.05.
2
From a single sample, a researcher builds three confidence intervals for a population mean μ: a 90% interval of [4.2,9.8], a 95% interval of [3.6,10.4], and a 99% interval of [2.5,11.5]. Without a calculator or table, trap the two-sided p-value for testing (a) H0:μ=4.0 and (b) H0:μ=3.0.
Being inside the 95% interval means we fail to reject at 0.05, so p>0.05; don't flip the inequality to p<0.05, which would give the wrong bound 0.01<p<0.05.
Convert each confidence percentage into its outside two-sided error α=1−confidence, then check which intervals include the null value and which miss it.
First match each confidence interval to its two-sided α cutoff:
90%95%99%↔α=0.10,↔α=0.05,↔α=0.01
(a)For H0:μ=4.0, the value 4.0 is outside the 90% interval [4.2,9.8] (rejected at α=0.10, so p<0.10) but inside the 95% interval [3.6,10.4] (not rejected at α=0.05, so p>0.05). (Watch out: Being inside the 95% interval means we fail to reject at 0.05, so p>0.05; don't flip the inequality to p<0.05, which would give the wrong bound 0.01<p<0.05.)
0.05<p-value<0.10
(b)For H0:μ=3.0, the value 3.0 is outside the 95% interval [3.6,10.4] (rejected at α=0.05) but inside the 99% interval [2.5,11.5] (not rejected at α=0.01):
0.01<p-value<0.05
3
Before running a clinical trial, researchers plan a one-sided test of H0:μ=0 against Ha:μ>0 at α=0.05. Their sample gives a 90% confidence interval of [0.4,5.6] and a 95% confidence interval of [−0.1,6.1]. Should they reject H0 in their one-sided test at α=0.05, and what bounds can they place on the one-sided p-value?
When a confidence interval has 5% in the lower tail, how much sits in both tails combined?
A one-sided test of μ>0 at α=0.05 only rejects null values that sit too far below the sample, so with the noise centered on the sample, all 5% goes in the single lower tail. By symmetry, a two-sided confidence interval with 5% in each tail has 10% outside in total, which is the 90% confidence interval:
(Watch out: The most common mistake is looking at the 95% interval [−0.1,6.1], seeing 0 inside, and failing to reject; a 95% interval puts only 2.5% in each tail, so it tests a one-sided hypothesis at α=0.025, not 0.05.)
Because the bottom edge of the 90% interval (0.4) is above 0, the one-sided p-value is less than 0.05. Because the bottom edge of the 95% interval (−0.1, matching one-sided α=0.025) is not above 0, they fail to reject at 0.025. Therefore, yes, reject H0, and the one-sided p-value is bounded by:
0.025<p-value<0.05
4
A researcher tests a proportion H0:p=0.20 in a two-sided test at α=0.05 and gets a p-value of 0.049, yet the 95% confidence interval from the same sample barely includes 0.20. Why can a test and confidence interval disagree right on the edge for a proportion p, and why can this never happen for a mean μ?
Compare what value goes inside the square root for the standard error when you assume H0 is true versus when you build a confidence interval from the sample.
For a proportion p, the hypothesis test assumes the null value p0 is true and plugs p0 into the standard error, whereas the confidence interval plugs in the sample proportion p^:
SEtestSEinterval=np0(1−p0),=np^(1−p^)
(Watch out: Don't blame rounding error or think one of the two calculations was done at the wrong confidence level; both use 95%, and the difference comes purely from using p0 versus p^ in the standard error.)
That gives the two intervals slightly different widths, so with a null value right on the edge like 0.20, the test's interval around 0.20 can just miss p^ (p-value=0.049) while the confidence interval around p^ barely includes 0.20. For a mean μ, both the t-test and the t-interval use the exact same standard error, SE=ns, so their intervals have the exact same width and can never disagree.
5
Physical therapists decide a new knee recovery program is only worth prescribing if it improves knee flexion by at least 10 degrees on average (0 degrees means no effect). Study A tests n=500,000 patients and finds a 95% confidence interval of [1.8,2.2] degrees (p<0.0001). Study B tests n=12 patients and finds a 95% confidence interval of [−3,18] degrees (p>0.05). What does each study show about statistical and practical significance, and what decision should follow from each?
Plot both intervals against the two cutoffs at 0 and +10, and check what the upper end of each interval rules in or rules out.
Compare each interval against 0 (statistical significance) and +10 (practical significance):
Study A ([1.8,2.2])Because 0 is far outside [1.8,2.2], the result is statistically significant, but because the entire narrow interval lies well below the 10-degree threshold, it is not practically significant. (Watch out: Don't let p<0.0001 fool you into prescribing the program; the huge sample size n=500,000 simply shrank SE=ns enough to prove the true improvement is around 2 degrees, which is too small to matter.) Decision: drop the program.
Study B ([−3,18])Because 0 is inside [−3,18], the result is not statistically significant, but large worthwhile improvements like +15 and +18 degrees are also inside the interval. (Watch out: Failing to reject 0 here does not prove the program has no effect; because n=12 gives low power and a wide, imprecise interval crossing both 0 and +10, claiming "no effect" risks a Type II error.) Decision: run a larger sample to narrow the interval.
6
A company tests an ineffective herbal supplement (true effect =0 on everything) across 10 independent health outcomes, running a two-sided test at α=0.05 and building a 95% confidence interval for each outcome. The smallest p-value among the 10 outcomes is p=0.012 for reaction time. (a) What is the probability of getting at least one false alarm (Type I error) across the 10 tests by random chance alone (using 0.9510≈0.60)? (b) Using the Bonferroni correction to keep the total error budget at 5% across all 10 tests, find the new per-test p-value cutoff and individual confidence level, explain how the confidence intervals change, and state whether the reaction-time result remains significant.
Don't just report 0.9510≈0.60 as the false-alarm risk; 0.60 is the probability of zero false alarms, so you must subtract from 1. Also avoid multiplying 10×0.05=0.50, which overstates the exact probability because multiple false alarms can overlap.
For (a), find the probability that all 10 intervals include 0 first; for (b), split the 5% budget equally among the 10 tests.
(a)Each independent test has a 0.95 probability of including 0 with no false alarm, so across 10 tests:
P(at least one false alarm)=1−0.9510≈1−0.60=0.40(or 40%)
(Watch out: Don't just report 0.9510≈0.60 as the false-alarm risk; 0.60 is the probability of zero false alarms, so you must subtract from 1. Also avoid multiplying 10×0.05=0.50, which overstates the exact probability because multiple false alarms can overlap.)
(b)Divide the 5% total error budget equally across the 10 tests:
Every confidence interval must be made wider to reach 99.5% confidence, and because p=0.012 is greater than the 0.005 cutoff, the reaction-time result is no longer statistically significant (its wider 99.5% interval reaches back across 0).