A one tailed Test

Hypothesis Testing a

0 z

Acceptance Critical Region Region

To perform a statistical Test we To define a statistical Test we 1. Collect the data. 1. Choose a (called the test statistic) 2. Compute the value of the test statistic. 2. Divide the of possible values for the 3. Make the Decision: test statistic into two parts • If the value of the test statistic is in • The Acceptance Region the Acceptance Region we decide to • The Critical Region accept H0 . • If the value of the test statistic is in the Critical Region we decide to

reject H0 .

A two tailed Test

a/2 a/2 The z-test for Proportions

Testing the probability of success in a

0 z binomial

Critical Region Acceptance Critical Region Region

1 The Test Statistic The Test Statistic pˆ - p pˆ - p pˆ - p pˆ - p z = 0 = 0 z = 0 = 0 s pˆ p0 (1- p0 ) s pˆ p0 (1- p0 ) n n

The Acceptance region: The Acceptance and Critical region:

a/2 a/2 a

- za / 2 0 za / 2 z Reject H0 Reject H0 Accept H0 0 za z Reject H Accept H0 0

The one tailed z-test The one tailed z-test

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ˆ - p pˆ - p z = 0 = 0 H A : p ¹ p0 s pˆ p0 (1- p0 ) n • This is the (HA) - the Research Hypothesis

• Use a two tailed test

The Acceptance region: • If you are trying to prove the true value p

exceeds the hypothesized value p0

a H A : p > p0

• This is the alternative Hypothesis (HA) - z a 0 z - the Research Hypothesis Accept H Reject H0 0

Comments • If you are trying to prove the true value p • The alternative Hypothesis (HA) is does not exceed the hypothesized value p what the experiment is trying to 0 prove - the Research Hypothesis H A : p < p0 • The alternative Hypothesis (HA) will 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%)

p = the success rate of the new procedure H A : p > p0

4 Performing the Test Comments

1. Decide on a = 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 (a = 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 b = P[type II error] = of 200 cases is x = 187 P[accepting H0 when H0 is FALSE] • Whenever H is accepted there is a x 187 0 pˆ = = = 0.935 (93.5%) possibility that a type II error has been n 200 made.

3. Compute the test statistic In the last example pˆ - p pˆ - p z = 0 = 0 s pˆ p0 (1- p0 ) The conclusion that there is a no significant n (a = 5%) increase in the success rate of the 0.935- 0.91 new procedure over the older procedure = = 1.235 0.91(1- 0.91) should be interpreted: 200 4. Make the Decision za = z0.05 = 1.645 We have been unable to proof that the new procedure is better than the old procedure • Accept H0 if: z £1.645

• Reject H0 if: z >1.645

Since the test statistic is in the Acceptance An analogy – a jury trial region we decide to Accept H0

The two possible decisions are Conclude that H0: p £ 0.91 (91%) is true

There is a no significant (a = 5%) increase – Declare the accused innocent. in the success rate of the new procedure – Declare the accused guilty. over the older procedure

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

The two possible errors that can be made:

– Declaring an innocent person guilty. (type I error) The z-test for the of a

– Declaring a guilty person innocent. Normal Population (type II error) We want to test, m, denote the mean of a normal population Note: in this case one type of error may be considered more serious

Requiring all 12 jurors to support a guilty verdict : Situation – Ensures that the probability of a type I error (Declaring an innocent person guilty) is • A success-failure experiment has been small. repeated n times • The probability of success p is unknown. – However the probability of a type II error We want to test

(Declaring an guilty person innocent) could – H0: p = p0 (some specified value of p) be large. Against

– HA: p ¹ p0

6 The Data The Acceptance region:

• Let x1, x2, x3 , … , xn denote a sample from a normal population with mean m and s. a/2 a/2 • Let n å xi x = i=1 = the sample mean n - z 0 z z • we want to test if the mean, m, is equal to some a / 2 a / 2 Reject H0 Reject H0 given value m0. Accept H0 • Obviously if the sample mean is close to m the 0 P[Accept H when true]= P[- z £ z £ z ] = 1-a Null Hypothesis should be accepted otherwise the 0 a / 2 a / 2

null Hypothesis should be rejected. P[Reject H 0 when true] = P[z < -za / 2 or z > za / 2 ] = a

The Test Statistic • Acceptance Region • To decide to accept or reject the Null Hypothesis – Accept H if: 0 - za / 2 £ z £ za / 2 (H0) we will use the test statistic x - m x - m x - m x - m z = 0 = 0 = n 0 » n 0 • Critical Region s s x s s – Reject H if: 0 z < -za / 2 or z > za / 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 .

= P[z < -za / 2 or z > za / 2 ] = a • If HA is true we should expect the test statistic z to be different from zero.

The of z when H0 is true: Summary The Standard Normal distribution To test mean of a Normal population

H0: m = m0 (some specified value of m) Against

HA: m ¹ m0

1. Decide on a = P[Type I Error] = the 0 z significance level of the test (usual choices Reject H0 Accept H Reject H0 0 0.05 or 0.01)

7 The one tailed test – other direction 2. Collect the data To test H : m ³ m (some specified value of m) 3. Compute the test statistic 0 0 against m < m x - m x - m HA: 0 z = n 0 » n 0 s s Acceptance and Critical Region

4. Make the Decision • Accept H0 if: z ³ -za / 2 • Accept H if: 0 - za / 2 £ z £ za / 2 • Reject H0 if: z < -za / 2

• Reject H0 if: z < -za / 2 or z > za / 2

x - m x - m The one tailed test Test Statistic z = n 0 » n 0 s s To test Expect z to be negative if H0 is false H0: m £ m0 (some specified value of m) against The Acceptance and Critical region:

HA: m > m0

1. Use the test statistic a

x - m0 x - m0 z = n » n Reject H Accept H s s 0 0

- za 0 z

2. Use as the Acceptance and Critical Region Example:

• Accept H0 if: z £ za / 2 We are interested in measuring the concentration of lead in water and we want to know if it exceeds the • Reject H0 if: z > za / 2 threshold level m0 = 10.0

We take n = 40 one-litre samples measuring the concentration of lead. a Statistical results:

Reject H x =12.1 and s =1.2 Accept H0 0

0 za z

8 Test Statistic x - m x - m z = n 0 » n 0 s s

12.1-10.0 = 40 = 11.07 1.2

Since z is greater than z0.05 = 1.645 we conclude that the average lead level is significantly higher than 10.0

9