53
1 Introduction to Hypothesis Testing Chapter 11

1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

Embed Size (px)

Citation preview

Page 1: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

1

Introduction to Hypothesis Testing

Introduction to Hypothesis Testing

Chapter 11

Page 2: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

2

Developing Null and Alternative Hypotheses

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

• The null hypothesis, denoted by H0 , is a tentative assumption about a population parameter.

• The alternative hypothesis, denoted by H1, is the opposite of what is stated in the null hypothesis.

• Hypothesis testing is similar to a criminal trial. The hypotheses are:H0: The defendant is innocentH1: The defendant is guilty

Page 3: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

3

A Summary of Forms for Null and Alternative Hypotheses about a

Population Mean

• The equality part of the hypotheses always appears in the null hypothesis.

• In general, a hypothesis test about the value of a population mean must take one of the following three forms (where 0 is the hypothesized value of the population mean).

H0: > 0 H0: < 0 H0: = 0

H1: < 0 H1: > 0 H1: 0

Page 4: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

4

Concepts of Hypothesis Testing

• The critical concepts of hypothesis testing.– Example:

• An operation manager needs to determine if the mean demand during lead time is greater than 350.

• If so, changes in the ordering policy are needed. – There are two hypotheses about a population mean:

• H0: The null hypothesis = 350 • H1: The alternative hypothesis > 350

This is what you want to prove

Page 5: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

5

Concepts of Hypothesis Testing

= 350

• Assume the null hypothesis is true (= 350).

– Sample from the demand population, and build a statistic related to the parameter hypothesized (the sample mean).

– Pose the question: How probable is it to obtain a sample mean at least as extreme as the one observed from the sample, if H0 is correct?

Page 6: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

6

– Since the is much larger than 350, the mean is likely to be greater than 350. Reject the null hypothesis.

x

355x

Concepts of Hypothesis Testing

= 350

• Assume the null hypothesis is true (= 350).

450x

– In this case the mean is not likely to be greater than 350. Do not reject the null hypothesis.

Page 7: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

7

Types of Errors

• Two types of errors may occur when deciding whether to reject H0 based on the statistic value.

– Type I error: Reject H0 when it is true.

– Type II error: Do not reject H0 when it is false.• Example continued

– Type I error: Reject H0 ( = 350) in favor of H1 ( > 350) when the real value of is 350.

– Type II error: Believe that H0 is correct ( = 350) when the real value of is greater than 350.

Page 8: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

8

Type I and Type II Errors• Since hypothesis tests are based on sample data, we

must allow for the possibility of errors.• The person conducting the hypothesis test specifies the

maximum allowable probability of making aType I error, denoted by and called the level of significance.

• Generally, we cannot control for the probability of making a Type II error, denoted by .

• Statistician avoids the risk of making a Type II error by using “do not reject H0” and not “accept H0”.

Page 9: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

9

(

( )

Null True Null False

Fail toreject null

CorrectDecision

Type II error)

Reject null Type I error

Correct Decision(Power)

Decision Table for Hypothesis Testing

Page 10: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

10

Controlling the probability of conducting a type I error

• Recall:– H0: = 350 and H1: > 350.

– H0 is rejected if is sufficiently large

• Thus, a type I error is made if when = 350.

• By properly selecting the critical value we can limit the probability of conducting a type I error to an acceptable level.

xvaluecriticalx

Critical value

x= 350

Page 11: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

11

1. Establish hypotheses: state the null and alternative hypotheses.

2. Determine the appropriate statistical test and sampling distribution.

