Steply

Test p1 != p2: 45 of 150 and 60 of 150, alpha 0.10

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

Step by step

The question

Question: in group 1, 45 of 150 say yes, and in group 2, 60 of 150: at the 10% level, is the first proportion different from the second?

p1 ≠ p2? 45 of 150, 60 of 150, α = 0.1

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 different from the second.

Ha : p1 ≠ p2

Different from: two tails.

two tails

2 The two parts

Group 1: 45/150 is 0.3.

p′1 = 45150 = 0.3

Group 2: 60/150 is 0.4.

p′2 = 60150 = 0.4

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: 105/300 is 0.35.

pc = 45 + 60150 + 150 = 105300 = 0.35

Careful!

We pool the counts, not the two proportions.

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

And q c is 1 minus 0.35: 0.65.

qc = 1 − 0.35 = 0.65

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.35 times 0.65 is 0.2275.

1/150 plus 1/150 is 0.0133.

Multiply, then the square root: about 0.0551.

SE = √0.35 × 0.65 × (1150 + 1150) ≈ 0.0551

5 The test number

z is the difference over the SE.

0.3 minus 0.4 is −0.1.

Divided by 0.0551: about −1.82.

z = p′1 − p′2SE = 0.3 − 0.40.0551 ≈ −1.82

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.82.

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.8, column .02.

For z = −1.82: the row −1.8 and the column .02 meet at 0.0344.

One end is 0.0344.

Two ends: 2 times that is 0.0688.

p-value = 2 × 0.0344 = 0.0688

7 Decide

The p-value, 0.0688, is less than alpha, 0.1.

Our sample would be rare if H zero were true.

So we reject H zero.

= p-value 0.0688 < α = 0.1 → reject H0

8 Say it in words

At the 10% level, there is enough evidence that

In words: at the 10% level, there is enough evidence that the first proportion is different from the second.

the first proportion is different from the second.

9 Check

Let's check the other way, with the cut-off.

0.1 split into two ends gives the cut-offs plus and minus 1.645.

0.1 in two ends: cut-offs ±1.645

z is −1.82: past the cut-off.

The same decision.

So it is right!

z = |−1.82| > 1.645: 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.0688 < α = 0.1 → reject H0

Your turn

Try this one yourself, then check:

Test p1 ≠ p2? 100 of 200, 80 of 200, α = 0.1
Show the answer
reject H0

More from Comparing two groups

The whole lesson: Comparing two groups →