Probability and Statistics 201-SN1-RE • CEGEP, Montreal

Revision sheet: confidence intervals (201-SN1-RE)

This sheet goes with the “inference” element of the Probability and Statistics course 201-SN1-RE: sampling distribution of X‾\overline{X} and of P^\hat{P}, central limit theorem, margin of error, Student's t distribution, and the three confidence intervals of the course description, for a mean with n≥30n\ge 30, for a mean with n<30n<30 and for a proportion.

What the sheet covers

It does not redo the course. It tells you which case to choose, which standard error to write, which concluding sentence the grader expects, and what loses marks. Hypothesis tests have their own sheet, the one for the next chapter.

  • 8 mistakes that cost marks
  • 4 figures
  • 15 min reading
Do the chapter's exercises

The thread of the chapter

The standard deviation of the individuals is not that of the mean: the interval is built with the standard error σn\frac{\sigma}{\sqrt{n}} (or p(1−p)n\sqrt{\frac{p(1-p)}{n}}), its 95% describes the method and not the parameter, and it only holds under its conditions.

Topics covered

  • Sampling distribution
  • Standard error
  • Central limit theorem
  • Sampling with replacement
  • Confidence interval
  • Confidence level
  • Margin of error
  • Student's t distribution
  • Degrees of freedom
  • Estimating a proportion
  • Sample size

The chapter at a glance

The three intervals of the course, recognized at a glance

Read the row “What is estimated”, then the sample size: the column is chosen. The rest of the column goes onto your paper, conditions included.

Mean, n≥30n\ge 30 large sample
What is estimated
the mean μ\mu of a measurement (content, mass, concentration)
Conditions
random sample, independent observations, n≥30n\ge 30
Standard error
sn\dfrac{s}{\sqrt{n}}
Critical value
zz: 1.6451.645, 1.961.96, 2.5762.576
Interval
x‾±zsn\overline{x}\pm z\dfrac{s}{\sqrt{n}}
Typical pitfall
dividing by ss instead of sn\frac{s}{\sqrt{n}}
Mean, n<30n<30 small sample
What is estimated
the mean μ\mu of a measurement, with few data
Conditions
random sample, population assumed normal (no strong skewness, no outlier)
Standard error
sn\dfrac{s}{\sqrt{n}}
Critical value
Student's tt with n−1n-1 degrees of freedom, read in the table
Interval
x‾±tsn\overline{x}\pm t\dfrac{s}{\sqrt{n}}
Typical pitfall
taking 1.961.96: the interval is too narrow
Proportion, n≥30n\ge 30 successes out of n
What is estimated
the proportion pp of individuals with a characteristic
Conditions
random sample, n≥30n\ge 30, np^≥5n\hat{p}\ge 5 and n(1−p^)≥5n(1-\hat{p})\ge 5
Standard error
p^(1−p^)n\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}
Critical value
zz: 1.6451.645, 1.961.96, 2.5762.576
Interval
p^±zp^(1−p^)n\hat{p}\pm z\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}
Typical pitfall
the square root that does not cover the nn

Key: the words in the table

Random sample
Every individual in the population has the same chance of being drawn. Without it, no margin means anything.
Population assumed normal
Assumption that the values in the population follow a normal distribution; it is judged plausible from a graph of the data.
Student
Distribution of T=X‾−μS/nT=\frac{\overline{X}-\mu}{S/\sqrt{n}} when the population is normal: more spread out than the normal, it gets closer to it as nn grows.
Degrees of freedom
n−1n-1 for an interval on a mean: one degree is used up by x‾\overline{x}, which is needed to compute ss.

The case “mean, n<30n<30” on very skewed data has no method in this course: say so, and enlarge the sample.

The essentials

Two standard deviations never to confuse

  • • σ\sigma (estimated by ss) measures the spread of the INDIVIDUALS: one grain, one fish, one day.
  • • σX‾=σn\sigma_{\overline{X}}=\dfrac{\sigma}{\sqrt{n}}, the STANDARD ERROR, measures how much the MEAN of a sample of size nn spreads from one sample to another.
  • • Proof with replacement: E(X‾)=1n∑E(Xi)=μE(\overline{X})=\frac{1}{n}\sum E(X_{i})=\mu (linearity) and V(X‾)=1n2∑V(Xi)=σ2nV(\overline{X})=\frac{1}{n^{2}}\sum V(X_{i})=\frac{\sigma^{2}}{n} (independence).
  • • For a proportion, P^=Xn\hat{P}=\frac{X}{n} with XX binomial: E(P^)=pE(\hat{P})=p and V(P^)=p(1−p)nV(\hat{P})=\frac{p(1-p)}{n}.
