Z Test Proportions
Z Test Proportions
Hypothesis Testing α
0 z
α/2
α/2 The z-test for Proportions
1
The Test Statistic The Test Statistic
pˆ − p0 pˆ − p0 pˆ − p0 pˆ − p0
z= = z= =
σ pˆ p0 (1 − p0 ) σ pˆ p0 (1 − p0 )
n n
α/2
α/2
α
− zα / 2 0 zα / 2 z
Reject H0 Reject H0
Accept H0
0 zα z
Accept H0 Reject H0
H 0 : p ≤ p0 H 0 : p ≥ p0
H A : p > p0 H A : p < p0
2
The Test Statistic • If you are trying to prove a difference
pˆ − p0 pˆ − p0 H A : p ≠ p0
z= =
σ pˆ p0 (1 − p0 )
n • This is the alternative Hypothesis (HA)
- the Research Hypothesis
α H A : p > p0
Comments
• If you are trying to prove the true value p
• The alternative Hypothesis (HA) is does not exceed the hypothesized value p0
what the experiment is trying to
prove - the Research Hypothesis
• The alternative Hypothesis (HA) will
H A : p < p0
determine if you use a one-tailed test
or a two tailed test • This is the alternative Hypothesis (HA)
- the Research Hypothesis
3
• If you are trying to prove a difference • If you were interested in proving that the
new procedure is not an improvement:
• Then
H A : p ≠ p0
H A : p < p0
• This is the alternative Hypothesis (HA)
- the Research Hypothesis
Example
• A new surgical procedure is developed for • If you were interested in proving only a
correcting heart defects infants before the difference between the new and the old:
age of one month.
• Then
• Previously the procedure was used on
infants that were older than one month and
the success rate was 91%
H A : p ≠ p0
• A study is conducted to determine if the
success rate of the new procedure is greater
than 91% (n = 200)
Comments
• Different objectives will result in different We want to test
choices of the alternative hypothesis – H0: p ≤ 0.91 (91%)
• If you were interested in Proving that the
new procedure is an improvement: Against
• Then – HA: p > 0.91 (91%)
4
Performing the Test Comments
1. Decide on α = P[Type I Error] = the • When the decision is made to accept H0 is
significance level of the test made it should not be conclude that we have
Choose (α = 0.05) proven H0.
2. Collect the data • This is because when setting up the test we
• The number of successful operations in the have not controlled β = P[type II error] =
sample of 200 cases is x = 187 P[accepting H0 when H0 is FALSE]
• Whenever H0 is accepted there is a
x 187
pˆ = = = 0.935 (93.5%) possibility that a type II error has been
n 200 made.
5
The null hypothesis (H0) – the accused is Hence: When decision of innocence is made:
innocent – It is not concluded that innocence has
been proven
The alternative hypothesis (HA) – the accused
is guilty
but that
– we have been unable to disprove
innocence
6
The Data The Acceptance region:
∑x i
x= i =1
= the sample mean
n
− zα / 2 0
zα / 2 z
• we want to test if the mean, µ, is equal to some Reject H0 Reject H0
given value µ0. Accept H0
• Obviously if the sample mean is close to µ0 the P[Accept H 0 when true] = P[− zα / 2 ≤ z ≤ zα / 2 ] = 1 − α
Null Hypothesis should be accepted otherwise the
null Hypothesis should be rejected. P[Reject H 0 when true] = P[z < − zα / 2 or z > zα / 2 ] = α
x − µ0 x − µ0 x − µ0 x − µ0 • Critical Region
z= = = n ≈ n
σx σ σ s – Reject H0 if: z < − zα / 2 or z > zα / 2
n
• If H0 is true we should expect the test statistic z to
be close to zero. • With this Choice
• If H0 is true we should expect the test statistic z to P[Type I Error ] = P[Reject H 0 when true]
have a standard normal distribution.
• If HA is true we should expect the test statistic z to = P[z < − zα / 2 or z > zα / 2 ] = α
be different from zero.
7
The one tailed test – other direction
2. Collect the data To test
H0: µ ≥ µ0 (some specified value of µ)
3. Compute the test statistic
against
x − µ0 x − µ0 HA: µ < µ0
z= n ≈ n
σ s Acceptance and Critical Region
4. Make the Decision • Accept H0 if: z ≥ − zα / 2
• Accept H0 if: − zα / 2 ≤ z ≤ zα / 2 • Reject H0 if: z < − zα / 2
• Reject H0 if: z < − zα / 2 or z > zα / 2
x − µ0 x − µ0
The one tailed test Test Statistic z= n ≈ n
σ s
To test
H0: µ ≤ µ0 (some specified value of µ) Expect z to be negative if H0 is false
HA: µ > µ0
x − µ0 x − µ0
z= n ≈ n Reject H0 Accept H0
σ s
− zα 0 z
0 zα z
8
Test Statistic
x − µ0 x − µ0
z= n ≈ n
σ s
12.1 − 10.0
= 40 = 11.07
1.2