27
21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis Testing Introductory Mathematics & Statistics for Business

21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

Embed Size (px)

Citation preview

Page 1: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-1Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

Chapter 21

Hypothesis Testing

Introductory Mathematics & Statistics for Business

Page 2: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-2Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

Learning Objectives

• Understand the principles of statistical inference• Formulate null and alternative hypotheses• Understand one-tailed and two-tailed tests• Understand type I and type II errors• Understand test statistics• Understand the significance level of a test• Understand and calculate critical values• Understand the regions of acceptance and rejection• Calculate and interpret a one-sample z-test statistic• Calculate and interpret a one-sample t-test statistic• Calculate and interpret a paired t-test statistic• Calculate and interpret a two-sample t-test statistic• Understand and calculate p-values

Page 3: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-3Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference

• One of the major roles of statisticians in practice is to draw conclusions from a set of data

• This process is known as statistical inference• We can put a probability on whether a conclusion is

correct within reasonable doubt

• The major question to be answered is whether any difference between samples, or between a sample and a population, has occurred simply as a result of natural variation or because of a real difference between the two

Page 4: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-4Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference (cont…)

• In this decision-making process we usually undertake a series of steps, which can include the following:

1. collecting the data

2. summarising the data

3. setting up an hypothesis (i.e. a claim or theory), which is to be tested

4. calculating the probability of obtaining a sample such as the one we have if the hypothesis is true

5. either accepting or rejecting the hypothesis

Page 5: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-5Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference (cont…)

• The null hypothesis– A technique for dealing with these problems begins with the

formulation of an hypothesis

– The null hypothesis is a statement that nothing unusual has occurred. The notation is Ho

– The alternative hypothesis states that something unusual has occurred. The notation is H1 or HA

– Together they may be written in the form:

Ho: (statement) v H1(alternative statement)

(where ‘v’ stands for versus)

Page 6: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-6Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference (cont…)

• The null hypothesis (cont…)– E.g. Question: Is the population mean, μ, equal to a specified

value?

Hypotheses:

H0: The population mean, μ, is equal to the specified value.

v.

H1: The population mean, μ, is not equal to the specified value

– Another way of expressing the null and alternative hypotheses is in the form of symbols, e.g.

00 :H

Page 7: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-7Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference (cont…)

• The alternative hypothesis– The alternative hypothesis may be classified as two-tailed or

one-tailed

– Two-tailed test (two-sided alternative) we do the test with no preconceived notion that the

true value of μ is either above or below the hypothesised value of μ0

the alternative hypothesis is written:

H1: µ µo

Page 8: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-8Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.1 Statistical inference (cont…)

• Significance level– After the appropriate hypotheses have been formulated, we

must decide upon the significance level (or –level) of the test

– This level represents the borderline probability between whether an event (or sample) has occurred by chance or whether an unusual event has taken place

– The most common significance level used is 0.05, commonly written as = 0.05

– A 5% significance level says in effect that an event that occurs less than 5% of the time is considered unusual

Page 9: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-9Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.2 Errors

• There are two possible errors in making a conclusion about a null hypothesis

– Type I errors occur when you reject H0 (i.e. conclude that it is false) when H0 is really true. The probability of making a type I error is, in fact, equal to , the significance level of the test

– Type II errors occur when you accept H0 (i.e. conclude that it is true) when H0 is really false. The probability of making a type II error is denoted by the Greek letter (beta)

Page 10: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-10Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test

• Deals with the case of a single sample being chosen from a population and the question of whether that particular sample might be consistent with the rest of the population

• To answer this question, we construct a test statistic according to a particular formula

• Is important that the correct test be used, since the use of an incorrect test statistic can lead to an erroneous conclusion

Page 11: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-11Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test (cont…)

• Information required in calculation:– the size (n) of the sample– the mean of the sample– the standard deviation (s) of the sample

• Other information of interest might include:1. Does the population have a normal distributionnormal distribution?

2. Is the population’s standard deviationstandard deviation known?

3. Is the sample size (n) large?

x

Page 12: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-12Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test (cont…)• There are different cases for the one-sample z-test statistic

Case I is a situation where:

1. the population has a normal distribution and

2. the population standard deviation, , is known

Case II is a situation where:

1. the population has any distribution

2. the sample size, n, is large (i.e. at least 25), and

3. the value of is known

In both these cases we can use a z-test statistic defined by:

n

xz 0

Page 13: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-13Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test (cont…)

Case III is a situation where:

1. the population has any distribution

2. the sample size, n, is large (i.e. at least 25), and

3. the value of is unknown (however, since n is large, the value of is approximated by the sample standard deviation, s)

In this case we can use a z-test statistic defined by:

n

sx

z 0

Page 14: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-14Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test (cont…)

• A critical value is one that represents the cut-off point for z-test statistics in deciding whether we do not reject or do reject H0. The particular critical value to use depends on two things:

1. whether we are using a one-sided or two-sided test, and

2. the significance level used

Page 15: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-15Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.3 The one-sample z-test (cont…)

Rules for not rejecting or rejecting H0 in a one-

sample z-test

Page 16: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-16Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.4 The one-sample t-test• Consider a test that has the same objective as a one-sample z-

test, that is to determine whether a sample is significantly different from the population as a whole

