1 of 43

HYPOTHESIS TESTING

Dadan Kusnandar, Ph.D.

1

2 of 43

OBJECTIVES

When you have completed this topic, you should be able to:

    • Develop the hypothesis testing procedure as a technique for decision making
    • Determine the risks involved in making these decisions based only upon sample information

2

3 of 43

CONCEPTUAL EMPHASIS

  1. Basic concepts of hypothesis testing
  2. One sample tests for means, proportions and variance
  3. Two sample tests for a mean
  4. The paired difference test

3

Readings

  • Berenson and Levine (1992) Chapters 11, 12 & 13.
  • Kusnandar et al (2009) Chapter 6.

4 of 43

CONCEPTS OF HYPOTHESIS TESTING

The objective of hypothesis testing is to determine whether or not the sample data support some belief or hypothesis about the population

Examples:

    • A company that has a 10% market share launches a new advertising campaign. At the campaign’s completion, the company wants to know whether the results of a random sample indicate an increase in market share
    • A firm that produce fertilizer want s to know whether a new type of fertilizer increases crop yields.

4

5 of 43

STRUCTURE OF HYPOTHESIS TESTING

  • Null hypothesis
  • Alternative hypothesis
  • Test statistic
  • Rejection region (critical region)

5

6 of 43

THE NULL HYPOTHESIS (H0) AND �THE ALTERNATIVE HYPOTHESIS (H1)

The purpose of hypothesis testing is to choose between two conflicting hypotheses about the possible value of a population parameter

The null hypothesis (H0) is an assumption concerning the value of the population parameter.

The alternative hypothesis (H1) specifies all possible values of the population parameter that are not specify in the null hypothesis

6

7 of 43

CRUCIAL THINGS ABOUT THE TWO HYPOTHESES

  • The null hypothesis always specify that the parameter is equal to a single value

H0: θ = θ0

  • The alternative hypothesis can be expressed in one of the following:
    • H1: θθ0 → two sided alternative hypothesis
    • H1: θ < θ0 → one sided alternative hypothesis
    • H1: θ > θ0 → one sided alternative hypothesis

7

8 of 43

TEST STATISTIC AND REJECTION REGION

  • Test statistic is the criterion upon which we base our decision whether to reject or not to reject the null hypothesis
  • The test statistic is the point estimator of the parameter being tested
  • The rejection region is a range of values such that, if the test statistic falls into that range, we decide to reject the null hypothesis

8

9 of 43

REJECTION REGION FOR�H0: θ = θ0 VS. H1: θθ0

9

10 of 43

REJECTION REGION FOR�H0: θ = θ0 VS. H1: θ > θ0

10

11 of 43

REJECTION REGION FOR�H0: θ = θ0 VS. H1: θ < θ0

11

12 of 43

TYPE I AND TYPE II ERRORS

  • Type I error occurs if the null hypothesis is rejected when in fact it is true.�The probability of a Type I error is denoted by α, called as the level of significance
  • Type II error occurs if the null hypothesis is not rejected when it is false.�The probability of a Type II error is denoted by β. The complement (1 – β) is called the power of a statistical test

12

13 of 43

RELATIONSHIP BETWEEN α AND β

13

Statistical Decision

Actual situation

H0 True

H0 False

Reject H0

Type I error�(α)

Correct decision

Do not reject H0

Correct decision

Type II error�(β)

14 of 43

PROCEDURE OF HYPOTHESIS TESTING

  1. Specify the null hypothesis and the alternative hypothesis
  2. Specify the test statistic
  3. Specify α, and set up the rejection region
  4. Calculate the value of the test statistic
  5. Draw the conclusion: reject or do not reject H0

14

15 of 43

TEST OF HYPOTHESIS FOR THE MEAN, Σx KNOWN

When the sample size n is large, the Central Limit Theorem states that the sampling distribution of the sample mean would follow the Normal Distribution with mean μ and variance σ2/n. Hence the test statistic would be as follows:

15

For a specified level of significance (α), the rejection region can then be determined by utilizing the Standardized Normal Distribution

16 of 43

REJECTION RULES

Hypotheses

Rejection rules

H0: μ = μ0

H1: μμ0

  • Reject H0 if Z < – zα/2 or Z > zα/2
  • Do not reject H0 if –zα/2 ≤ Z ≤ zα/2

H0: μ = μ0

H1: μ > μ0

  • Reject H0 if Z > zα
  • Do not reject H0 if Z ≤ zα

H0: μ = μ0

H1: μ < μ0

  • Reject H0 if Z < – zα
  • Do not reject H0 if Z ≥ –zα

16

Test statistic:

17 of 43

EXAMPLE 1�BERENSON & LEVINE (1992) PROBLEMS 11.13 P.365

