Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis...

39
Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for two proportion (difference )

Transcript of Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis...

Page 1: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for two proportion (difference)

Page 2: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Hypothesis and Test Procedures A statistical test of hypothesis consist of :1.2. Calculate test statistic or using p-value3. Find Critical value4. Determine rejection region5. Make a conclusion

2

0H

1H

We test a certain given theory / belief about population parameter.

We may want to find out, using some sample information, whether or not a given claim / statement about population is true.

Develop Hypothesis Statement (H0 & H1)

Page 3: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Definition 9.1:

Hypothesis testing : can be used to determine whether a statement about the value of a population parameter should or should not be rejected.

Null hypothesis, H0 : A null hypothesis is a claim (or statement) about a population parameter that is assumed to be true. (the null hypothesis is either rejected or fails to be rejected.)

Alternative hypothesis, H1 : An alternative hypothesis is a claim about a population parameter that will be true if the null hypothesis is false.Test Statistic : is a function of the sample data on which the decision is to be based.p-value: is the probability calculated using the test statistic. The smaller the p-value, the more contradictory is the data to H0.

3

Critical point: It is the first (or boundary) value in the critical region.

Rejection region: It is a set of values of the test statistics for which the null hypothesis will be rejected.

Page 4: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

It is not always obvious how the null and alternative hypothesis should be formulated.

When formulating the null and alternative hypothesis, the nature or purpose of the test must also be taken into account. We will examine:

1) The claim or assertion leading to the test.2) The null hypothesis to be evaluated.3) The alternative hypothesis.4) Whether the test will be two-tail or one-tail.5) A visual representation of the test itself.

In some cases it is easier to identify the alternative hypothesis first. In other cases the null is easier.

Page 5: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

9.1.1 Alternative Hypothesis as a Research 9.1.1 Alternative Hypothesis as a Research HypothesisHypothesis

• Many applications of hypothesis testing involve an attempt to gather evidence in support of a research hypothesis.

• In such cases, it is often best to begin with the alternative hypothesis and make it the conclusion that the researcher hopes to support.

• The conclusion that the research hypothesis is true is made if the sample data provide sufficient evidence to show that the null hypothesis can be rejected.

Page 6: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.1: Example 9.1: A new drug is developed with the goalof lowering blood pressure more than the existing drug.

• Alternative Hypothesis H1 : The new drug lowers blood pressure more than the existing drug. • Null Hypothesis H0 : The new drug does not lower blood pressure more than the existing drug.

Page 7: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

9.1.2 Null Hypothesis as an Assumption to be Challenged

• We might begin with a belief or assumption that a statement about the value of a population parameter is true.

• We then using a hypothesis test to challenge the assumption and determine if there is statistical evidence to conclude that the assumption is incorrect.

• In these situations, it is helpful to develop the null hypothesis first.

Page 8: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.2 : The label on a soft drink bottle states that it contains at least 67.6 fluid ounces.

• Null Hypothesis H0 : The label is correct. µ > 67.6 ounces.• Alternative Hypothesis H1 : The label is incorrect. µ < 67.6 ounces.

Page 9: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.3Example 9.3: : Average tire life is 35000 miles.

• Null Hypothesis H0 : µ = 35000 miles

• Alternative Hypothesis H1: µ 35000 miles

Page 10: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Rule to develop H0 and H1:

Two-Tailed Test

Left-Tailed Test

Right-Tailed Test

H0 = = or = or

H1 < >

Page 11: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

1. Coca Cola claim that on average, the cans contain less than 12 ounces of soda.

2. The mean family size in UK was 3.18 in 1998. Test whether the claim is true.

The mean starting salary of school teachers in Kangar is RM2800. Test whether the current mean starting salary of all teachers in Kangar is higher than RM2800.

Page 12: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

The entire set of values that the test statistic may assume is divided into two regions. One set, consisting of values that support the and lead to reject , is called the rejection region. The other, consisting of values that support the is called the acceptance region. H0 always gets “=“.

Rule to Reject H0:

Tails of a Test

12

Two-Tailed Test

Left-Tailed Test

Right-Tailed Test

Sign in = = or = or Sign in < >Rejection Region In both tail In the left

tailIn the right

tail

0H

1H

9.1.3 How to decide whether to reject or accept ? 0H

1H 0H0H

Page 13: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Given:

0

1

: 45: 45

HH

0

1

: 23: 23

HH

0

1

: 7.12: 7.12

HH

Page 14: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Because hypothesis tests are based on sample data, we must allow for the possibility of errors. A Type I error is rejecting H0 when it is true

The probability of making a Type I error when the

null hypothesis is true as an equality is called the

level of significance ().

Applications of hypothesis testing that only control

