Chalk−1

Math · Introductory statistics · Worked example

Build a confidence interval from raw data

Use the sleep data 4, 8, 6, 5, 3, 7, 9 and 6 hours, a random sample of eight students at one school, to build a 95⁢% confidence interval for the mean hours of sleep.

Find the mean

With only eight students, check the conditions first. The values run from 3 to 9 with no clear outliers, so a t interval is reasonable. Then summarize the raw data, the mean first. The eight values add to 48.

488=6

Find s

The squared deviations from 6 add to 28, as in the standard deviation lesson. The sample divides by n−1=7.

288−1=2

Find the standard error

Divide s by n, not by n.

28≈0.707

Find t∗ and the margin

With 8−1=7 degrees of freedom, the t table gives t∗≈2.365. Eight observations are few, so t∗ is well above 1.96.

2.365⋅0.707≈1.67

Build the interval

Step the margin out from the mean in both directions.

6−1.67=4.336+1.67=7.67

Write the ends

The interval is 4.33 to 7.67 hours. With 95⁢% confidence, the mean nightly sleep of all students at this school, the population sampled, is between 4.33 and 7.67 hours.

(4.33,7.67)

Result

About 4.33 to 7.67 hours.

Your turn

1. One like the example

A random sample of five plants grows 4, 7, 8, 6 and 10 cm in a week. Build a 95⁢% confidence interval for the mean growth.

Show the answer and explanation

From about 4.22 cm to 9.78 cm.

The mean is 35⁢/5=7, and the squared deviations 9, 0, 1, 1 and 9 add to 20, so s=20⁢/4=5. The standard error is 5/5=1. With 4 degrees of freedom, t∗≈2.776, so the interval is 7±2.776.

4,7,8,6,104+7+8+6+105=7204=555=12.776⋅1=2.7767−2.776=4.2247+2.776=9.776

2. A variation

Would a 90⁢% interval from the sleep data be wider or narrower? Find it.

Show the answer and explanation

Narrower: about 4.66 to 7.34 hours.

With 7 degrees of freedom and 5⁢% in each tail, t∗≈1.895, so the margin is 1.895×0.707≈1.34. Less confidence buys a shorter interval.

x¯=6, s=2, n=828≈0.7071.895⋅0.707≈1.346−1.34=4.666+1.34=7.34

3. Somewhere new

A guideline says students need 7 hours of sleep. Suppose 32 students had given the same mean, 6 hours, and the same s, 2 hours. Find the 95⁢% interval. Does it rule out 7 hours, where the eight-student interval did not?

Show the answer and explanation

About 5.28 to 6.72 hours. Yes, 7 is now outside the interval.

The standard error falls to 2⁢/32≈0.354, and t∗ with 31 degrees of freedom is about 2.040, so the margin is about 0.72. The eight-student interval, 4.33 to 7.67, included 7. Four times the data halved the standard error, and the evidence became strong enough to rule 7 out.

x¯=6, s=2, n=32232≈0.3542.040⋅0.354≈0.726−0.72=5.286+0.72=6.72

Keep exploring

In Statistics, the Summary gives the mean 6, the sample standard deviation 2 and the standard error 0.707107 directly.

Return to the concept →
Sources and scope

Authored study material. Tool results depend on the stated inputs and model assumptions.

After reading

Try it, then study it

Open the example in its tool to check steps or change values, then review the key terms as flashcards.

Summarize the data in Statistics Check the interval in Math Draw 100 intervals from samples of 8 in Confidence-Interval Coverage Study the 7 key terms Open worked example on a board Confidence interval in Math Reference

Your existing work stays on this device. Examples open as editable copies.