Catch the Mean

Build a confidence interval for a mean from one sample, and see what changes from 95% to 99%. You'll use R.

Assumes: the sampling distribution of the sample mean, the standard error SE = σ ÷ √n, the t-distribution with df = n − 1 for when σ is unknown, and pnorm, qnorm and qt in R. Each R task is one short edit.

1. Where do sample means land?

Recall: the means x̄ of many random samples of size n pile up in a normal curve centred at the population mean μ. Its standard deviation is the standard error, SE = σ ÷ √n, where σ is the population standard deviation: the SD of the whole population, not of one sample. For this step, suppose σ is known.

What share of sample means land within 1.96 SE of μ, on either side?

About 50%
About 68%
About 95%
About 99.7%

The middle area, as one subtraction

Area leftof 1.960−1.961.96−Area leftof −1.960−1.961.96removed=Area between−1.96 and 1.960−1.961.96

Each curve is the standard normal curve. Its axis is the distance of x̄ from μ, counted in SEs, so 0 is μ itself. pnorm(z) gives the shaded area to the left of z. Take the orange tail (middle picture) away from everything left of 1.96 (first picture), and only the blue middle is left.

Your task: on the standard normal curve, the share between −1.96 and 1.96 is the area left of 1.96 minus the area left of −1.96. Replace the NA with the area left of −1.96, and Run.

Hint 1pnorm(z) is the area to the left of z.
Hint 2The NA becomes pnorm() of the left edge of the shaded area, a negative number.

Your prediction

Lock in your prediction above first.

You predicted about 95%, and the cell should give 0.95: 95% of sample means land within 1.96 SE of μ. The other 5% split evenly, 2.5% too high and 2.5% too low. One step further: if the SE is 5 kg, 95% of sample means land within 1.96 × 5 = 9.8 kg of μ.

You predicted about 68%. That's the share within 1 SE of μ. Within 1.96 SE, about twice as far, the cell should give 0.95. One step further: if the SE is 5 kg, 95% of sample means land within 1.96 × 5 = 9.8 kg of μ.

You predicted about 99.7%. That's the share within 3 SE of μ. Within 1.96 SE the cell should give 0.95: 5% of sample means land farther out. One step further: if the SE is 5 kg, 95% of sample means land within 1.96 × 5 = 9.8 kg of μ.

You predicted about 50%. Half the sample means land within only about 0.67 SE of μ. Within 1.96 SE, the shaded area in the plot, the cell should give 0.95. One step further: if the SE is 5 kg, 95% of sample means land within 1.96 × 5 = 9.8 kg of μ.

The other way round: qnorm(0.975) gives back 1.96, the z with 97.5% of the area to its left (the middle 95% plus the 2.5% left tail). When σ is unknown, from step 2 on, R's qt() does the same job on the t-distribution.

Assumptions

Left out: other confidence levels, choosing a level, checking the conditions on real data, and intervals for proportions.