the Type I error are often called significance tests.

Page 15: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

A Type II error is accepting H0 when it is false.

It is difficult to control for the probability of making

a Type II error, .

Statisticians avoid the risk of making a Type II

error by using “do not reject H0” and not “accept H0”.

9.2.2 Type II Error

Page 16: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Type I and Type II Errors

CorrectDecision

Type II Error

CorrectDecisionType I ErrorReject H0

Reject H0

Do not reject H0Do not reject H0

H0 TrueH0 True H0 FalseH0 FalseConclusionConclusion

Population Condition Population Condition

Page 17: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Null Hypothesis :

Test Statistic :

17

0 0 :H

• any population, is known and n is largeOr n is small

• any population, is unknown and n is large

• normal population, is unknown and n is small

xZ

n

xZ s

n

1

xt sn

v n

0 0:H

Page 18: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Alternative hypothesis Rejection Region ( Reject H0)

Both tail:

Right tail:

Left tail:

18

1 0:H

1 0:H

1 0:H

2 2 or  ZZ z z

Z z

Z< z

Page 19: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Definition 9.2: p-value The p-value is the smallest significance level at which the null hypothesis is rejected.

19

0

0

Using the value approach, we reject the null hypothesis,  if

value for one tailed test

value for two tailed test2

and we do not reject the null hypothesis,  if

value    for one tailed

p H

p

p

H

p

test

value    for two tailed test2

p

Page 20: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.4: Example 9.4:

20

The average monthly earnings for women in managerial and

professional positions is 2400. Do men in the same positions

have average monthly earnings that are higher than those for women ?

A random sampl

RM

e of 40 men in managerial and professional

positions showed 3600 and 400. Test the appropriate

hypothesis using  0.01

n

x RM s RM

Page 21: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Solution:

21

0

1

0.01

1.The hypothesis to be tested are,

:  2400

: 2400

2. Test Statistic     

3600 2400 18.97

400

40

3. Critical Value: 2.33

 

4. Rejection Reg

H

H

xZ

s

n

z z

0

ion : Z because right-tailed test.

Since 18.97 2.33, falls in the rejection region, we reject 

5. We conclude that average monthly earnings for men in managerial

and professional positions are s

z

H

ignificantly higher than those for women.

Page 22: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Exercise:A teacher claims that the student in Class A put in more hours

studying compared to other students. The mean numbers of hours spent studying per week is 25hours with a standard deviation of 3 hours per week. A sample of 27 Class A students was selected at random and the mean number of hours spent studying per week was found to be 26hours. Can the teacher’s claim be accepted at 5% significance level?

Page 23: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

23

0 0

0

0 0

Null Hypothesis : :

ˆTest Statistic     :          

H p p

p pZ

p q

n

Alternative hypothesis Rejection Region

Both tail :

Right tail:

Left tail:

1 0:H p p

1 0:H p p

1 0:H p p

2 2 or  ZZ z z

Z z

Z< z

Page 24: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.5:Example 9.5:

When working properly, a machine that is used to make chips for calculators does not produce more than 4% defective chips. Whenever the machine produces more than 4% defective chips it needs an adjustment. To check if the machine is working properly, the quality control department at the company often takes sample of chips and inspects them to determine if the

chips are good or defective. One such random sample of 200 chips taken recently from the production line contained 14 defective chips. Test at the 5% significance level whether or not the machine needs an adjustment.

24

Page 25: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Solution:

25

0

1

0

0 0

0.05

The hypothesis to be tested are ,

:    0.04

: 0.04

Test statistic is

ˆ 0.07 0.042.17

0.04(0.96)200

Rejection Region : Z     ; 1.65

Since 2.17 1.

H p

H p

p pZ

p q

n

z z z

065, falls in the rejection region, we can reject  

and conclude that the machine needs an adjustment.

H

Page 26: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Exercise

A manufacturer of a detergent claimed that his detergent is at least 95% effective is removing though stains. In a sample of 300 people who had used the detergent, n 279 people claimed that they were satisfied with the result.

Determine whether the manufacturer’s claim is true at 1% significance level.

Page 27: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.
Page 28: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Test statistics:

28

0 1 2Null Hypothesis :         : 0H

1 2

For two large and independent samples

and and   are known.

1 2 1 2

2 21 2

1 2

x xZ

n n

1 2

1 2

For two large and independent samples

and and   are unknown.

(Assume )

1 2 1 2

2 21 2

1 2

x xZ

s sn n

1 2 1 2

1 2

2 21 1 2 2

1 2

1 1

1 1with

2

p

p

x xZ

Sn n

n s n sS

n n

1 2

1 2

For two large and independent samples

and and   are unknown.

(Assume )