3. Specify the Type I error rate (4. State the decision rule.5. Gather sample data.6. Calculate the value of the test statistic.7. State the statistical conclusion.8. Make a managerial decision.

Steps in Hypothesis Testing

Page 12: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

12

Testing the Population Mean When the Population Standard Deviation is Known

• Example– A new billing system for a department store will be cost-

effective only if the mean monthly account is more than $170.

– A sample of 400 accounts has a mean of $178.– If accounts are approximately normally distributed with

= $65, can we conclude that the new system will be cost effective?

Page 13: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

13

• Example 11.1 – Solution– The population of interest is the credit accounts at

the store.– We want to know whether the mean account for all

customers is greater than $170.H1 : > 170

– The null hypothesis must specify a single value of the parameter

H0 : = 170

Testing the Population Mean ( is Known)

Page 14: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

14

Approaches to Testing

• There are two approaches to test whether the sample mean supports the alternative hypothesis (H1)– The rejection region method is mandatory for

manual testing (but can be used when testing is supported by a statistical software)

– The p-value method which is mostly used when a statistical software is available.

Page 15: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

15

The rejection region is a range of values such that if the test statistic falls into that range, the null hypothesis is rejected in favor of the alternative hypothesis.

The rejection region is a range of values such that if the test statistic falls into that range, the null hypothesis is rejected in favor of the alternative hypothesis.

The Rejection Region Method

Page 16: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

16

Example 11.1 – solution continued

• Define a critical value for that is just large enough to reject the null hypothesis.

xLx

• Reject the null hypothesis if

Lx xLx x

The Rejection Region Method for a Right - Tail Test

Page 17: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

17

• Allow the probability of committing a Type I error be (also called the significance level).

• Find the value of the sample mean that is just large enough so that the actual probability of committing a Type I error does not exceed Watch…

Determining the Critical Value for the Rejection Region

Page 18: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

18

P(commit a Type I error) = P(reject H0 given that H0 is true)Lx

170x x

= P( given that H0 is true)Lx x

40065

170xz L

Example – solution continued

… is allowed to be

( )Since P Z Z we have:

Determining the Critical Value – for a Right – Tail Test

Page 19: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

19

Determining the Critical Value – for a Right – Tail Test

.34.17540065

645.1170x

.645.1z,05.0selectweIf

.40065

z170x

L

05.

L

40065

170xz L

= 0.05

170x Lx

Example – solution continued

Page 20: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

20

Determining the Critical value for a Right - Tail Test

Re

175.34

ject the null hypothesis if

x Re

175.34

ject the null hypothesis if

x

ConclusionSince the sample mean (178) is greater than the critical value of 175.34, there is sufficient evidence to infer that the mean monthly balance is greater than $170 at the 5% significance level.

ConclusionSince the sample mean (178) is greater than the critical value of 175.34, there is sufficient evidence to infer that the mean monthly balance is greater than $170 at the 5% significance level.

Page 21: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

21

– Instead of using the statistic , we can use the standardized value z.

– Then, the rejection region becomes

x

n

xz

z zOne tail test

The standardized test statistic

Page 22: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

22

• Example - continued– We redo this example using the standardized test

statistic.Recall:H0: = 170

H1: > 170– Test statistic:

– Rejection region: z > z.051.645.

46.240065

170178

n

xz

The standardized test statistic

Page 23: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

23

• Example - continued

The standardized test statistic

Re

1.645

ject the null hypothesis if

Z Re

1.645

ject the null hypothesis if

Z

ConclusionSince Z = 2.46 > 1.645, reject the null hypothesis in favor of the alternative hypothesis.

ConclusionSince Z = 2.46 > 1.645, reject the null hypothesis in favor of the alternative hypothesis.

Page 24: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

24

– The p-value provides information about the amount of statistical evidence that supports the alternative hypothesis.

– The p-value of a test is the probability of observing a test statistic at least as extreme as the one computed, given that the null hypothesis is true.

– Let us demonstrate the concept on Example

P-value Method

Page 25: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

25

178 170( )

65 400

( 2.4615) .0069

P z

P z

170x

178x

The probability of observing a test statistic at least as extreme as 178, given that = 170 is…

The p-value

P-value Method

( 178 170)P x when

Page 26: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

26

Example 1

• Calculate the value of the test statistic, set up the rejection region, determine the p-value, interpret the result, and draw the sampling distribution.

1.0,3.14,25,2

15:

15:H

1

0

xn

H

Page 27: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

27

Solution

Page 28: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

28

如何利用 Excel查出標準常態分配機率值

• 標準常態分配 (Normal distribution) -> Using 插入 >fx 函數 > 選取類別 ( 統計 )>NORMSDIST

為標準常態分配累積機率值 ->Using 插入 >fx 函數 > 選取類別 ( 統計 )>NORMSINV

求標準常態分配下,給定累積機率反求 Z 値

Page 29: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

29

Example 2

• A random sample of 18 young adult men (20-30 years old) was sampled. Each person was asked how many minutes of sports they watched on television daily. The responses are listed here. It is known that =12. Test to determine at the 5% significance level whether there is enough statistical evidence to infer that the mean amount of television watched daily by all young adult men is greater than 50 minutes

55 60 65 74 66 37 45 68 64 65 58 55 52 63 59 57 74 65

Page 30: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

30

Solution

3.57

Page 31: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

31

A Two - Tail Test

• Example 11.2– AT&T has been challenged by competitors who

argued that their rates resulted in lower bills.– A statistics practitioner determines that the mean

and standard deviation of monthly long-distance bills for all AT&T residential customers are $17.09 and $3.87 respectively.

Page 32: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

32

A Two - Tail Test

• Example 11.2 - continued– A random sample of 100 customers is selected and

customers’ bills recalculated using a leading competitor’s rates (see Xm11-02).

– Assuming the standard deviation is the same (3.87), can we infer that there is a difference between AT&T’s bills and the competitor’s bills (on the average)?

Page 33: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

33

• Solution– Is the mean different from 17.09?

H0: = 17.09

09.17:H1

– Define the rejection region

A Two - Tail Test

/ 2 / 2z z or z z

Page 34: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

34

17.09

We want this erroneous rejection of H0 to be a rare event, say 5% chance.

x x

If H0 is true ( =17.09), can still fall far above or far below 17.09, in which case we erroneously reject H0 in favor of H1

x

)09.17(

20.025 20.025

Solution - continued

A Two – Tail Test

Page 35: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

35

20.025

17.09

0

x x20.025

20.025 20.025

19.110087.3

09.1755.17

n

xz

-z= -1.96 z= 1.96

Rejection region

Solution - continued

A Two – Tail Test

55.17x

From the sample we have:

17.55

Page 36: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

36

20.025 20.025

19.110087.3

09.1755.17

n

xz

-z= -1.96 z= 1.96

There is insufficient evidence to infer that there is a difference between the bills of AT&T and the competitor.

-1.19

Also, by the p value approach:The p-value = P(Z< -1.19)+P(Z >1.19) = 2(.1173) = .2346 > .05

1.190

A Two – Tail Test

Page 37: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

37

Example 3

Page 38: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

38

Solution

Page 39: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

39

• To calculate Type II error we need to…– express the rejection region directly, in terms of the

parameter hypothesized (not standardized).– specify the alternative value under H1.

• Let us revisit Example 11.1

Calculation of the Probability of a Type II Error

Page 40: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

40

Express the rejection region directly, not in standardized terms

34.175xL

=.05

= 170

Calculation of the Probability of a Type II Error

• Let us revisit Example 11.1– The rejection region was with = .05.175.34x

Do not reject H0

180

H1: = 180

H0: = 170

Specify the alternative value

under H1.

– Let the alternative value be = 180 (rather than just >170)

Page 41: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

41

34.175xL

=.05

= 170

Calculation of the Probability of a Type II Error

34.175x 180

H1: = 180

H0: = 170

– A Type II error occurs when a false H0 is not rejected.

A false H0……is not rejected

Page 42: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

42

34.175xL = 170

Calculation of the Probability of a Type II Error

180

H1: = 180

H0: = 170

)180thatgiven34.175x(P

)falseisHthatgiven34.175x(P 0

0764.)40065

