Interactive demo · First-year statistics · Confidence intervals and tests

Tests and intervals: two views of one object

Fix the data, then ask about every possible hypothesised mean μ0 at once. For each μ0 the two-sided t-test gives a P-value; plotted against μ0 it makes a tent (top panel). The values of μ0 that the test does not reject, where the tent is above α, form exactly the confidence interval (teal band). Drag the white line, or the slider, to test any μ0: the bottom panel shows the same decision as the usual picture of a t statistic against its null distribution.

Data

Hypothesised mean μ₀

Significance level α

Scoreboard

Try these

This is why a 95% interval and a 5% two-sided test never disagree: they are built from the same inequality, |x̄ − μ0| < tα/2, n−1 s/√n, read in two directions.

In the lecture notes