Suppose that the director of manufacturing at clothing factory needed to determine whether a new machine was producing a particular type of clothing according to the manufacturer’s specification, which indicate that the cloth should have a mean breaking strength of 70 pound and a standard deviation of 3.5 pounds. A sample of 36 pieces revealed a sample mean of 69.7 pounds. Is there evidence that the machine is not meeting the manufacturer’s specification in term of the average breaking strength? (Use the .05 level of significance)

17

18 of 43

SOLUTION TO EXAMPLE 1

  1. The null and alternative hypothesis were

H0: μ = 70

H1: μ ≠ 70

  • The test statistic would be the Z statistic
  • Significance level of .05 specified the size of the rejection region. Since H1 is a two sided hypothesis, the rejection region is divided into the two tails of the distribution, i.e. 0.025 each. Looking up the area in the Normal distribution the critical value that divide the rejection and nonrejection region are +1.96 and –1.96��The rejection rule would be�Reject H0 if Z > +1.96 or Z < – 1.96�Do not reject H0 if –1.96 ≤ Z ≤ +1.96

18

19 of 43

SOLUTION TO EXAMPLE 1 (CONTINUED)

  1. The value of the test statistics were

  • Since Z = – 0.514, our decision is not to reject H0 �(we see that –1.96 < – 0.514 < +1.96)

20 of 43

USING MINITAB

  • Store the data in one column of Minitab spreadsheet
  • Choose StatsBasic Statistics 1-Sample z
  • Click Test mean button and complete the dialog box

20

21 of 43

MINITAB OUTPUT

21

Z-Test

Test of mu = 70.000 vs mu not = 70.000

The assumed sigma = 3.50

Variable N Mean StDev SE Mean Z P

strength 36 69.700 3.452 0.583 -0.51 0.61

H0: μ = 70

H1: μ ≠ 70

The value of Z statistic

The p value: the probability of obtaining a test statistic equal to or more extreme than the result observed, given H0 is true

22 of 43

TEST OF HYPOTHESIS FOR THE MEAN, ΣX UNKNOWN

22

Hypotheses

Rejection rules

H0: μ = μ0

H1: μμ0

  • Reject H0 if T < – tα/2 or T > tα/2
  • Do not reject H0 if –tα/2 T ≤ tα/2

H0: μ = μ0

H1: μ > μ0

  • Reject H0 if T > tα
  • Do not reject H0 if T ≤ tα

H0: μ = μ0

H1: μ < μ0

  • Reject H0 if T < – tα
  • Do not reject H0 if T ≥ –tα

Test statistic:

23 of 43

EXAMPLE 2

Suppose that the standard deviation of the population in Example 1 was unknown. However, we have the sample standard deviation, which is 3.452 pounds. Is there any evidence that the machine is not meeting the manufacturer’s specification ?

23

24 of 43

MINITAB OUTPUT

24

StatsBasic Statistics 1-Sample t

T-Test of the Mean

Test of mu = 70.000 vs mu not = 70.000

Variable N Mean StDev SE Mean T P

strength 36 69.700 3.452 0.575 -0.52 0.61

25 of 43

RULE OF THUMB

25

Test of hypothesis for the mean

26 of 43

TEST OF HYPOTHESIS FOR A PROPORTION

26

Hypotheses

Rejection rules

H0: p = p0

H1: pp0

  • Reject H0 if Z < – zα/2 or Z > zα/2
  • Do not reject H0 if –zα/2 Z ≤ zα/2

H0: p = p0

H1: p > p0

  • Reject H0 if Z > zα
  • Do not reject H0 if Z ≤ zα

H0: p = p0

H1: p < p0

  • Reject H0 if Z < – zα
  • Do not reject H0 if Z ≥ –zα

Test statistic:

27 of 43

EXAMPLE 3

A stationery supply store receives a shipment of a certain brand of inexpensive ball point pens from the manufacturer. The shipment can be returned if there is more than 5% defective. A random sample of 300 pens is tested and 30 are found to be defective. Can the owner returned this shipment? Use a level of significance of .10.

27

28 of 43

THE CHI-SQUARE DISTRIBUTION

28

The statistic:

will follow the Chi-square distribution with (n – 1) degrees of freedom

29 of 43

CRITICAL VALUES OF Χ2

29

30 of 43

TESTING A HYPOTHESIS ABOUT A POPULATION VARIANCE

30

Hypotheses

Rejection rules

H0: σ2 = σ02

H1: σ2σ02

  • Reject H0 if χ2 < χ21-α/2 or χ2 > χ2α/2
  • Do not reject H0 if χ21-α /2 χ2χ2α/2

H0: σ2 = σ02

H1: σ2 > σ02

  • Reject H0 if χ2 > χ2α
  • Do not reject H0 if χ2χ2α

H0: σ2 = σ02

H1: σ2 < σ02

  • Reject H0 if χ2 < χ21-α
  • Do not reject H0 if χ2χ21-α

The statistic:

31 of 43

EXAMPLE 4

