32
CHAPTER 2 Hypothesis Testing -Test for one and two means -Test for one and two proportions

C HAPTER 2 Hypothesis Testing -Test for one and two means -Test for one and two proportions

Embed Size (px)

Citation preview

Page 1: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

CHAPTER 2 Hypothesis Testing-Test for one and two means-Test for one and two proportions

Page 2: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

WHY WE HAVE TO DO THE HYPOTHESIS?

To make decisions about populations based on the sample information.

Example :- we wish to know whether a medicine is really effective to cure a disease. So we use a sample of patients and take their data in effect of the medicine and make decisions.

To reach the decisions, it is useful to make assumptions about the populations. Such assumptions maybe true or not and called the statistical hypothesis.

Page 3: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Definitions

Hypothesis Test:

It is a process of using sample data and statistical procedures to decide whether to reject or not to reject the hypothesis (statement) about a population parameter value (or about its distribution characteristics).

Null Hypothesis, :

Generally this is a statement that a population has a specific value. The null hypothesis is initially assumed to be true. Therefore, it is the hypothesis to be tested.

Page 4: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Alternative Hypothesis, :

It is a statement about the same population parameter that is used in the null hypothesis and generally this is a statement that specifies that the population parameter has a value different in some way, from the value given in the null hypothesis. The rejection of the null hypothesis will imply the acceptance of this alternative hypothesis.

Test Statistic:

It is a function of the sample data on which the decision is to be based.

Page 5: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Critical/ Rejection region:

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

Critical point:

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

P-value:

The probability calculated using the test statistic. The smaller the p-value is, the more contradictory is the data to .

Page 6: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Procedure for hypothesis testing

1. Define the question to be tested and formulate a hypothesis for a stating the problem.

2. Choose the appropriate test statistic and calculate the sample statistic value. The choice of test statistics is dependent upon the probability distribution of the random variable involved in the hypothesis.

3. Establish the test criterion by determining the critical value and critical region.

4. Draw conclusions, whether to accept or to reject the null hypothesis.

1

: a or a or a

: a or a or > aoH

H

Page 7: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions
Page 8: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions
Page 9: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.7:

A sample of 50 Internet shoppers were asked how much they spent per year on Internet. From this sample, mean expenses per year on Internet is 30460 and sample standard deviation is 10151. It is desired to test whether they spend in mean expenses is RM32500 per year or not. Test at .

0.05

Page 10: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solution:

The hypothesis tested are:

Test Statistic:

Critical Value : As two tailed (=), so alpha has to divide by two,becomes :

Rejection Region:

Conclusion: The Internet Shoppers spend RM32500 per year on the Internet.

0

1

: 32500 (claim)

: 32500

H

H

30460 32500 20401.4212

10150 1435.426850

Z

0.025

0.05 / 2 0.025

1.96 1.96, 1.96Z

0.025

0

1.4212 1.96

Do not reject HtestZ Z

Page 11: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.8:

A random sample of 10 individuals who listen to radio was selected and the hours per week that each listens to radio was determined. The data are follows:

9 8 7 4 8 6 8 8 9 10

Test a hypothesis if mean hours individuals listen to radio is less than 8 hours at . 0.01

Page 12: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solutions:

The hypothesis tested are:

Test Statistic: n < 30

Critical Value:

Rejection Region:

Conclusion :

Mean hours individuals listen to radio is greater or equal to 8 hours.

0

1

: 8

: 8 (claim)

H

H

7.7,s 1.7029

7.7 8 0.30.5571

1.7029 0.538510

test

x

t

0.01,10 1 0.01,9 2.8214t t

0.01,9

0

0.5571 2.8214

Do not reject Htestt t

Page 13: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Exercise 2.1:1. From the following data, test the null hypothesis that population mean is less

than or equal to 100 at 5% significance level.

105 108 112 121 100 105 99 107 112 122 118 105

2. A paint manufacturing company claims that the mean drying time for its paint is at most 45 minutes. A random sample of 35 trials tested. It is found that the sample mean drying time is 49.50 minutes with standard deviation 3 minutes. Assume that the drying times follow a normal distribution. At 1% significance level, is there any sufficient evidence to support the company claim?

Page 14: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Hypothesis testing for the differences between two population mean,

Test hypothesis

Test statisticsi) Variance and are known, and both and are

samples of any sizes.

ii) If the population variances, and are unknown, then the following

tables shows the different formulas that may be used depending on the sample

sizes and the assumption on the population variances.

1 2

21 2

2

1 2 0

2 21 2

1 2

test

X XZ

n n

1n 2n

21 2

2

0 1 2

1 1 2 0

1 1 2 0

1 1 2 0 2 2

: 0

: 0 Reject when

: 0 Reject when

: 0 Reject when or Z

test

test

H

H H Z Z

H H Z Z

H H Z z   z

Page 15: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Equality of variances, when are unknown

Sample size

1 230 30n , n

2 21 2,

1 230 30n , n

2 21 2

1 2 0

2 21 2

1 2

test

X XZ

s s

n n

1 2 0

2 21 2

1 2

22 21 2

1 22 22 2

1 2

1 2

1 2

1 1

test

X Xt

s sn n

s sn n

