Box plots and informal confidence intervals
What this lesson covers
- A box plot shows the median and the middle 50%.
- The interval is median ± 1.5 × IQR ÷ √n.
- Bigger samples give narrower intervals.
The informal interval
- Find the sample median and interquartile range, the IQR.
- The interval is median ± 1.5 × IQR ÷ √n.
Sample of 36
- Median 52, IQR 18, n = 36.
- 1.5 × 18 ÷ √36 = 4.5
- 52 − 4.5 = 47.5
- 52 + 4.5 = 56.5
- interval: 47.5 to 56.5
Try it: box plots side by side
Why sample size matters
- The same median and IQR with other sample sizes.
| n | Margin | Interval |
|---|---|---|
| 25 | 5.4 | 46.6 to 57.4 |
| 36 | 4.5 | 47.5 to 56.5 |
| 100 | 2.7 | 49.3 to 54.7 |
From the box to the interval
- The interval is centred on the median and is much narrower than the box.
Try it: change the sample size
- Move n and watch the interval narrow.
Statistics explorer
Common mistakes
- Saying the interval holds all the data.It estimates the population median, not individual values.
- Dividing by n instead of √n.The formula uses the square root.
Your turn
Q1 = 10 and Q3 = 20. Find the IQR.
IQR 12, n = 36. Find the margin.
Median 40 with margin 3. Find the interval.
What happens as n grows?
Show answer
1. 10 2. 1.5 × 12 ÷ 6 = 3 3. 37 to 43 4. The interval narrows
Sample question: Achieved
A random sample of 25 Year 12 students gave a median of 64 minutes of homework a night, with an interquartile range of 20 minutes. Construct an informal confidence interval for the population median.
Hint
Use median ± 1.5 × IQR ÷ √n with n = 25.
Answer
58 to 70 minutes
Step by step
- Recall the informal interval: median ± 1.5 × IQR ÷ √n.
- Write down the pieces: median 64, IQR 20, n = 25, so √n = 5.
- Margin: 1.5 × 20 ÷ 5 = 30 ÷ 5 = 6 minutes.
- Lower end: 64 − 6 = 58. Upper end: 64 + 6 = 70.
- So the interval is 58 to 70 minutes, and it estimates the median homework time of all Year 12 students in the population.
- The classic mistake is dividing by n = 25 instead of √25 = 5. That gives a margin of 1.2, far too narrow.
- Check: the interval is centred on the sample median, 64, and is narrower than the box, which is 20 minutes wide.
Full working
- median 64, IQR 20, √25 = 5
- margin = 1.5 × 20 ÷ 5 = 61.5 × IQR ÷ √n
- 64 − 6 = 58, 64 + 6 = 70
- 58 to 70 minutes
Sample questions: Merit
A random sample of 49 Year 12 students at an Auckland school recorded their weekly screen time in hours. Minimum 8, lower quartile 18, median 24, upper quartile 32, maximum 55. Construct an informal confidence interval for the median and write a sentence interpreting it in context.
Hint
First find the IQR from the quartiles, then use median ± 1.5 × IQR ÷ √n.
Answer
21 to 27 hours: I am fairly sure the median weekly screen time of all Year 12 students at this school is between 21 and 27 hours
Step by step
- The formula needs the IQR, which is not given directly. IQR = upper quartile − lower quartile = 32 − 18 = 14 hours.
- The minimum and maximum are not needed for the interval. They describe single students, not the centre.
- n = 49, so √n = 7.
- Margin: 1.5 × 14 ÷ 7 = 21 ÷ 7 = 3 hours.
- Interval: 24 − 3 = 21 to 24 + 3 = 27 hours.
- Interpret it about the population, not the sample: the median weekly screen time for all Year 12 students at this school is likely to be between 21 and 27 hours.
- The classic mistake is to say "most students watch 21 to 27 hours". The interval is about the population median, not about individual students. Many students are outside it.
- Check: 21 and 27 sit inside the box (18 to 32), and the interval is centred on 24.
Full working
- IQR = 32 − 18 = 14upper quartile − lower quartile
- margin = 1.5 × 14 ÷ √49 = 3
- 24 − 3 = 21, 24 + 3 = 27
- about the population median, with units
- 21 to 27 hours for the population median
A random sample of 25 gave an informal confidence interval of 40 to 50 for a population median. Find the sample median and the IQR. If a sample of 100 gave the same median and IQR, what interval would it give? What happens to the width?
Hint
The median is the middle of the interval and the margin is half its width. Then work the formula backwards for the IQR.
Answer
Median 45, IQR ≈ 16.67; with n = 100 the interval is 42.5 to 47.5, half as wide
Step by step
- An informal interval is median ± margin, so the median is in the middle: (40 + 50) ÷ 2 = 45.
- The margin is half the width: (50 − 40) ÷ 2 = 5.
- Recall margin = 1.5 × IQR ÷ √n. With n = 25: 5 = 1.5 × IQR ÷ 5.
- Multiply by 5: 25 = 1.5 × IQR, so IQR = 25 ÷ 1.5 = 16.67.
- Now n = 100, so √n = 10. Margin = 1.5 × 16.67 ÷ 10 = 25 ÷ 10 = 2.5.
- Interval: 45 − 2.5 = 42.5 to 45 + 2.5 = 47.5.
- The width drops from 10 to 5, so it halves. Four times the sample gave half the width, because √100 is twice √25.
- The classic mistake is to think four times the sample makes the interval four times narrower. The formula divides by √n, not n.
- Check: 1.5 × 16.67 ÷ 5 = 5, which matches the first interval.
Full working
- median = (40 + 50) ÷ 2 = 45, margin = 5the middle and the half-width
- 5 = 1.5 × IQR ÷ √25, IQR = 25 ÷ 1.5 ≈ 16.67
- n = 100: margin = 1.5 × 16.67 ÷ 10 = 2.5
- 45 ± 2.5 gives 42.5 to 47.5
- width 10 becomes 5√100 = 2 × √25
- median 45, IQR ≈ 16.67; 42.5 to 47.5, half as wide
Sample questions: Excellence
A pilot survey of Year 12 students' daily travel time to school gave an IQR of about 16 minutes. A student wants an informal confidence interval for the median with a margin of at most 2 minutes. Find the smallest sample size needed, and give two reasons why the final interval might still not have a margin of exactly 2 minutes or might be misleading.
Hint
Set 1.5 × 16 ÷ √n ≤ 2 and solve for n. Remember n is a whole number of students.
Answer
n = 144 students; the IQR of the new sample may differ from 16, and a biased sample gives a narrow interval in the wrong place
Step by step
- Recall the margin: 1.5 × IQR ÷ √n. We want it at most 2 with IQR = 16.
- Set up the inequality: 1.5 × 16 ÷ √n ≤ 2, so 24 ÷ √n ≤ 2.
- Multiply both sides by √n and divide by 2: √n ≥ 12.
- Square both sides: n ≥ 144. The smallest sample is 144 students.
- Check: with n = 144 the margin is 24 ÷ 12 = 2. With n = 143 it is 24 ÷ 11.96 = 2.007, just too big.
- Reason 1: the IQR of 16 came from a pilot. The real sample's IQR could be bigger, which would make the margin bigger than 2.
- Reason 2: the formula only measures random sampling variation. If the sample is not random, say only students who arrive early, the interval can be narrow but centred in the wrong place.
- Reason 3: the interval estimates the population median only. It says nothing about how long a single student travels.
- The classic mistake is to solve 24 ÷ n ≤ 2 and get n = 12. The formula has √n, so n must be squared at the end.
Full working
- 1.5 × 16 ÷ √n ≤ 2margin at most 2
- √n ≥ 12
- n ≥ 144n = 143 gives 2.007
- the real IQR may differ from the pilot
- a biased sample is narrow but in the wrong place
- n = 144
Show that to make the margin of an informal confidence interval k times smaller, with the same IQR, you need a sample k² times as big. Hence, a researcher with a sample of 30 wants an interval one third as wide. How many must she sample? Comment on whether this is a sensible plan.
Hint
Write the margin with n, then with k²n, and compare. The square root does the work.
Answer
Margin with k²n is (1.5 × IQR ÷ √n) ÷ k; she needs 270 people; it costs nine times the effort for three times the precision
Step by step
- Start with the margin for a sample of n: 1.5 × IQR ÷ √n.
- Replace n by k²n: 1.5 × IQR ÷ √(k²n).
- The square root splits: √(k²n) = √k² × √n = k√n, because k is positive.
- So the new margin is 1.5 × IQR ÷ (k√n) = (1.5 × IQR ÷ √n) ÷ k. It is the old margin divided by k. That proves it.
- Hence part: one third as wide means k = 3, so the sample must be 3² = 9 times as big.
- 9 × 30 = 270 people.
- Check with an IQR of 10: n = 30 gives 1.5 × 10 ÷ 5.477 = 2.739, and n = 270 gives 1.5 × 10 ÷ 16.43 = 0.913, which is one third of 2.739.
- Is it sensible? Each extra bit of precision costs more and more people. Going from 30 to 270 is nine times the work for three times the precision.
- It may be worth it if the decision needs a narrow interval. If not, a more modest gain, such as k = 2 with 120 people, may be the better trade.
- And a bigger sample does not fix a biased one: 270 people chosen badly is still a poor sample.
Full working
- margin with n: 1.5 × IQR ÷ √n
- margin with k²n: 1.5 × IQR ÷ (k√n)√(k²n) = k√n
- = (1.5 × IQR ÷ √n) ÷ kk times smaller, proved
- k = 3: 9 × 30 = 270
- 9 times the effort for 3 times the precision
- 270 people
What to take away
- The interval is about the population median.
- A larger sample gives a narrower interval.
Practise this
Report a mistake
More in AS 91264
Is your child on track?
Take the free placement test