Worked examples
The question
Question: in a sample of 400, 120 say yes: find the 95% confidence interval for the true proportion.
95% interval for p: 120 of 400 say yes
1 Name the numbers
p prime is the part of the sample that says yes: x divided by n.
p′ = the part of the sample: x ÷ n
120 divided by 400 is 0.3.
p′ = 120400 = 0.3
q prime is the rest: 1 minus 0.3 is 0.7.
q′ = 1 − 0.3 = 0.7
Careful!
p prime is the fraction 0.3, not the count 120.
Careful: p′ is a part of 1: 120 ÷ 400, not 120
Both counts, 120 and 280, are at least 5.
So the normal bell works here.
n × p′ = 120, n × q′ = 280: both at least 5
2 Find z*
95 percent of the bell is in the middle.
That leaves 5 percent: 2.5 percent in each end.
95% in the middle: 5% left over, 2.5% in each end
z* marks the cut between the middle and the ends.
Left of z* are the middle and one end: 0.95 plus 0.025 is 0.9750.
left of z* = 0.95 + 0.025 = 0.9750
Now we look for 0.9750 inside the table.
0.9750 is in the table: row 1.9, column .06.
So z = 1.96.
z* = 1.96
3 Error bound
The error bound for a proportion: z* times the square root of p prime times q prime over n.
EBP = z* × √p′ q′n
0.3 times 0.7 is 0.21.
Divided by 400: 0.000525.
p′ q′n = 0.3 × 0.7400 = 0.21400 = 0.000525
The square root of that is about 0.0229.
√p′ q′n = √0.000525 ≈ 0.0229
Times 1.96: about 0.0449.
EBP = 1.96 × 0.0229 ≈ 0.0449
4 The interval
Take the error bound away from the middle: 0.3 minus 0.0449 is 0.2551.
= p′ − EBP = 0.3 − 0.0449 = 0.2551
And add it: 0.3 plus 0.0449 is 0.3449.
= p′ + EBP = 0.3 + 0.0449 = 0.3449
The 95 percent confidence interval is (0.2551, 0.3449).
= (0.2551, 0.3449)
5 Say it in words
In words: we are 95 percent confident that the true proportion is between 25.51% and 34.49%.
95% confident: between 25.51% and 34.49%
6 Check
Let's check: the middle of the interval should be 0.3.
0.2551 plus 0.3449, divided by 2, is 0.3.
middle: (0.2551 + 0.3449) ÷ 2 = 0.3
Half the width should be the error bound: 0.3449 minus 0.2551, divided by 2, is 0.0449.
So it is right!
half the width: (0.3449 − 0.2551) ÷ 2 = 0.0449
Let's look back.
First: name the numbers.
Then: find z*.
Then: error bound.
Then: the interval.
Then: say it in words.
Last: check.
Answer = (0.2551, 0.3449)
▶ Watch it solved
The question
Question: in a sample of 200, 84 say yes: find the 95% confidence interval for the true proportion.
95% interval for p: 84 of 200 say yes
1 Name the numbers
p prime is the part of the sample that says yes: x divided by n.
p′ = the part of the sample: x ÷ n
84 divided by 200 is 0.42.
p′ = 84200 = 0.42
q prime is the rest: 1 minus 0.42 is 0.58.
q′ = 1 − 0.42 = 0.58
Careful!
p prime is the fraction 0.42, not the count 84.
Careful: p′ is a part of 1: 84 ÷ 200, not 84
Both counts, 84 and 116, are at least 5.
So the normal bell works here.
n × p′ = 84, n × q′ = 116: both at least 5
2 Find z*
95 percent of the bell is in the middle.
That leaves 5 percent: 2.5 percent in each end.
95% in the middle: 5% left over, 2.5% in each end
z* marks the cut between the middle and the ends.
Left of z* are the middle and one end: 0.95 plus 0.025 is 0.9750.
left of z* = 0.95 + 0.025 = 0.9750
Now we look for 0.9750 inside the table.
0.9750 is in the table: row 1.9, column .06.
So z = 1.96.
z* = 1.96
3 Error bound
The error bound for a proportion: z* times the square root of p prime times q prime over n.
EBP = z* × √p′ q′n
0.42 times 0.58 is 0.2436.
Divided by 200: 0.001218.
p′ q′n = 0.42 × 0.58200 = 0.2436200 = 0.001218
The square root of that is about 0.0349.
√p′ q′n = √0.001218 ≈ 0.0349
Times 1.96: about 0.0684.
EBP = 1.96 × 0.0349 ≈ 0.0684
4 The interval
Take the error bound away from the middle: 0.42 minus 0.0684 is 0.3516.
= p′ − EBP = 0.42 − 0.0684 = 0.3516
And add it: 0.42 plus 0.0684 is 0.4884.
= p′ + EBP = 0.42 + 0.0684 = 0.4884
The 95 percent confidence interval is (0.3516, 0.4884).
= (0.3516, 0.4884)
5 Say it in words
In words: we are 95 percent confident that the true proportion is between 35.16% and 48.84%.
95% confident: between 35.16% and 48.84%
6 Check
Let's check: the middle of the interval should be 0.42.
0.3516 plus 0.4884, divided by 2, is 0.42.
middle: (0.3516 + 0.4884) ÷ 2 = 0.42
Half the width should be the error bound: 0.4884 minus 0.3516, divided by 2, is 0.0684.
So it is right!
half the width: (0.4884 − 0.3516) ÷ 2 = 0.0684
Let's look back.
First: name the numbers.
Then: find z*.
Then: error bound.
Then: the interval.
Then: say it in words.
Last: check.
Answer = (0.3516, 0.4884)
▶ Watch it solved
The question
Question: in a sample of 1000, 642 want more parks: find the 95% confidence interval for the true proportion.
95% interval for p: 642 of 1000 want more parks
1 Name the numbers
p prime is the part of the sample that says yes: x divided by n.
p′ = the part of the sample: x ÷ n
642 divided by 1000 is 0.642.
p′ = 6421000 = 0.642
q prime is the rest: 1 minus 0.642 is 0.358.
q′ = 1 − 0.642 = 0.358
Careful!
p prime is the fraction 0.642, not the count 642.
Careful: p′ is a part of 1: 642 ÷ 1000, not 642
Both counts, 642 and 358, are at least 5.
So the normal bell works here.
n × p′ = 642, n × q′ = 358: both at least 5
2 Find z*
95 percent of the bell is in the middle.
That leaves 5 percent: 2.5 percent in each end.
95% in the middle: 5% left over, 2.5% in each end
z* marks the cut between the middle and the ends.
Left of z* are the middle and one end: 0.95 plus 0.025 is 0.9750.
left of z* = 0.95 + 0.025 = 0.9750
Now we look for 0.9750 inside the table.
0.9750 is in the table: row 1.9, column .06.
So z = 1.96.
z* = 1.96
3 Error bound
The error bound for a proportion: z* times the square root of p prime times q prime over n.
EBP = z* × √p′ q′n
0.642 times 0.358 is 0.2298.
Divided by 1000: about 0.00022984.
p′ q′n = 0.642 × 0.3581000 = 0.22981000 ≈ 0.00022984
The square root of that is about 0.0152.
√p′ q′n = √0.00022984 ≈ 0.0152
Times 1.96: about 0.0297.
EBP = 1.96 × 0.0152 ≈ 0.0297
4 The interval
Take the error bound away from the middle: 0.642 minus 0.0297 is 0.6123.
= p′ − EBP = 0.642 − 0.0297 = 0.6123
And add it: 0.642 plus 0.0297 is 0.6717.
= p′ + EBP = 0.642 + 0.0297 = 0.6717
The 95 percent confidence interval is (0.6123, 0.6717).
= (0.6123, 0.6717)
5 Say it in words
In words: we are 95 percent confident that the true proportion is between 61.23% and 67.17%.
95% confident: between 61.23% and 67.17%
6 Check
Let's check: the middle of the interval should be 0.642.
0.6123 plus 0.6717, divided by 2, is 0.642.
middle: (0.6123 + 0.6717) ÷ 2 = 0.642
Half the width should be the error bound: 0.6717 minus 0.6123, divided by 2, is 0.0297.
So it is right!
half the width: (0.6717 − 0.6123) ÷ 2 = 0.0297
Let's look back.
First: name the numbers.
Then: find z*.
Then: error bound.
Then: the interval.
Then: say it in words.
Last: check.
Answer = (0.6123, 0.6717)
▶ Watch it solved