Discovering Statistics 2 nd Edition Daniel T Larose

  • Slides: 47
Download presentation
+ Discovering Statistics 2 nd Edition Daniel T. Larose Chapter 9: Hypothesis Testing Lecture

+ Discovering Statistics 2 nd Edition Daniel T. Larose Chapter 9: Hypothesis Testing Lecture Power. Point Slides

+ Chapter 9 Overview 2 n 9. 1 Introduction to Hypothesis Testing n 9.

+ Chapter 9 Overview 2 n 9. 1 Introduction to Hypothesis Testing n 9. 2 z Test for the Population Mean: Critical-Value Method n 9. 3 z Test for the Population Mean: p-Value Method n 9. 4 t Test for the Population Mean µ n 9. 5 z Test for the Population Proportion p n 9. 6 Chi-Square Test for the Population Standard Deviation σ n 9. 7 Probability of Type II Error and the Power of the Hypothesis Test

+ 9. 1: Introduction to Hypothesis Testing Objectives: Construct the null hypothesis and the

+ 9. 1: Introduction to Hypothesis Testing Objectives: Construct the null hypothesis and the alternative hypothesis from the statement of the problem. ü State the two types of errors made in hypothesis tests: ü the Type I error, made with probability α the Type II error, made with probability β 3

Constructing the Hypotheses The basic idea of hypothesis testing is the following: 1. We

Constructing the Hypotheses The basic idea of hypothesis testing is the following: 1. We need to make a decision about the value of a population parameter. 2. Unfortunately, the true value of that parameter is unknown. 3. Therefore, there may be different hypotheses about the true value. The Hypotheses • The status quo hypothesis represents what has been tentatively assumed about the value of the parameter and is called the null hypothesis, denoted as H 0. • The alternative hypothesis, or research hypothesis, denoted as Ha represents an alternative claim about the value of the parameter. 4

Converting Words to Hypotheses To convert a word problem into two hypotheses, look for

Converting Words to Hypotheses To convert a word problem into two hypotheses, look for key words that can be expressed mathematically. Strategy for Constructing Hypotheses About µ 1. Search the word problem for key words and select the associated symbol. 2. Determine the form of the hypotheses that uses this symbol. 3. Find the value of µ 0 and write your hypotheses in the appropriate form. 5

Statistical Significance In a hypothesis test, we compare the sample mean with the value

Statistical Significance In a hypothesis test, we compare the sample mean with the value µ 0 of the population mean used in the H 0 hypothesis. • If the difference is large, then H 0 is rejected. • If the difference is not large, then H 0 is not rejected. Statistical Significance A result is said to be statistically significant if it is unlikely to have occurred due to chance. Note, the decision to reject or not reject H 0 does not prove anything. Because we rely on chance, there are two ways to render an incorrect decision. 6

Type I and Type II Errors In a criminal trial, the defendant is innocent

Type I and Type II Errors In a criminal trial, the defendant is innocent until proven guilty. The jury must evaluate the truth of two competing hypotheses: H 0: defendant is not guilty versus Ha: defendant is guilty In statistics, the two incorrect decisions are called Type I and Type II errors. Two Types of Errors • Type I error: To reject H 0 when H 0 is true. • Type II error: To not reject H 0 when H 0 is false. 7

Type I and Type II Errors We can make decisions about population parameters using

Type I and Type II Errors We can make decisions about population parameters using the limited information available in a sample because we base our decisions on probability. • When the difference between the sample mean and the hypothesized mean is large, then the null hypothesis is probably not correct. • When the difference is small, then the data are probably consistent with the null hypothesis. But we don’t know for sure. The probability of a Type I error is denoted as α(alpha). We set the value of α to be some small constant, such as 0. 01, 0. 05, or 0. 10, so that there is only a small probability of rejecting a true null hypothesis. The level of significance of a hypothesis test is another name for α. The probability of a Type II error is denoted as β(beta). This is the probability of not rejecting the null hypothesis when it is false. 8

+ 9. 2: z Test for the Population Mean: Critical-Value Method Objectives: Explain the

+ 9. 2: z Test for the Population Mean: Critical-Value Method Objectives: Explain the essential idea about hypothesis testing for the population mean. ü Perform the z test for the mean using the critical value method. ü 9

Hypotheses Testing for the Mean In Section 9. 1, we learned that a large