18034.175z(P

Page 43: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

43

Example 4

Page 44: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

44

Solution

Page 45: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

45

Example 5

Page 46: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

46

Solution

100/10

5296.51

/100/10

5204.48P

n

x

Page 47: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

47

• Decreasing the significance level increases the value of and vice versa

Effects on of changing

= 170 180

2 >2 <

Page 48: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

48

• A hypothesis test is effectively defined by the significance level and by the sample size n.

• If the probability of a Type II error is judged to be too large, we can reduce it by– increasing , and/or– increasing the sample size.

Judging the Test

Page 49: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

49

• Increasing the sample size reduces

Judging the Test

By increasing the sample size the standard deviation of the sampling distribution of the mean decreases. Thus, decreases.

Lx

nzxthus,

nx

z:callRe LL

Page 50: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

50 Lx 180= 170

Judging the Test

Lx

Note what happens when n increases:

Lx LxLx Lx

does not change,but becomes smaller

• Increasing the sample size reduces

nzxthus,

nx

z:callRe LL

Page 51: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

51

• Power of a test– The power of a test is defined as 1 - – It represents the probability of rejecting the null

hypothesis when it is false.

Judging the Test

Page 52: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

52

Example 6

Page 53: 1 Introduction to Hypothesis Testing Chapter 11. 2 Developing Null and Alternative Hypotheses Hypothesis testing can be used to determine whether a statement

53

Solution