22.533.544.555.566.577.580.511.522.53mean of 36 grainsstd. dev. 0.9/6 = 0.15one grainstd. dev. 0.9density
Same centre 5.05.0 ng, but the mean of 3636 grains is six times less spread out than a single grain: 0.936=0.15\frac{0.9}{\sqrt{36}}=0.15 ng.

Without replacement, the result still holds as long as n is a small fraction of the population (usual rule: less than 5%).

The central limit theorem, and what it does not say

  • • Independent observations, identically distributed, nn large enough (n≥30n\ge 30 in practice): X‾\overline{X} approximately follows N(μ,σ2n)N\left(\mu, \frac{\sigma^{2}}{n}\right), whatever the shape of the population.
  • • It is about the MEAN. The data keep their shape: a skewed histogram stays skewed with 1,0001{,}000 observations.
  • • It requires independence: individuals taken together (same net, same days, same family) give a standard error that is too optimistic.
  • • Below 3030 observations, it is no longer enough: Student's method replaces the theorem by the assumption of a normal population.

What “95%” means

  • • μ\mu is a FIXED number. What varies from one sample to another is the interval, through its centre x‾\overline{x} and its width, which depends on ss.
  • • 95% is the proportion of samples for which the METHOD produces an interval that contains μ\mu.
  • • A computed interval contains μ\mu or does not; we do not know which.
  • • More confidence, wider interval; more data, narrower interval, as 1n\frac{1}{\sqrt{n}}.

The mistakes that cost marks

These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.

1. Giving the parameter the probability of the method

1 to 2 marks, for every interpretation asked for

What not to write

“There is a 95% chance that the mean content is between 0.400.40 and 0.520.52 mg/kg.”

What to write

“At the 95% confidence level, the mean content lies between 0.400.40 and 0.520.52 mg/kg: the method used captures the true mean in 95% of samples.”

Why: The population mean does not move: once the interval is computed, there is no randomness left. The probability belonged to the drawing of the sample.

2. Taking the interval for the mean as the range of the individuals

the whole interpretation question

What not to write

“95% of the pollen grains weigh between 4.804.80 and 5.395.39 ng.”

What to write

“The MEAN mass of the grains lies between 4.804.80 and 5.395.39 ng at the 95% level; the grains themselves are about 36=6\sqrt{36}=6 times more spread out.”

33.544.555.566.577.595% interval for μone dot = one grain
The 3636 grains spread from 3.33.3 to 6.96.9 ng; the 95% interval for the mean, [4.80,5.39][4.80, 5.39], covers only a small part of them, and that is normal (grains grouped by 0.20.2 ng).

Why: The interval is built on the standard error, not on the standard deviation of the individuals. It is the thread of the chapter, and the figure makes it undeniable.

3. Dividing by the standard deviation instead of the standard error

2 marks and the whole rest of the exercise

What not to write

“z=0.5−0.420.22≈0.36z=\dfrac{0.5-0.42}{0.22}\approx 0.36, so P(X‾>0.5)≈0.36P(\overline{X}>0.5)\approx 0.36.”

What to write

“σX‾=0.2240≈0.0348\sigma_{\overline{X}}=\dfrac{0.22}{\sqrt{40}}\approx 0.0348, so z≈2.30z\approx 2.30 and P(X‾>0.5)≈0.0107P(\overline{X}>0.5)\approx 0.0107.”

Why: A question about X‾\overline{X} is standardized with the standard deviation of X‾\overline{X}. Writing the standard error alone, on its own line, before any margin, prevents the slip.

4. Taking 1.96 on a small sample

1 to 2 marks, plus the interpretation

What not to write

“n=12n=12: x‾±1.96s12\overline{x}\pm 1.96\dfrac{s}{\sqrt{12}} at the 95% level.”

What to write

“σ\sigma unknown and n=12<30n=12<30, population assumed normal: x‾±t0.025,11s12\overline{x}\pm t_{0.025, 11}\dfrac{s}{\sqrt{12}}, with t=2.201t=2.201.”

Why: With 1.961.96, the method captures μ\mu only about 92.4% of the time with 11 degrees of freedom: it claims a precision it does not have. The tt is ALWAYS larger than zz.