A manufacture of candy must monitor the temperature at which the candies are baked. Too much variation will cause inconsistency in the taste of the candy. Past records show that the standard deviation of the temperature has been 1.2o F. A random sample of 30 batches of candy is selected and the sample standard deviation of the temperature is 2.1o F. Is there any evidence that the population standard deviation has increase above 1.2o F?

31

32 of 43

TWO-SAMPLE TESTS

32

Population 1

Population 2

Sample

Sample

?

!

33 of 43

TESTING FOR DIFFERENCE BETWEEN THE MEANS OF TWO INDEPENDENT POPULATIONS

  • Two-tailed test:

H0: μ1 = μ2 or μ1μ2 = 0

H1: μ1μ2 or μ1μ2 ≠ 0

  • One-tailed tests:

H0: μ1 = μ2 or μ1μ2 = 0

H1: μ1 > μ2 or μ1μ2 > 0

or

H0: μ1 = μ2 or μ1μ2 = 0

H1: μ1 < μ2 or μ1μ2 < 0

33

Rejection regions

Rejection region

Rejection region

34 of 43

Case 1. Both population variances are known, or both sample sizes > 30

34

The test statistic is

or

For a specified level of significance (α), the rejection region can then be determined by utilizing the Standardized Normal Distribution

35 of 43

EXAMPLE 5

Management of the Sycamore Steel Co. wishes to determine if there is any difference in performance between the day shift of workers and the evening shift of workers. A sample of 120 day-shift workers reveals an average output of 74.3 parts per hour with a standard deviation of 16 parts per hour. A sample of 100 evening-shift workers reveals an average output of 69.7 parts per hour with a standard deviation of 18 parts per hour. Is there any evidence of a difference in output between the day shift and evening shift?

35

36 of 43

Case 2. Small sample sizes: both population variances are unknown, but can be assumed to be equal

36

The test statistic is

where

For a specified level of significance (α), the rejection region can then be determined by utilizing the t-distribution with (n1+n2 – 2) degrees of freedom

37 of 43

EXAMPLE 6

A quality control manager at a light bulb factory would like to determine if there is any difference in the average life of bulb manufactured on two different types of machines. A random sample of 25 light bulbs obtained from machine 1 indicated a sample mean of 375 hours with a sample standard deviation of 110 hours, and a similar sample of 25 from machine 2 indicated a sample mean of 362 hours with a sample standard deviation of 125 hours. Is there any evidence of a difference in the average life of bulbs produced by the two types of machines?

37

38 of 43

Case 3. Small sample sizes: both population variances are unknown, and cannot be assumed to be equal

38

The test statistic is

For a specified level of significance (α), the rejection region can then be determined by utilizing an approximation to a t-distribution with n degrees of freedom, where

39 of 43

EXAMPLE 7

An experiment was conducted to compare the mean number of tapeworm in the stomachs of sheep that have been treated for worms against the mean number in those that were untreated. A sample of 14 worm-infected lambs was randomly divided into two groups. Seven were injected with the drug and the remainder were left untreated. After a six-month period only 13 animals were available for analysis and the following worm counts were recorded:

39

Drug-treated sheep

5

13

18

6

4

2

15

Untreated

40

54

26

63

21

37

Is there any difference in the mean number of worms between treated and untreated lambs?

40 of 43

TESTING FOR DIFFERENCE BETWEEN THE MEANS FROM TWO RELATED POPULATIONS

  • Two samples are related when the items or individuals in the first sample are not independent of the second sample
  • The dependency occurs either because the items are paired or matched according to some characteristics or because repeated measurements are obtained from the same set of items

40

The variable of interest is the difference between the values of the observations rather than the observations themselves

41 of 43

Observations

Sample 1

Sample 2

Difference

1

x11

x21

d1 = x11 x21

2

x12

x22

d2 = x12 x22

i

x1i

x2i

di = x1i x2i

n

x1n

x2n

dn = x1n x2n

41

42 of 43

42

Hypotheses

Rejection rules

H0: μd = 0

H1: μd0

  • Reject H0 if T < – tα/2 or T > tα/2
  • Do not reject H0 if –tα/2 T ≤ tα/2

H0: μd = 0

H1: μd > 0

  • Reject H0 if T > tα
  • Do not reject H0 if T ≤ tα

H0: μd = 0

H1: μd < 0

  • Reject H0 if T < – tα
  • Do not reject H0 if T ≥ –tα

Test statistic:

The paired difference test

where

43 of 43

EXAMPLE 8

The marketing manager of a company decided to evaluate the effectiveness of a new advertising campaign. He collected data on monthly sales before and during the campaign for eight regional stores (see the table). What should he conclude?

43

Store

Before ($)

During ($)

1

63,458

65,496

2

48,510

52,462

3

51,203

50,864

4

75,241

79,520

5

60,123

71,145

6

55,555

55,600

7

45,456

48,654

8

57,438

60,897