Steply

Test p1 > p2: 90 of 300 and 60 of 300, alpha 0.01

Step by step, with the reason for every step · Comparing two groups · University Statistics

Step by step

The question

Question: in group 1, 90 of 300 say yes, and in group 2, 60 of 300: at the 1% level, is the first proportion more than the second?

p1 > p2? 90 of 300, 60 of 300, α = 0.01

1 Write the hypotheses

H₀ is the "nothing new" idea: it has the equal sign.

Here: the two proportions are the same, so the difference is 0.

H0 : p1 = p2

Hₐ is what we want to show.

Here: the first proportion is more than the second.

Ha : p1 > p2

More than: one tail, the right end.

one tail: the right end

2 The two parts

Group 1: 90/300 is 0.3.

p′1 = 90300 = 0.3

Group 2: 60/300 is 0.2.

p′2 = 60300 = 0.2

3 Pool the groups

If H zero is true, the two groups are the same.

So we put them together: the pooled proportion.

if H0 is true, the groups are the same: put them together

All the yeses over everyone: 150/600 is 0.25.

pc = 90 + 60300 + 300 = 150600 = 0.25

Careful!

We pool the counts, not the two proportions.

Careful: pool the counts: (x₁ + x₂) ÷ (n₁ + n₂)

And q c is 1 minus 0.25: 0.75.

qc = 1 − 0.25 = 0.75

4 Standard error

The standard error, the SD of the difference: the square root of p c times q c, times 1/n 1 plus 1/n 2.

SE = √pc × qc × (1n1 + 1n2)

0.25 times 0.75 is 0.1875.

1/300 plus 1/300 is 0.0067.

Multiply, then the square root: about 0.0354.

SE = √0.25 × 0.75 × (1300 + 1300) ≈ 0.0354

5 The test number

z is the difference over the SE.

0.3 minus 0.2 is 0.1.

Divided by 0.0354: about 2.83.

z = p′1 − p′2SE = 0.3 − 0.20.0354 ≈ 2.83

6 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 in the middle, our sample at z = 2.83.

We shade the right end, from our z up.

The z-table gives the area to the left of z.

Row 2.8, column .03.

For z = 2.83: the row 2.8 and the column .03 meet at 0.9977.

The right end is 1 minus 0.9977: 0.0023.

p-value = 1 − 0.9977 = 0.0023

7 Decide

The p-value, 0.0023, is less than alpha, 0.01.

Our sample would be rare if H zero were true.

So we reject H zero.

= p-value 0.0023 < α = 0.01 → reject H0

8 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 first proportion is more than the second.

the first proportion is more than the second.

9 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.83: past the cut-off.

The same decision.

So it is right!

z = 2.83 > 2.326: past the cut-off, reject

Let's look back.

First: write the hypotheses.

Then: the two parts.

Then: pool the groups.

Then: standard error.

Then: the test number.

Then: the p-value.

Then: decide.

Then: say it in words.

Last: check.

Answer
= p-value 0.0023 < α = 0.01 → reject H0

Your turn

Try this one yourself, then check:

Test p1 > p2? 200 of 400, 160 of 400, α = 0.01
Show the answer
reject H0

More from Comparing two groups

The whole lesson: Comparing two groups →