• However, the one-sample t-test has a different set of assumptions:

Case IV is a situation where:

1. the population is normally distributed

2. the population standard deviation, , is unknown and

3. the sample size, n, is small

Then we can use a t-test statistic defined as:

n

sx

t 0

Page 17: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-17Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.4 The one-sample t-test (cont…)

• Unlike the z-test statistic, the t-test statistic has associated with it a quantity called degrees of freedom

• The degrees of freedom are denoted by the Greek letter υ and are defined by υ = n – 1.

• Degrees of freedom relate to the fact that the sum of all deviations in a sample of size n must add up to zero

• When using a t-test statistic, we must use special critical values in a table

• This information is given in Table 7, and the critical values are given to three decimal places

• After the value of the t-test statistic is found, the method of either not rejecting or rejecting H0 is similar to Rules (1) to (6) described for the z-test

Page 18: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-18Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.5 Drawing a conclusion

• Once a decision has been made to either not reject or reject H0, a conclusion should be written in terms of what the actual problem is

• To summarise, the steps that should be undertaken to perform a one-sample test are:1. Set up the null and alternative hypotheses. This includes

deciding whether you are using a one-sided or two-sided test

2. Decide on the significance level3. Write down the relevant data4. Decide on the test statistic to be used5. Calculate the value of the test statistic6. Find the relevant critical value and decide whether H0 is to

be not rejected or rejected7. Draw an appropriate conclusion

Page 19: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-19Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.6 The paired t-test

• Now we will consider problems in which there are two samples that are to be compared with each other

• These are often referred to as two-sample problems and there are a number of test statistics available

• In some instances, the two samples have a structure such that the data are paired

• A comparison of the values in two samples requires the calculation of a two-sample test statistic

• In such cases, the most commonly used test statistic is a paired t-test, which takes into account this natural pairing

Page 20: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-20Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.6 The paired t-test (cont…)

• The steps involved in the analysis are as follows:1. Construct the null and alternative (two-tailed) hypotheses.

H0 always states that there is no difference between the two samples. H1 always states that there is some difference between the two samples.

In symbol form these can be written as:

H0: μd = 0 v. H1: μd ≠ 0

2. Calculate the actual differences between the values in the two samples. It is important to retain the minus sign if the subtraction yields a negative number

3. Calculate the mean and standard deviation of the values of the differences

Page 21: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-21Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.6 The paired t-test (cont…)

4. Calculate the value of the paired t-test statistic using:

where n = the number of pairs of differences

μd = 0 (according to the null hypothesis)

and with = n – 1 degrees of freedom

n

sx

td

dd

Page 22: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-22Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.6 The paired t-test (cont…)

5. Look up the critical value in Table 7 for the desired significance level

If | test statistic | > critical value, we reject H0 and the conclusion is that H1 applies

If | test statistic | < critical value, we cannot reject H0

and the conclusion is that there is no evidence of a significant difference between the two samples

Page 23: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-23Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.7 The two-sample t-test

• This time, suppose that the samples are not paired; that is, they are independent

• The two samples need not contain the same number of observations

• The most common test statistic used in this situation is a two-sample t-test (also known as a pooled t-test)

• The steps for using a two-sample t-test are as follows:1. Construct the null and alternative (two-tailed) hypotheses.

H0 always states that there is no difference between the two samples, while H1 always states that there is some difference between the two samples

H0: μ1 = μ2 v H1: μ1 ≠ μ2

Page 24: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-24Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.7 The two-sample t-test (cont…)

2. Calculate the following statistics from the samples: the number of observations in Sample 1 and 2, the mean of Sample 1 and 2, the standard deviation of Sample 1 and 2

3. Calculate the value of the pooled standard deviation

4. Calculate the value of the two-sample t-test statistic

2nn

s1ns1ns

21

222

211

p

21p

21

n1

n1

s

xxt

Page 25: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-25Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.7 The two-sample t-test (cont…)

5. Look up the critical value in Table 7 for the desired significance level.

If | test statistic | > critical value, we reject H0 and the conclusion is that H1 applies. Hence, there is a significant difference between the two samples

If | test statistic | < critical value, we cannot reject H0

and the conclusion is that there is no evidence of a significant difference between the two samples

Page 26: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-26Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

21.8 p-values

• An alternative to using critical values for testing hypotheses is to use a p-value approach

• The value of the test statistic is still calculated in the usual way

• In this case we now calculate the probability of obtaining a value as extreme as the value of the test statistic if H0 were true

• Compare the p-value with . Then:

If p-value > , we cannot reject H0 at that -level

If p-value < , we reject H0 at that -level

Page 27: 21-1 Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e Chapter 21 Hypothesis

21-27Copyright 2010 McGraw-Hill Australia Pty Ltd PowerPoint slides to accompany Croucher, Introductory Mathematics and Statistics, 5e

Summary• In this chapter we looked at the principles of statistical inference• We formulated null and alternative hypotheses• We understood

– one-tailed and two-tailed tests– type I and type II errors– test statistics– the significance level of a test– the regions of acceptance and rejection

• We understood and calculated critical values• We calculated and interpreted

– a one-sample z-test statistic– a one-sample t-test statistic– a paired t-test statistic– a two-sample t-test statistic

• We understood and calculated p-values