vs sn n

n n

2 21 2

1 2

1 2

2 21 1 2 2

1 2

1 1

1 1

2

test

p

p

X XZ

Sn n

n s n sS

n n

1 2 0

1 2

2 21 1 2 2

1 2

1 2

1 1

1 1

2

2

test

p

p

X Xt

Sn n

n s n sS

n n

v n n

Page 16: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.9:The mean lifetime of 30 bulbs produced by company A is 50 hours and themean lifetime of 35 bulbs produced by company B is 48 hours. If the standarddeviation of all bulbs produced by company A is 3 hour and the standarddeviation 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 isbetter than that of company B. ( Variances are known)

Page 17: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solutions:

The hypothesis tested are:

Critical Value:

Rejection Region:

Conclusion :

The mean lifetime of bulbs produced by company A is better than that of company B.

0

1

2 2

: 0

: 0 (claim)

Test Statistic:

50 48 02 4807

3 3 530 35

A B

A B

test

H

H

Z ..

0 01 02 4807 2 3263 Reject Htest .Z . Z . 0.01 2.3263Z

Page 18: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.10:A mathematic placement test was given to two sample of classes of 45 and 55 student respectively . In the first class the sample mean grade was 75 with a standard deviation of 8, while in the second class the sample mean grade was 80 with a standard deviation of 7. Is there a significant difference between the mean performances of the two classes at 5% level of significance? Assume the population variances are equal.

Page 19: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solutions :

Hypothesis tested are:

Test Statistic:

Critical Value :

Rejection Region :

Conclusion : There is a significant difference between the performance of the two classes.

0 025 03 3319 1 96 Reject Htest .Z . Z .

0 1 2

1 1 2

: 0

: 0 (claim)

H

H

1 2 0

1 2

2 2

75 80 03 3319

1 1 1 17 4656

45 55

45 1 8 55 1 77 4656

44 55 2

test

p

p

X XZ .

S .n n

S .

0.025 1.96Z

Page 20: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Exercise 2.2:

A sample of 60 maids from country A earn an average of RM300 per week with a standard deviation of RM16, while a sample of 60 maids from country B earn an average of RM250 per week with a standard deviation of RM18. Test at 5% significance level that country A maids average earning exceed country B maids average earning more than RM40 per week. (Assume Variances are not equal)

Answer : Z = 3.2165, Reject

Page 21: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions
Page 22: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.11:

When working properly, a machine that is used to make chips for calculatorsproduce 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 they 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.

Page 23: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solutions:

The hypothesis tested are:

Test Statistic:

Critical Value:Rejection Region :

Conclusion : Machine needs adjustment

0

1

: 0.04

: 0.04 (claim)

H p

H p

14ˆ 0.07

2000.07 0.04

2.1651(0.04)(0.96)

200

test

p

Z

0.05 1.6449Z

0.05

0

2.1651 1.6449

Reject HtestZ Z

Page 24: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Exercise 2.3:

A manufacturer of a detergent claimed that his detergent is least 95%effective is removing though stains. In a sample of 300 people who had used theDetergent and 279 people claimed that they were satisfied with the result. Determine whether the manufacturer’s claim is true at 1% significance level.

Answer: Do not Reject 0H

Page 25: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions
Page 26: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions
Page 27: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Example 2.12:A researcher wanted to estimate the difference between the

percentages oftwo 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 28: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Solutions:

The hypothesis tested are:

Test Statistic:

Critical Value :

Rejection Region :

Conclusion : The proportion of user toothpaste A is less than and equal to B. @ Claim is not true.

0

1

: p 0

: p 0 (claim)A B

A B

H p

H p

100 68 100 68ˆ ˆ ˆ0.20, 0.17, 0.1867

500 400 500 400(0.20 0.17) 0

1.14781 1

(0.1867)(0.8133)400 500

A B

test

p p p

Z

0.01 2.3263Z

0.01

0

1.1478 2.3263

Do not Reject HtestZ Z

Page 29: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Exercise 2.4:

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 better to cure the fever than the using the usual ones only using a level of significance of 5%.

Answer: reject

0H

Page 30: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

EXERCISES

Page 31: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

Exercise 2.5

1. A new concrete mix being designed to provide adequate compressive strength for concrete blocks. The specification for a particular application calls for the blocks to have a mean compressive strength greater than 1350kPa. A sample of 100 blocks is produced and tested. Their mean compressive strength is 1366 kPa and their standard deviation is 70 kPa. Test hypothesis using = 0.05. Answer : Do not reject

Page 32: C HAPTER 2  Hypothesis Testing -Test for one and two means -Test for one and two proportions

2. A comparing properties of welds made using carbon dioxide as a shielding gas with those of welds made using a mixture of a argon and carbon dioxide. One property studied was the diameter of inclusions, which are particles embedded in the weld. A sample of 544 inclusions in welds made using argon shielding averaged 0.37 in diameter, with a standard deviation 0f 0.25 . A sample of 581 inclusions in welds made using carbon dioxide shielding average 0.40 in diameter, with a standard deviation of 0.26 . Can you conclude that the mean diameters of inclusions differ between the two shielding gases? Both variances for population are not equal.

Answer : Reject

mm

mm