Hypotheses Testing for the Mean In Section 9. 1, we learned that a large difference between the observed sample mean and the hypothesized mean would result in the rejection of the null hypothesis. The question is, “How large is large? ” We must choose from one of the following two scenarios: 1. H 0 is true, the value of µ 0 is accurate, and our observation of this extreme value of x-bar is an amazingly unlikely event. 2. H 0 is not correct, and the true value of µ is closer to x-bar. The Essential Idea About Hypothesis Testing for the Mean When the observed value of the sample mean is unusual or extreme in the sampling distribution that assumes H 0 is true, we should reject H 0. Otherwise, we should not reject H 0. 10

The Z Test Statistic The Z statistic contains four quantities, three of which are

The Z Test Statistic The Z statistic contains four quantities, three of which are taken from the data. The sample mean and sample size are characteristics of the sample data, and the population standard deviation represents the population data. The Test Statistic Zdata The test statistic used for the Z test for the mean is: Z is an example of a test statistic, a statistic generated from a data set for the purposes of testing a statistical hypothesis. 11

12 The Critical-Value Method In the critical-value method for the Z test, we compare

12 The Critical-Value Method In the critical-value method for the Z test, we compare Zdata with a threshold value, or critical value of Z, called Zcrit. This value separates Z into two regions: • Critical region: the values of Zdata for which we reject H 0. • Noncritical region: the values of Zdata for which we do not reject H 0. The value of Z that separates the critical region from the noncritical region is called the critical value Zcrit. H 0: μ = μ 0 Ha: μ > μ 0 H 0: μ = μ 0 Ha: μ < μ 0 H 0: μ = μ 0 Ha: μ ≠ μ 0

13 The Critical-Value Method Table of Critical Values for Common Levels of Significance H

13 The Critical-Value Method Table of Critical Values for Common Levels of Significance H 0: μ = μ 0 Ha: μ > μ 0 H 0: μ = μ 0 Ha: μ < μ 0 α = 0. 10 Zcrit = 1. 28 Zcrit = -1. 28 Zcrit = 1. 645 α = 0. 05 Zcrit = 1. 645 Zcrit = -1. 645 Zcrit = 1. 96 α = 0. 01 Zcrit = 2. 33 Zcrit = -2. 33 Zcrit = 2. 58 Reject if Zdata ≥ Zcrit Zdata ≤ -Zcrit or Zdata ≥ Zcrit H 0: μ = μ 0 Ha: μ ≠ μ 0

Z Test for µ: Critical-Value Method Z Test for the Population Mean µ: Critical-Value

Z Test for µ: Critical-Value Method Z Test for the Population Mean µ: Critical-Value Method When a random sample of size n is taken from a population where the population standard deviation σ is known, you can use the Z test if (a) the population is normal, or (b) the sample size is large (n ≥ 30). Step 1: State the hypotheses. Step 2: Find Zcrit and state the rejection rule. Step 3: Calculate Zdata: Step 4: State the conclusion and the interpretation. If Zdata falls in the critical region, then reject H 0, otherwise do not reject H 0. 14

+ 9. 3: Z Test for the Population Mean: p-Value Method Objectives: Carry out

+ 9. 3: Z Test for the Population Mean: p-Value Method Objectives: Carry out the Z test for the mean, using the p-value method. ü Assess the strength of evidence against the null hypothesis. ü Describe the relationship between the p-value method and the critical-value method. ü Use the Z confidence interval for the mean to perform the two-tailed Z test for the mean. ü 15

The p-Value In this section, we introduce the p-value method, which works by comparing

The p-Value In this section, we introduce the p-value method, which works by comparing one probability (the p-value) to another probability (α). The pvalue is a measure of how well (or how poorly) the data fit the null hypothesis. p-Value The p-value is the probability of observing a sample statistic at least as extreme as the statistic observed, if we assume that the null hypothesis is true. The method for calculating p-values depends on the form of the hypothesis test: • When the p-value is in the right (upper) tail, we have a right-tailed test. • When the p-value is in the left (lower) tail, we have a left-tailed test. • When the p-value lies in both tails, we have a two-tailed test. 16

The p-Value 17

The p-Value 17

The p-Value Since a p-value is based on the value of Zdata, it tells

The p-Value Since a p-value is based on the value of Zdata, it tells us whether or not Zdata is an extreme value. Unusual and extreme values of the sample mean, and therefore of Zdata will have a small p-value. Assuming H 0 is true: Unusual and extreme values of sample mean and Zdata • Small p-value (close to 0) Values of sample mean and Zdata near center • Large p-value (greater than, say, 0. 15) The rejection rule for performing a hypothesis test using the p-value method is: • Reject H 0 when the p-value ≤ α. • Otherwise, do not reject H 0. 18