5. Believing that n ≥ 30 makes the data normal

1 mark of justification

What not to write

“Since n=45≥30n=45\ge 30, the mercury contents follow a normal distribution.”

What to write

“Since n=45≥30n=45\ge 30 and the walleyes were drawn at random, the MEAN content X‾\overline{X} approximately follows a normal distribution.”

Why: The central limit theorem is about the mean. A skewed population stays skewed; it is the mean that becomes normal.

6. Rounding the sample size down

1 mark, the final answer

What not to write

“n≥150.06n\ge 150.06, so n=150n=150.”

What to write

“n≥150.06n\ge 150.06, so n=151n=151: with 150150, the margin would be 2.00042.0004 mm, above the target.”

Why: The condition is an inequality: the first integer that satisfies it is above. ALWAYS round up, even 150.06.

7. Doubling n to halve the margin

1 mark

What not to write

“With twice as many days of measurement, the margin will be half as large.”

What to write

“The margin goes as 1n\dfrac{1}{\sqrt{n}}: dividing it by 22 takes 44 times as many data; twice as many only divides it by 2≈1.41\sqrt{2}\approx 1.41.”

Why: The precision of a mean improves like the square root of the effort; that is what makes large samples expensive.

8. Swapping the bounds after a decreasing transformation

1 mark, and an absurd interval

What not to write

“0.111≤p≤0.1890.111\le p\le 0.189, so 6000.111≤N≤6000.189\dfrac{600}{0.111}\le N\le\dfrac{600}{0.189}.”

What to write

“N=600pN=\dfrac{600}{p} decreases as pp increases: 6000.189≤N≤6000.111\dfrac{600}{0.189}\le N\le\dfrac{600}{0.111}, that is about 3,170≤N≤5,4103{,}170\le N\le 5{,}410.”

Why: A decreasing function swaps the bounds. The confidence level is preserved, since the two inequalities describe the same event.

Which method to choose

Which interval, z or t?

Look at what is being estimated, then at the sample size, then at what is known about the population.

0.511.522.533.540.050.10.150.20.250.30.350.40.451.962.776standard normalStudent, 4 df (n = 5)
With 44 degrees of freedom, Student's t distribution has much heavier tails: you must go out to 2.7762.776, and not 1.961.96, to leave 2.5%2.5\% in the tail (right half shown, the figure is symmetric).
  • If you count successes out of nn (a proportion) and n≥30n\ge 30, np^≥5n\hat{p}\ge 5, n(1−p^)≥5n(1-\hat{p})\ge 5 → interval for a proportion, with zz

    Example: 8585 infested ash trees out of 250250: 0.34±1.96×0.03000.34\pm 1.96\times 0.0300

  • If you measure a quantity (a mean) and n≥30n\ge 30 → x‾±zsn\overline{x}\pm z\frac{s}{\sqrt{n}}, ss in place of σ\sigma

    Example: 3636 days of ozone: 45.9±1.96×10.9645.9\pm 1.96\times\frac{10.9}{6}

  • If a mean, n<30n<30, σ\sigma unknown, and a graph of the data with no strong skewness and no outlier → Student's t distribution with n−1n-1 degrees of freedom

    Example: 1212 maple tapholes: 2.30±2.201×0.316122.30\pm 2.201\times\frac{0.316}{\sqrt{12}}

  • If a mean, n<30n<30, and very skewed data or an outlier → no method of the course applies: say so, and enlarge the sample

    transforming the variable or using a nonparametric method goes beyond the course description

If σ\sigma is truly known (rare: calibrated instrument, entire population already measured), keep zz with σ\sigma, even on a small sample from a normal population.

Which sample size?

Look at what you want to estimate and at what you already know.

  • If a mean, with a standard deviation that is known or estimated by a pilot study → n≥(zσE)2n\ge\left(\frac{z\sigma}{E}\right)^{2}, rounded up

    Example: σ=12.5\sigma=12.5 mm, E=2E=2 mm: n≥150.06n\ge 150.06, so n=151n=151

  • If a proportion, with no information at all → p=0.5p=0.5, the worst case, because p(1−p)≤14p(1-p)\le\frac{1}{4}

    Example: E=0.05E=0.05: n≥384.16n\ge 384.16, so n=385n=385

  • If a proportion, with a reliable earlier estimate p0p_{0} → n≥z2p0(1−p0)E2n\ge\frac{z^{2}p_{0}(1-p_{0})}{E^{2}}, rounded up

    Example: p0=0.2p_{0}=0.2, E=0.05E=0.05: n=246n=246