1 2

Page 29: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

29

• For two small and independent samples taken from two normally distributed populations.

1 2 1 2

2 21 2

1 2

22 21 2

1 22 22 2

1 2

1 1 2 2

1 11 1

x xt

s sn n

s sn n

vs s

n n n n

1 2 1 2

1 2

1 2

1 1

2

p

x xt

Sn n

v n n

1 2

1 2

For two small and independent samples

and and   are unknown.

(Assume )

Page 30: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Alternative hypothesis Rejection Region

30

1 1 2: 0H

1 1 2: 0H

1 1 2: 0H

2 2 or  ZZ z z

Z z

Z< z

Page 31: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example 9.7:

31

A university conducted an investigation to determine whether

car ownership affects academic achievement was based on two

random samples of 100 male students, each drawn from the

student body. The grad 1

1

2 221 2

2

e point average for the 100 non

owners of cars had an average and variance equal to 2.70

and 0.36 as opposed to 2.54 and 0.40 for the

100 car owners. Do the data present sufficient

n

x

s x s

n

evidence to

indicate a difference in the mean achievements between car owners

and non owners of cars? Test using 0.05

Page 32: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Solution:

32

0 1 2

1 1 2

1 2 1 2

2 21 2

1 2

The hypothesis to be tested are ,

: 0

: 0

Therefore, test statistic is

2.70 2.54 1.84

0.36 0.40100 100

H

H

x xZ Z

s sn n

Page 33: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

z=-1.96 z=+1.96

Do NotReject H 0

00 Reject HReject H

2 2 0.05 2 0.025Rejection Region : Z or  Z   ; 1.96z z z z

0Since 1.84 does not exceed 1.96 and not less than 1.96, we fail to reject 

and that is, there is not sufficient evidence to declare that there is a difference

in the average academic achievement for

H

the two groups.

Page 34: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Exercise:

The mean lifetime of 30 batteries produced by company A is 50 hours and the mean lifetime of 35 bulbs produced by company B is 48 hours. If the standard deviation of all bulbs produced by company A is 3 hour and the standard deviation of all bulbs produced by company B is 3.5 hours.

Test at 1 % significance level that the mean lifetime of bulbs produced by Company A is better than that of company B (claim).

Page 35: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

35

0 1 2

1 2 1 2 1 2

1 2

1 2

1 2 1 2

1 2

Null Hypothesis : : 0

Test Statistics     : 

ˆ ˆˆ where

ˆ ˆ ˆ ˆ(1 ) (1 )

ˆ ˆ

1 1ˆ ˆ

H p p

p p p p x xZ p

n np p p pn n

p p p pZ

pqn n

1 2p p

Page 36: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

36

Alternative hypothesis Rejection Region

1 1 2: 0H p p

1 1 2: 0H p p

1 1 2: 0H p p

2 2 or  ZZ z z

Z z

Z< z

Page 37: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Example:

A researcher wanted to estimate the difference between the percentages of

two toothpaste users who will never switch to other toothpaste. In a sample

of 500 users of toothpaste A taken by the researcher, 100 said that they will

never switched to another toothpaste. In another sample of 400 users of

toothpaste B taken by the same researcher, 68 said that they will never

switched to other toothpaste.

At the significance level 1%, can we conclude that the proportion of users of toothpaste A who will never switch to other toothpaste is higher than the proportion of users of toothpaste B who will never switch to other toothpaste?

Page 38: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Solution:

38

0 1 2 1 2

1 1 2 1 2

1 2 1 2

1 2

The hypothesis to be tested are ,

: 0 is not greater than

: 0 is greater than

Therefore, test statistic is

ˆ ˆ 0.20 0.17

1 1ˆ ˆ

H p p p p

H p p p p

p p p pZ Z

pqn n

0.01

0

0 1.15

1 1(0.187)(0.813)

500 400

Rejection Region : Z ;   2.33

Since 1.15 2.33, we fail to reject and therefore, we conclude that the

proportions of users of  Toothpaste A who will

z z

H

never switch to another toothpaste

is not greater than the proportion of users of  Toothpaste B who will never switch

to another toothpaste.

Page 39: Introduction Hypothesis testing for one mean Hypothesis testing for one proportion Hypothesis testing for two mean (difference) Hypothesis testing for.

Exercise:

In a process to reduce the number of death due the dengue fever, two district, district A and district B each consists of 150 people who have developed symptoms of the fever were taken as samples. The people in district A is given a new medication in addition to the usual ones but the people in district B is given only the usual medication. It was found that, from district A and from district B, 120 and 90 people respectively recover from the fever.

Test the hypothesis that the new medication helps to cure the fever using a level of significance of 5% (claim).