Z Test for µ: p-Value Method Z Test for the Population Mean µ: p-Value

Z Test for µ: p-Value Method Z Test for the Population Mean µ: p-Value Method When a random sample of size n is taken from a population where the population standard deviation σ is known, you can use the Z test if (a) the population is normal, or (b) the sample size is large (n ≥ 30). Step 1: State the hypotheses. Step 2: Calculate Zdata: Step 3: Find the p-value using technology or a table. Step 4: State the conclusion and the interpretation. If the p-value ≤ α, then reject H 0. Otherwise do not reject H 0. 19

Assessing the Strength of Evidence Against the Null Hypothesis The hypothesis testing methods we

Assessing the Strength of Evidence Against the Null Hypothesis The hypothesis testing methods we have seen deliver a simple yes-orno conclusion to reject or not reject H 0. The p-value itself implicitly represents the strength of evidence against the null hypothesis. 20

Relationship Between p-Value Method and Critical-Value Method 21

Relationship Between p-Value Method and Critical-Value Method 21

Confidence Intervals and Two-Tailed Hypothesis Tests Equivalence of a Two-Tailed Hypothesis Test and Confidence

Confidence Intervals and Two-Tailed Hypothesis Tests Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval • If a certain value for µ 0 lies outside the corresponding 100(1 – α)%Z confidence interval for µ, then the null hypothesis specifying this value for µ 0 would be rejected for level of significance α. • Alternatively, if a certain value for µ 0 lies inside the corresponding 100(1 – α)%Z confidence interval for µ, then the null hypothesis specifying this value for µ 0 would not be rejected for level of significance α. 22

+ 9. 4: t Test for the Population Mean Objectives: Perform the t test

+ 9. 4: t Test for the Population Mean Objectives: Perform the t test for the mean using the criticalvalue method. ü Carry out the t test for the mean using the p-value method. ü Use confidence intervals to perform two-tailed hypothesis tests. ü 23

t Test for µ: Critical-Value Method In many real-world scenarios, the value of the

t Test for µ: Critical-Value Method In many real-world scenarios, the value of the population standard deviation σ is unknown. When this occurs, we should use neither the Z interval or the Z test. The test statistic used for the t test for the mean is: tdata represents the number of standard errors above or below µ 0. Because there is a different t curve for every different sample size, you need to know the following in order to find the value of tdata. • The form of the hypothesis test (one-tailed or two-tailed) • The degrees of freedom (df = n – 1) • The level of significance α 24

t Test for µ: Critical-Value Method t Test for the Population Mean µ: Critical-Value

t Test for µ: Critical-Value Method t Test for the Population Mean µ: Critical-Value Method When a random sample of size n is taken from a population, you can use the t test if either the population is normal, or the sample size is large (n ≥ 30). Step 1: State the hypotheses. Step 2: Find tcrit and state the rejection rule. Step 3: Calculate tdata: Step 4: State the conclusion and the interpretation. If tdata falls in the critical region, then reject H 0, otherwise do not reject H 0. 25

t Test for µ: Critical-Value Method 26

t Test for µ: Critical-Value Method 26

t Test for µ: p-Value Method t Test for the Population Mean µ: p-Value

t Test for µ: p-Value Method t Test for the Population Mean µ: p-Value Method When a random sample of size n is taken from a population, you can use the t test if either the population is normal or the sample size is large (n ≥ 30). Step 1: State the hypotheses and the rejection rule. Step 2: Calculate tdata: Step 3: Find the p-value with technology or a table. Step 4: State the conclusion and the interpretation. If the p-value ≤ α, then reject H 0. Otherwise do not reject H 0. 27

t Test for µ: p-Value Method 28

t Test for µ: p-Value Method 28

Using Confidence Intervals to Perform Two-Tailed t Tests Equivalence of a Two-Tailed Hypothesis Test

Using Confidence Intervals to Perform Two-Tailed t Tests Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval • If a certain value for µ 0 lies outside the corresponding 100(1 – α)%t confidence interval for µ, then the null hypothesis specifying this value for µ 0 would be rejected for level of significance α. • Alternatively, if a certain value for µ 0 lies inside the corresponding 100(1 – α)%t confidence interval for µ, then the null hypothesis specifying this value for µ 0 would not be rejected for level of significance α. 29