The size of the population does not enter the calculation as long as the sample remains a small fraction of it.

How the answer is expected to be written

A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.

Writing up a complete confidence interval

When to use it: “Estimate with a confidence interval”, “build the 95% interval”, “what can be said about the mean?”

  1. 1 Name the parameter in context: “μ\mu, the mean mercury content of the adult walleyes in the lake”.
  2. 2 Choose the case and check its conditions with one sentence each: random sample, independence, n≥30n\ge 30 (or plausible normality, or np^≥5n\hat{p}\ge 5 and n(1−p^)≥5n(1-\hat{p})\ge 5).
  3. 3 Write the standard error alone, on its own line: sn\frac{s}{\sqrt{n}} or p^(1−p^)n\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}.
  4. 4 Write the critical value with its source: z0.025=1.96z_{0.025}=1.96, or t0.025,n−1t_{0.025, n-1} read in the table.
  5. 5 Compute the margin, then the two bounds, rounded to the precision of the data.
  6. 6 Conclude with the standard sentence, in the units and the vocabulary of the problem.

Concluding sentence

“At the 95% confidence level, the mean mercury content of the adult walleyes in the lake lies between 0.40 and 0.52 mg/kg.”

The trap: Skipping the conditions: without them, the 95% is not justified, and the grader takes off the mark even if the bounds are right.

Marking: Usually: conditions 1 mark, standard error and critical value 1 mark, bounds 1 mark, concluding sentence 1 mark.

Check before you hand in

Five minutes of checking recover more marks than one more problem started in a hurry.

  • The centre is the point estimate

    Average the two bounds: you should get x‾\overline{x} or p^\hat{p} back. Half the difference is the margin.

    [42.3,49.5][42.3, 49.5] has centre 45.9=x‾45.9=\overline{x}: a good sign. A centre at 46.546.5 reveals a badly copied bound.

  • The standard error is much smaller than s

    Compare the standard error with ss: their ratio should be n\sqrt{n}, so 66 for n=36n=36, 1010 for n=100n=100.

    s=10.9s=10.9 and a “standard error” of 10.910.9: you forgot to divide by 36=6\sqrt{36}=6, the margin is six times too large.

  • The widths come in the right order

    With the same data: 90% interval narrower than 95%, narrower than 99%; and Student interval wider than the one with zz.

    A 99% interval narrower than the 95% one signals swapped critical values (1.961.96 and 2.5762.576 exchanged).

  • A proportion stays between 0 and 1, a size is a whole number rounded up

    Reread the bounds of a proportion and substitute the size found back into the margin formula.

    n=150n=150 gives back a margin of 2.0004>22.0004>2: 151151 was needed.

The typical problem, taken apart

Ten ragweed pollen grains: a Student interval from start to finish

An allergen monitoring station weighs ten ragweed pollen grains taken at random from its samplers. Masses, in nanograms: 5.65.6, 4.84.8, 5.15.1, 6.06.0, 5.35.3, 4.64.6, 5.55.5, 5.05.0, 5.85.8, 5.35.3.

Estimate the mean mass μ\mu of the grains with a 95% confidence interval. You are given t0.025,9=2.262t_{0.025, 9}=2.262.

4.44.64.855.25.45.65.866.2mass (ng)
The ten masses spread from 4.64.6 to 6.06.0 ng with no isolated value and no strong skewness: the assumption of a normal population is plausible.

Step 1

x‾=53.010=5.30\overline{x}=\dfrac{53.0}{10}=5.30 ng; sum of squared deviations 1.741.74, so s=1.749≈0.440s=\sqrt{\dfrac{1.74}{9}}\approx 0.440 ng.

Why

Divide by n−1=9n-1=9: ss estimates the standard deviation of the population, and dividing by 1010 would underestimate it.

Step 2

Parameter: μ\mu, mean mass of the ragweed pollen grains collected. Case: mean, n=10<30n=10<30, σ\sigma unknown.

Why

Naming the case BEFORE computing chooses the critical value; it is the mark students lose most often.

Step 3

Conditions: grains taken at random; the figure shows no strong skewness and no outlier, the population is assumed normal.

Why

Below 30 observations, the central limit theorem is not enough: it is the assumed normality that justifies Student's t distribution.

Step 4

