Worked examples
The question
Question: in a sample of 500, 270 say yes: at the 5% level, is the true proportion more than 0.5?
p > 0.5? 270 of 500 say yes, α = 0.05
1 Write the hypotheses
H₀ is the "nothing new" idea: it has the equal sign.
Here: the proportion is 0.5.
H0 : p = 0.5
Hₐ is what we want to show.
Here: the proportion is more than 0.5.
Ha : p > 0.5
More than means only the right end counts.
One tail.
one tail: the right end
2 Big enough for the bell
The bell works if both counts are at least 5.
500 times 0.5 is 250.
500 times 0.5 is 250.
Both are big enough.
= n × p0 = 500 × 0.5 = 250, n × q0 = 500 × 0.5 = 250
3 The test number
p prime, the sample's part: 270 divided by 500 is 0.54.
p′ = 270500 = 0.54
The SD uses p zero from H zero: 0.5 times 0.5, over 500, then the square root.
About 0.0224.
SD = √p0 q0n = √0.5 × 0.5500 ≈ 0.0224
Careful!
We act as if H zero is true.
So the SD uses 0.5, not 0.54.
Careful: in the SD: p0 = 0.5, not p′ = 0.54
z is p prime minus p zero, over the SD.
0.54 minus 0.5 is 0.04.
Divided by 0.0224: about 1.79.
z = p′ − p0SD = 0.54 − 0.50.0224 ≈ 1.79
4 The p-value
The p-value is the chance of getting a sample this far out, if H zero is true.
p-value: the chance of a sample this far out, if H0 is true
On the bell of H zero: 0.5 in the middle, our sample at z = 1.79.
We shade the right end, from our z up.
The z-table gives the area to the left of z.
Row 1.7, column .09.
For z = 1.79: the row 1.7 and the column .09 meet at 0.9633.
The right end is 1 minus 0.9633: 0.0367.
p-value = 1 − 0.9633 = 0.0367
5 Decide
The p-value, 0.0367, is less than alpha, 0.05.
Our sample would be rare if H zero were true.
So we reject H zero.
= p-value 0.0367 < α = 0.05 → reject H0
6 Say it in words
At the 5% level, there is enough evidence that
In words: at the 5% level, there is enough evidence that the proportion is more than 0.5.
the proportion is more than 0.5.
7 Check
Let's check the other way, with the cut-off.
0.05 in the right end gives the cut-off 1.645.
0.05 in one end: cut-off 1.645
z is 1.79: past the cut-off.
The same decision.
So it is right!
z = 1.79 > 1.645: past the cut-off, reject
Let's look back.
First: write the hypotheses.
Then: big enough for the bell.
Then: the test number.
Then: the p-value.
Then: decide.
Then: say it in words.
Last: check.
Answer = p-value 0.0367 < α = 0.05 → reject H0
▶ Watch it solved
The question
Question: in a sample of 200, 90 agree: at the 5% level, is the true proportion different from 0.4?
p ≠ 0.4? 90 of 200 agree, α = 0.05
1 Write the hypotheses
H₀ is the "nothing new" idea: it has the equal sign.
Here: the proportion is 0.4.
H0 : p = 0.4
Hₐ is what we want to show.
Here: the proportion is different from 0.4.
Ha : p ≠ 0.4
Different from means too big or too small: both ends of the bell count.
Two tails.
two tails: far on either side counts
2 Big enough for the bell
The bell works if both counts are at least 5.
200 times 0.4 is 80.
200 times 0.6 is 120.
Both are big enough.
= n × p0 = 200 × 0.4 = 80, n × q0 = 200 × 0.6 = 120
3 The test number
p prime, the sample's part: 90 divided by 200 is 0.45.
p′ = 90200 = 0.45
The SD uses p zero from H zero: 0.4 times 0.6, over 200, then the square root.
About 0.0346.
SD = √p0 q0n = √0.4 × 0.6200 ≈ 0.0346
Careful!
We act as if H zero is true.
So the SD uses 0.4, not 0.45.
Careful: in the SD: p0 = 0.4, not p′ = 0.45
z is p prime minus p zero, over the SD.
0.45 minus 0.4 is 0.05.
Divided by 0.0346: about 1.44.
z = p′ − p0SD = 0.45 − 0.40.0346 ≈ 1.44
4 The p-value
The p-value is the chance of getting a sample this far out, if H zero is true.
p-value: the chance of a sample this far out, if H0 is true
On the bell of H zero: 0.4 in the middle, our sample at z = 1.44.
Two tails: we shade both ends, as far out as our sample or more.
The z-table gives the area to the left of z.
Row 1.4, column .04.
For z = 1.44: the row 1.4 and the column .04 meet at 0.9251.
One end is 1 minus 0.9251: 0.0749.
Two ends: 2 times that is 0.1498.
p-value = 2 × (1 − 0.9251) = 2 × 0.0749 = 0.1498
5 Decide
The p-value, 0.1498, is more than alpha, 0.05.
Our sample is not rare enough.
So we do not reject H zero.
= p-value 0.1498 > α = 0.05 → do not reject H0
6 Say it in words
At the 5% level, there is not enough evidence that
In words: at the 5% level, there is not enough evidence that the proportion is different from 0.4.
the proportion is different from 0.4.
This does not prove H zero is true.
We just cannot rule it out.
not rejecting H0 does not prove H0
7 Check
Let's check the other way, with the cut-off.
0.05 split into two ends gives the cut-offs plus and minus 1.96.
0.05 in two ends: cut-offs ±1.96
z is 1.44: not past the cut-off.
The same decision.
So it is right!
z = |1.44| < 1.96: not past it, do not reject
Let's look back.
First: write the hypotheses.
Then: big enough for the bell.
Then: the test number.
Then: the p-value.
Then: decide.
Then: say it in words.
Last: check.
Answer = p-value 0.1498 > α = 0.05 → do not reject H0
▶ Watch it solved
The question
Question: in a sample of 500, 400 recommend it: at the 1% level, is the true proportion more than 0.75?
p > 0.75? 400 of 500 recommend it, α = 0.01
1 Write the hypotheses
H₀ is the "nothing new" idea: it has the equal sign.
Here: the proportion is 0.75.
H0 : p = 0.75
Hₐ is what we want to show.
Here: the proportion is more than 0.75.
Ha : p > 0.75
More than means only the right end counts.
One tail.
one tail: the right end
2 Big enough for the bell
The bell works if both counts are at least 5.
500 times 0.75 is 375.
500 times 0.25 is 125.
Both are big enough.
= n × p0 = 500 × 0.75 = 375, n × q0 = 500 × 0.25 = 125
3 The test number
p prime, the sample's part: 400 divided by 500 is 0.8.
p′ = 400500 = 0.8
The SD uses p zero from H zero: 0.75 times 0.25, over 500, then the square root.
About 0.0194.
SD = √p0 q0n = √0.75 × 0.25500 ≈ 0.0194
Careful!
We act as if H zero is true.
So the SD uses 0.75, not 0.8.
Careful: in the SD: p0 = 0.75, not p′ = 0.8
z is p prime minus p zero, over the SD.
0.8 minus 0.75 is 0.05.
Divided by 0.0194: about 2.58.
z = p′ − p0SD = 0.8 − 0.750.0194 ≈ 2.58
4 The p-value
The p-value is the chance of getting a sample this far out, if H zero is true.
p-value: the chance of a sample this far out, if H0 is true
On the bell of H zero: 0.75 in the middle, our sample at z = 2.58.
We shade the right end, from our z up.
The z-table gives the area to the left of z.
Row 2.5, column .08.
For z = 2.58: the row 2.5 and the column .08 meet at 0.9951.
The right end is 1 minus 0.9951: 0.0049.
p-value = 1 − 0.9951 = 0.0049
5 Decide
The p-value, 0.0049, is less than alpha, 0.01.
Our sample would be rare if H zero were true.
So we reject H zero.
= p-value 0.0049 < α = 0.01 → reject H0
6 Say it in words
At the 1% level, there is enough evidence that
In words: at the 1% level, there is enough evidence that the proportion is more than 0.75.
the proportion is more than 0.75.
7 Check
Let's check the other way, with the cut-off.
0.01 in the right end gives the cut-off 2.326.
0.01 in one end: cut-off 2.326
z is 2.58: past the cut-off.
The same decision.
So it is right!
z = 2.58 > 2.326: past the cut-off, reject
Let's look back.
First: write the hypotheses.
Then: big enough for the bell.
Then: the test number.
Then: the p-value.
Then: decide.
Then: say it in words.
Last: check.
Answer = p-value 0.0049 < α = 0.01 → reject H0
▶ Watch it solved