+ 9. 5: Z Test for the Population Proportion Objectives: Perform the Z test

+ 9. 5: Z Test for the Population Proportion Objectives: Perform the Z test for p using the critical-value method. ü ü Carry out the Z test for p using the p-value method. Use confidence intervals for p to perform two-tailed hypothesis tests about p. ü 30

Z Test for p: Critical-Value Method So far, we have dealt with testing hypotheses

Z Test for p: Critical-Value Method So far, we have dealt with testing hypotheses about the population mean µ only. In this section, we learn how to perform the Z test for the population proportion p. For our point estimate of the unknown parameter p, we use the sample proportion p-hat: The Essential Idea About Hypothesis Testing for the Proportion When the sample proportion p-hat is unusual or extreme in the sampling distribution that assumes H 0 is correct, we should reject H 0. Otherwise, there is insufficient evidence against H 0 and we should not reject H 0. 31

32 The Critical-Value Method Table of Critical Values for Common Levels of Significance H

32 The Critical-Value Method Table of Critical Values for Common Levels of Significance H 0: p = p 0 Ha: p > p 0 H 0: p = p 0 Ha: p < p 0 α = 0. 10 Zcrit = 1. 28 Zcrit = -1. 28 Zcrit = 1. 645 α = 0. 05 Zcrit = 1. 645 Zcrit = -1. 645 Zcrit = 1. 96 α = 0. 01 Zcrit = 2. 33 Zcrit = -2. 33 Zcrit = 2. 58 Reject if Zdata ≥ Zcrit Zdata ≤ -Zcrit or Zdata ≥ Zcrit H 0: p = p 0 Ha: p ≠ p 0

Z Test for p: Critical-Value Method Z Test for the Population Proportion p: Critical-Value

Z Test for p: Critical-Value Method Z Test for the Population Proportion p: Critical-Value Method When a random sample of size n is taken from a population, you can use the Z test for the proportion if both the normality conditions are satisfied: np 0 ≥ 5 and n(1 – p 0) ≥ 5 Step 1: State the hypotheses. Step 2: Find Zcrit and state the rejection rule. Step 3: Calculate Zdata: Step 4: State the conclusion and the interpretation. If Zdata falls in the critical region, then reject H 0, otherwise do not reject H 0. 33

Z Test for p: p-Value Method The p-value method for the z test for

Z Test for p: p-Value Method The p-value method for the z test for p is equivalent to the critical-value method. The p-values are defined similarly to those for the z test for µ. Z Test for the Population Proportion p: p-Value Method When a random sample of size n is taken from a population, you can use the Z test for the proportion if both the normality conditions are satisfied: np 0 ≥ 5 and n(1 – p 0) ≥ 5 Step 1: State the hypotheses. Step 2: Calculate Zdata: Step 3: Find the p-value with technology or a table. Step 4: State the conclusion and the interpretation. If the p-value ≤ α, then reject H 0. Otherwise do not reject H 0. 34

Using Confidence Intervals to Perform Two-Tailed z Tests Equivalence of a Two-Tailed Hypothesis Test

Using Confidence Intervals to Perform Two-Tailed z Tests Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval • If a certain value for p 0 lies outside the corresponding 100(1 – α)%Z confidence interval for p, then the null hypothesis specifying this value for p 0 would be rejected for level of significance α. • Alternatively, if a certain value for p 0 lies inside the corresponding 100(1 – α)%Z confidence interval for p, then the null hypothesis specifying this value for p 0 would not be rejected for level of significance α. 35

+ 9. 6: (Chi-Square) Test for the Population Standard Deviation χ2 Objectives: Perform the

+ 9. 6: (Chi-Square) Test for the Population Standard Deviation χ2 Objectives: Perform the χ2 test for σ using the critical-value method. ü ü Carry out the χ2 test for σ using the p-value method. Use confidence intervals for σ to perform two-tailed hypothesis tests about σ. ü 36

χ2 Test for σ: Critical-Value Method 37 In Section 8. 4, we used the

χ2 Test for σ: Critical-Value Method 37 In Section 8. 4, we used the χ2 distribution to help us construct confidence intervals for the population variance and standard deviation. Here we will use the χ2 distribution to perform hypothesis tests about the population standard deviation. Under the assumption that H 0 is true, the χ2 statistic takes the form: The Essential Idea About Hypothesis Testing for the Standard Deviation When the observed value of χ2 is unusual or extreme on the assumption that H 0 is true, we should reject H 0. Otherwise, there is insufficient evidence against H 0 and we should not reject H 0.