Standard error: 0.44010≈0.139\dfrac{0.440}{\sqrt{10}}\approx 0.139 ng; critical value t0.025,9=2.262t_{0.025, 9}=2.262; margin 2.262×0.139≈0.3152.262\times 0.139\approx 0.315 ng.

Why

Setting the standard error down alone prevents forgetting the square root; the tt with 99 degrees of freedom, larger than 1.961.96, pays for the uncertainty in ss.

Step 5

[5.30−0.315,5.30+0.315]≈[4.99,5.61][5.30-0.315, 5.30+0.315]\approx[4.99, 5.61] ng

Why

The bounds are rounded to the hundredth, one digit more than the data.

Step 6

Check: centre 4.99+5.612=5.30=x‾\frac{4.99+5.61}{2}=5.30=\overline{x}; with 1.961.96 we would get ±0.27\pm 0.27, narrower, as expected.

Why

Two checks in ten seconds: the symmetry about the estimate and the order of the widths between tt and zz.

The conclusion, written out

“At the 95% confidence level, the mean mass of the ragweed pollen grains collected by the station lies between 4.99 and 5.61 ng.”

The classic mistake on this problem: Taking 1.961.96 because the formula “looks like” the one for a large sample: the interval obtained, [5.03,5.57][5.03, 5.57], is too narrow and does not deserve its 95%.

Learn by heart

  • • Standard error of a mean: σn\dfrac{\sigma}{\sqrt{n}}, estimated by sn\dfrac{s}{\sqrt{n}}; of a proportion: p(1−p)n\sqrt{\dfrac{p(1-p)}{n}}.
  • • z0.05=1.645z_{0.05}=1.645 (90%), z0.025=1.96z_{0.025}=1.96 (95%), z0.005=2.576z_{0.005}=2.576 (99%).
  • • Mean, n<30n<30: Student with n−1n-1 degrees of freedom, population assumed NORMAL; t>zt>z always.
  • • Proportion: n≥30n\ge 30, np^≥5n\hat{p}\ge 5 and n(1−p^)≥5n(1-\hat{p})\ge 5.
  • • Size: n≥(zσE)2n\ge\left(\frac{z\sigma}{E}\right)^{2} or z2p(1−p)E2\frac{z^{2}p(1-p)}{E^{2}}, p=0.5p=0.5 with no information, ALWAYS rounded up.
  • • Margin divided by 22: nn multiplied by 44.
  • • 95% describes the METHOD: μ\mu is fixed, the interval varies.

Frequently asked questions

When should Student's t distribution be used instead of the normal distribution for a confidence interval?

To estimate a mean when the standard deviation of the population is unknown and the sample has fewer than 30 observations. The population is then assumed normal, which is checked on a graph of the data, and the critical value is read in the Student table with n minus 1 degrees of freedom. With 30 observations or more, the course convention keeps the critical value of the normal distribution, 1.96 at 95 percent.

What does a 95% confidence interval mean?

That the method used produces, in 95 percent of possible samples, an interval that contains the true value of the parameter. The population mean is a fixed number: an interval already computed contains it or does not. So we write “at the 95 percent confidence level, the mean lies between...”, and not “there is a 95 percent chance that the mean is in the interval”.

How do you compute the sample size for a given margin of error?

For a mean, divide the product of the critical value and the standard deviation by the target margin, and square the result. For a proportion, multiply the square of the critical value by p times 1 minus p, then divide by the square of the margin, with p equal to 0.5 if nothing is known. In both cases, always round up to the next whole number, otherwise the target margin is not met.

Does the central limit theorem make the data normal when n exceeds 30?

No. It says that the mean of a sample of independent observations approximately follows a normal distribution when the sample is large enough, whatever the shape of the population. The data themselves keep their distribution: skewed contents stay skewed with 1,000 measurements. That is why a large sample allows the interval for the mean even with non-normal data.

Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.

Practise it

Corrected exercises: Confidence intervals: mean, Student's t and proportion, 201-SN1-RE

A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.

  • 11 corrected exercises
  • 110 points
  • 150 minutes
Do the exercises
Something missing from this sheet? A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.

Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space. Rather not create an account? Write to me directly.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

This chapter comes back in

The chapters that build on it, later in the year or in the years that follow.

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-sn1-confidence-intervals. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

Looking for a 201-SN1-RE tutor in Montreal?

Get in touch for a first session. A confidence interval is won on three decisions, the case, the standard error and the concluding sentence: we work on them with your own exercises.

Site by Studio Squalli