Steply

Test p1 > p2: 58 of 160 and 40 of 140, alpha 0.05

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

Step by step

The question

Question: in group 1, 58 of 160 say yes, and in group 2, 40 of 140: at the 5% level, is the first proportion more than the second?

p1 > p2? 58 of 160, 40 of 140, α = 0.05

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: 58/160 is 0.3625.

p′1 = 58160 = 0.3625

Group 2: 40/140 is 0.2857.

p′2 = 40140 = 0.2857

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: 98/300 is 0.3267.

pc = 58 + 40160 + 140 = 98300 = 0.3267

Careful!

We pool the counts, not the two proportions.

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

And q c is 1 minus 0.3267: 0.6733.

qc = 1 − 0.3267 = 0.6733

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.3267 times 0.6733 is 0.22.

1/160 plus 1/140 is 0.0134.

Multiply, then the square root: about 0.0543.

SE = √0.3267 × 0.6733 × (1160 + 1140) ≈ 0.0543

5 The test number

z is the difference over the SE.

0.3625 minus 0.2857 is 0.0768.

Divided by 0.0543: about 1.41.

z = p′1 − p′2SE = 0.3625 − 0.28570.0543 ≈ 1.41

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 = 1.41.

We shade the right end, from our z up.

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

Row 1.4, column .01.

For z = 1.41: the row 1.4 and the column .01 meet at 0.9207.

The right end is 1 minus 0.9207: 0.0793.

p-value = 1 − 0.9207 = 0.0793

7 Decide

The p-value, 0.0793, is more than alpha, 0.05.

Our sample is not rare enough.

So we do not reject H zero.

= p-value 0.0793 > α = 0.05 → do not reject H0

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

the first proportion is more than the second.

This does not prove H zero is true.

We just cannot rule it out.

not rejecting H0 does not prove H0

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

The same decision.

So it is right!

z = 1.41 < 1.645: not past it, do not 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.0793 > α = 0.05 → do not reject H0

Your turn

Try this one yourself, then check:

Test p1 > p2? 90 of 200, 80 of 200, α = 0.05
Show the answer
do not reject H0

More from Comparing two groups

The whole lesson: Comparing two groups →