χ2 Test for σ: Critical-Value Method This hypothesis test is valid only if we

χ2 Test for σ: Critical-Value Method This hypothesis test is valid only if we have a random sample from a normal population. Step 1: State the hypotheses. Step 2: Find χ2 critical value or values and state the rejection rule. Step 3: Calculate χ2 data: which follows a χ2 distribution with n – 1 degrees of freedom, and where s 2 represents the sample variance. Step 4: State the conclusion and the interpretation. If χ2 data falls in the critical region, then reject H 0, otherwise do not reject H 0. 38

χ2 Test for σ: Critical-Value Method 39

χ2 Test for σ: Critical-Value Method 39

χ2 Test for σ: p-Value Method This hypothesis test is valid only if we

χ2 Test for σ: p-Value Method This hypothesis test is valid only if we have a random sample from a normal population. Step 1: State the hypotheses. Step 2: Calculate χ2 data: which follows a χ2 distribution with n – 1 degrees of freedom, and where s 2 represents the sample variance. Step 3: Find the p-value. Step 4: State the conclusion and the interpretation. If the p-value ≤ α, then reject H 0. Otherwise do not reject H 0. 40

χ2 Test for σ: p-Value Method 41

χ2 Test for σ: p-Value Method 41

Using Confidence Intervals to Perform Two-Tailed χ2 Tests Equivalence of a Two-Tailed Hypothesis Test

Using Confidence Intervals to Perform Two-Tailed χ2 Tests Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval • If a certain value for σ0 lies outside the corresponding 100(1 – α)% confidence interval for σ, then the null hypothesis specifying this value for σ0 would be rejected for level of significance α. • Alternatively, if a certain value for σ0 lies inside the corresponding 100(1 – α)% confidence interval for σ, then the null hypothesis specifying this value for σ0 would not be rejected for level of significance α. 42

+ 9. 7: Probability of Type II Error and The Power of a Hypothesis

+ 9. 7: Probability of Type II Error and The Power of a Hypothesis Test Objectives: Calculate the probability of a Type II error for a Z test for µ. ü ü Compute the power of a Z test for µ. 43

β Probability of a Type II Error Calculating β, the Probability of a Type

β Probability of a Type II Error Calculating β, the Probability of a Type II Error Step 1: Recall that Zcrit divides the critical region from the noncritical region. Let xbarcrit be the value of the sample mean associated with Zcrit. Here µ 0 is the hypothesized value of the population mean, σ is the population standard deviation, and n is the sample size. 44

β Probability of a Type II Error Calculating β, the Probability of a Type

β Probability of a Type II Error Calculating β, the Probability of a Type II Error Step 2: Here µ 0 represents a particular value for the population mean µ chosen from the values indicated in the alternative hypothesis Ha. Draw a normal curve centered at µa, with the value or values of x-barcrit from Step 1. Step 3: Calculate β for the particular µ 0, chosen using the following table: Form of test β = probability of Type II Error Right-tailed The area under the normal curve drawn in Step 2 to the left of x-barcrit. Left-tailed The area under the normal curve drawn in Step 2 to the right of x-barcrit. Two-tailed The area under the normal curve drawn in Step 2 between x-barcrit, lower and x-barcrit, upper. 45

Power of a Hypothesis Test It is a correct decision to reject the null

Power of a Hypothesis Test It is a correct decision to reject the null hypothesis when the null hypothesis is false. The probability of making this type of correct decision is called the power of the test. Power of a Hypothesis Test The power of a hypothesis test is the probability of rejecting the null hypothesis when the null hypothesis is false. Power is calculated as power = 1 – β 46

+ Chapter 9 Overview 47 n 9. 1 Introduction to Hypothesis Testing n 9.

+ Chapter 9 Overview 47 n 9. 1 Introduction to Hypothesis Testing n 9. 2 z Test for the Population Mean: Critical-Value Method n 9. 3 z Test for the Population Mean: p-Value Method n 9. 4 t Test for the Population Mean µ n 9. 5 z Test for the Population Proportion p n 9. 6 Chi-Square Test for the Population Standard Deviation σ n 9. 7 Probability of Type II Error and the Power of the Hypothesis Test