 # Hypothesis Testing 7.

## Presentation on theme: "Hypothesis Testing 7."— Presentation transcript:

Hypothesis Testing 7

Useful videos/websites:
Video on writing hypothesis statements: Overview Video on hypothesis testing: Difference between Type I and II Errors:

Introduction to Hypothesis Testing
Section 7.1 Introduction to Hypothesis Testing

Definition A hypothesis is a statement or claim regarding a characteristic of one or more populations. L1 Writing Hypothesis Statements

What do you mean by “claim”?

What do you mean by “claim”?
Let’s measure the raisins in each box with a random variable, x. H0: mu = 2 scoops H1: mu not = 2 scoops Which one is the claim?

Null hypothesis H0 contains a statement of equality such as ³ , = or £. Alternative hypothesis Ha or H1 contains a statement of inequality such as < , ¹ or > For example: H0: Mr. Smith is innocent of the crime. H1: Mr. Smith is guilty of the crime. `

Writing Hypotheses Write the claim about the population. Then, write its complement. Note: Either hypothesis, the null or the alternative, can represent the claim.

Writing Hypotheses claim claim
Write the claim about the population. Then, write its complement. Either hypothesis, the null or the alternative, can represent the claim. A hospital claims its ambulance response time is less than 10 minutes. claim A consumer magazine claims the proportion of cell phone calls made during evenings and weekends is at most 60%. claim

Four Outcomes Type II Error Correct Type I Error Correct
H0: Mr. Smith is innocent of the crime. H1: Mr. Smith is guilty of the crime.

Hypothesis Testing Errors
Type I error: Reject a true Null hypothesis (i.e. innocent person found guilty) α = alpha = probability of Type I error Type II error: Do not reject a false Null hypothesis (i.e. guilty man goes free) β = beta = probability of Type II error

Two-tailed vs. One-tailed tests
1. two-tailed test: Equal versus not equal hypothesis Ho: parameter = some value H1: parameter some value 2. left-tailed test: Equal versus less than Ho: parameter = some value (or greater) 3. right-tailed test: Equal versus greater than Ho: parameter = some value (or less) H1: parameter some value

Types of Hypothesis Tests
Right-tail test Ha is more probable Left-tail test Ha is more probable Ha is more probable Two-tail test

One-tailed or two? A university publicizes that the proportion of its students who graduate in 4 years is 82%. Solution: H0: Ha: p = 0.82 z -z ½ P-value area p ≠ 0.82 Two-tailed test

One-tailed or two? A water faucet manufacturer announces that the mean flow rate of a certain type of faucet is less than 2.5 gallons per minute. Solution: z -z P-value area H0: Ha: μ ≥ 2.5 gpm μ < 2.5 gpm Left-tailed test

One-tailed or two? A cereal company advertises that the mean weight of the contents of its 20-ounce size cereal boxes is more than 20 ounces. Solution: z P-value area H0: Ha: μ ≤ 20 oz μ > 20 oz Right-tailed test

Hypothesis Test Strategy
1. Begin by assuming the equality condition in the null hypothesis is true. This is regardless of whether the claim is represented by the null hypothesis or by the alternative hypothesis. 2. Collect data from a random sample taken from the population and calculate the necessary sample statistics. 3. If the sample statistic has a low probability of being drawn from a population in which the null hypothesis is true, you will reject H0. (As a consequence, you will support the alternative hypothesis.) 4. If the probability is not low enough, fail to reject H0.

Two Methods: P-value Method – uses the probability of obtaining a sample statistics with a value as extreme (or more) than the one determined by sample data. Critical Value Method – define a ‘rejection region’ using a critical value (similar to the critical z).

P-values P-value (or probability value)
The probability, if the null hypothesis is true, of obtaining a sample statistic with a value as extreme or more extreme than the one determined from the sample data. Depends on the nature of the test. Larson/Farber 4th ed.

P-values P-value = indicated area z z z z
The P-value is the probability of obtaining a sample statistic with a value as extreme or more extreme than the one determined by the sample data. P-value = indicated area Area in left tail Area in right tail z z For a right tail test For a left tail test If z is negative, twice the area in the left tail If z is positive, twice the area in the right tail z z For a two-tail test

Finding P-values: 1-tail Test
The test statistic for a right-tail test is z = Find the P-value. Area in right tail z = 1.56 Answer: The area to the right of z = 1.56 is 1 – = The P-value is

Finding P-values: 2-tail Test
The test statistic for a two-tail test is z = –2.63. Find the corresponding P-value. z = –2.63 Answer: The area to the left of z = –2.63 is The P-value is 2(0.0043) =

P-value Method In Words In Symbols
State the claim mathematically and verbally. Identify the null and alternative hypotheses. Specify the level of significance. Determine the standardized test statistic. Find the area that corresponds to z. State H0 and Ha. Identify . Use Table 4 in Appendix B.

P-value Method – Part II
In Words In Symbols Find the P-value. For a left-tailed test, P = (Area in left tail). For a right-tailed test, P = (Area in right tail). For a two-tailed test, P = 2(Area in tail of test statistic). Make a decision to reject or fail to reject the null hypothesis. Interpret the decision in the context of the original claim. Reject H0 if P-value is less than or equal to . Otherwise, fail to reject H0.

1. Identify Hypothesis and indicate which one is the claim.
Ha : 2. Identify level of significance  = 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. Use preferred method for finding area in tail. 5. Find the P-value For a one-tailed test, P = (Area in left tail). For a two-tailed test, P = 2(Area in tail). 6. Make a Decision Reject H0 if p-value <= , otherwise fail to reject. 7. Interpret the decision in the context of the original claim.

Example: Hypothesis Testing Using P-values
You think that the average franchise investment information shown in the graph is incorrect, so you randomly select 30 franchises and determine the necessary investment for each. The sample mean investment is \$135,000 with a standard deviation of \$30,000. Is there enough evidence to support your claim at  = 0.05? Use the P-value method.

1. Identify Hypothesis and indicate which one is the claim.
2. Identify level of significance  = 0.05 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. 5. Find the P-value 6. Make a Decision 7. Interpret the decision in the context of the original claim. H0 is claim

Solution: Hypothesis Testing Using P-values
z -1.51

1. Identify Hypothesis and indicate which one is the claim.
2. Identify level of significance  = 0.05 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. 5. Find the P-value 6. Make a Decision 7. Interpret the decision in the context of the original claim. H0 is claim

Solution: Hypothesis Testing Using P-values
= z -1.51 0.0655

1. Identify Hypothesis and indicate which one is the claim.
2. Identify level of significance  = 0.05 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z. Area to the left of is equal to 5. Find the P-value P = 2(.0655) because this is a two-tailed test. P = .1310 6. Make a Decision Since > , we fail to reject H0. 7. Interpret the decision in the context of the original claim. Since the claim was that the average (mu) was equal to \$143,260, we say “there is not enough evidence to reject the claim”. H0 is claim

Example: Testing with P-values
Employees in a large accounting firm claim that the mean salary of the firm’s accountants is less than that of its competitor’s, which is \$45,000. A random sample of 30 of the firm’s accountants has a mean salary of \$43,500 with a standard deviation of \$5200. At α = 0.05, test the employees’ claim.

H0: Mu = \$45,000 (or more) H1: Mu < \$45,000 (left-tailed test)
Alpha = .05 Xbar = \$43,500, Sx = \$5200 (Since n >= 30, we can use a z-statistic) Compute z-statistic (See pg 387) z = -1.58 Find the P-value: P(z <= -1.58) = Since the P-value of is NOT less than or equal to alpha (.05), we DO NOT REJECT H0 There is not sufficient evidence to support the claim that the mean salary is less than \$45,000

Test Decisions with P-values
The decision about whether there is enough evidence to reject the null hypothesis can be made by comparing the P-value to the value of , the level of significance of the test. If reject the null hypothesis. If fail to reject the null hypothesis.

Interpreting the Decision
Claim Claim is H0 Claim is Ha There is enough evidence to support the claim. There is enough evidence to reject the claim. Reject H0 Decision There is not enough evidence to support the claim. There is not enough evidence to reject the claim. Fail to reject H0

Critical Value method In Words In Symbols
State the claim mathematically and verbally. Identify the null and alternative hypotheses. Specify the level of significance. Find the standardized test statistic Determine the critical value(s) & rejection region(s). Use Table 4 in Appendix B.

Critical Value Z method – Part II
In Words In Symbols 5. Make a decision to reject or fail to reject the null hypothesis. Interpret the decision in the context of the original claim. If z is in the rejection region, reject H0. Otherwise, fail to reject H0. Larson/Farber 4th ed.

Rejection Regions and Critical Values
Rejection region (or critical region) The range of values for which the null hypothesis is not probable. If a test statistic falls in this region, the null hypothesis is rejected. A critical value z0 separates the rejection region from the nonrejection region.

Rejection Regions and Critical Values
Finding Critical Values in a Normal Distribution Specify the level of significance . Decide whether the test is left-, right-, or two-tailed. Find the critical value(s) z0. If the hypothesis test is left-tailed, find the z-score that corresponds to an area of , right-tailed, find the z-score that corresponds to an area of 1 – , two-tailed, find the z-score that corresponds to ½ and 1 – ½. Sketch the standard normal distribution. Draw a vertical line at each critical value and shade the rejection region(s).

Example: Finding Critical Values
Find the critical value and rejection region for a two-tailed test with  = 0.05. Solution: 1 – α = 0.95 z z0 ½α = 0.025 ½α = 0.025 -z0 = -1.96 z0 = 1.96 The rejection regions are to the left of -z0 = and to the right of z0 = 1.96.

Decision Rule Based on Rejection Region
To use a rejection region to conduct a hypothesis test, calculate the standardized test statistic, z. If the standardized test statistic is in the rejection region, then reject H0. is not in the rejection region, then fail to reject H0. z z0 Fail to reject H0. Reject H0. Left-Tailed Test z < z0 z z0 Reject Ho. Fail to reject Ho. z > z0 Right-Tailed Test z z0 Two-Tailed Test z0 z < -z0 z > z0 Reject H0 Fail to reject H0

Example: Testing with Critical Value
Employees in a large accounting firm claim that the mean salary of the firm’s accountants is less than that of its competitor’s, which is \$45,000. A random sample of 30 of the firm’s accountants has a mean salary of \$43,500 with a standard deviation of \$5200. At α = 0.05, test the employees’ claim.

Example – Critical Z H0: Ha:  = Rejection Region: μ ≥ \$45,000
μ < \$45,000 Test Statistic 0.05 Decision: Fail to reject H0 z 0.05 At the 5% level of significance, there is not sufficient evidence to support the employees’ claim that the mean salary is less than \$45,000. -1.58 Zc=-1.645

Hypothesis Testing for the Mean
Section 7.2 Hypothesis Testing for the Mean Large Samples (n  30)

The z-Test for a Mean When n  30, use s in place of .
The z-test is a statistical test for a population mean. The z-test can be used: (1) if the population is normal and s is known or (2) when the sample size, n, is at least 30. The test statistic is the sample mean and the standardized test statistic is z. When n  30, use s in place of .

The z-Test for a Mean (P-value)
A cereal company claims the mean sodium content in one serving of its cereal is no more than 230 mg. You work for a national health service and are asked to test this claim. You find that a random sample of 52 servings has a mean sodium content of 232 mg and a standard deviation of 10 mg. At = 0.05, do you have enough evidence to reject the company’s claim? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05 3. Determine the sampling distribution. Since the sample size is at least 30, the sampling distribution is normal.

4. Find the test statistic and standardize it.
5. Calculate the P-value for the test statistic. Since this is a right-tail test, the P-value is the area found to the right of z = 1.44 in the normal distribution. From the table P = 1 – Area in right tail P = z = 1.44

6. Make your decision. Compare the P-value to . Since > 0.05, fail to reject H0. 7. Interpret your decision. There is not enough evidence to reject the claim that the mean sodium content of one serving of its cereal is no more than 230 mg.

The z-Test for a Mean (Critical Value)
A cereal company claims the mean sodium content in one serving of its cereal is no more than 230 mg. You work for a national health service and are asked to test this claim. You find that a random sample of 52 servings has a mean sodium content of 232 mg and a standard deviation of 10 mg. At = 0.05, do you have enough evidence to reject the company’s claim? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05 3. Determine the sampling distribution. Since the sample size is at least 30, the sampling distribution is normal.

5. Find the rejection region.
Since Ha contains the > symbol, this is a right-tail test. Rejection region 4. Find the critical value. 5. Find the rejection region. z0 1.645 6. Find the test statistic and standardize it. n = = s = 10 7. Make your decision. z = 1.44 does not fall in the rejection region, so fail to reject H0 8. Interpret your decision. There is not enough evidence to reject the company’s claim that there is at most 230 mg of sodium in one serving of its cereal.

Using the P-value of a Test to Compare Areas
Area to the left of z 0.1093 = 0.05 z0 = –1.645 Rejection area 0.05 z = –1.23 P = z0 z For a P-value decision, compare areas. If reject H0. If fail to reject H0. For a critical value decision, decide if z is in the rejection region If z is in the rejection region, reject H0. If z is not in the rejection region, fail to reject H0.

Hypothesis Testing for the Mean
Section 7.3 Hypothesis Testing for the Mean Small Samples (n < 30)

The t Sampling Distribution
Find the critical value t0 for a left-tailed test given = 0.01 and n = 18. Area in left tail d.f. = 18 – 1 = 17 t0 = –2.567 t0 Find the critical values –t0 and t0 for a two-tailed test given = 0.05 and n = 11. –t0 = –2.228 and t0 = 2.228 d.f. = 11 – 1 = 10 t0 t0

Testing –Small Sample = 0.01
A university says the mean number of classroom hours per week for full-time faculty is A random sample of the number of classroom hours for full-time faculty for one week is listed below. You work for a student organization and are asked to test this claim. At = 0.01, do you have enough evidence to reject the university’s claim? 1. Write the null and alternative hypothesis 2. State the level of significance = 0.01 3. Determine the sampling distribution Since the sample size is 8, the sampling distribution is a t-distribution with 8 – 1 = 7 d.f.

Since Ha contains the ≠ symbol, this is a two-tail test.
4. Find the critical values. 5. Find the rejection region. –t0 t0 –3.499 3.499 6. Find the test statistic and standardize it n = = s = 2.485 7. Make your decision. t = –1.08 does not fall in the rejection region, so fail to reject H0 at = 0.01 8. Interpret your decision. There is not enough evidence to reject the university’s claim that faculty spend a mean of 11 classroom hours.

Hypothesis Testing for Proportions
Section 7.4 Hypothesis Testing for Proportions

Test for Proportions p is the population proportion of successes. The test statistic is (the proportion of sample successes) If and the sampling distribution for is normal. The standardized test statistic is:

Test for Proportions - Example
A communications industry spokesperson claims that over 40% of Americans either own a cellular phone or have a family member who does. In a random survey of 1036 Americans, 456 said they or a family member owned a cellular phone. Test the spokesperson’s claim at = What can you conclude? 1. Write the null and alternative hypothesis. 2. State the level of significance. = 0.05

n = 1036 x = 456 3. Determine the sampling distribution.
1036(.40) > 5 and 1036(.60) > 5. The sampling distribution is normal. 4. Find the critical value. Rejection region 5. Find the rejection region. 1.645 6. Find the test statistic and standardize it. n = x = 456 7. Make your decision. z = 2.63 falls in the rejection region, so reject H0 8. Interpret your decision. There is enough evidence to support the claim that over 40% of Americans own a cell phone or have a family member who does.

The End

1. State the null and alternative hypotheses.
A company claims the mean lifetime of its AA batteries is more than 16 hours. H0: μ > 16 Ha: μ ≤ 16 H0: μ < 16 Ha: μ ≥ 16 H0: μ ≤ 16 Ha: μ > 16 H0: μ ≥ 16 Ha: μ < 16 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

2. State the null and alternative hypotheses.
A student claims the mean cost of a textbook is at least \$125. H0: μ > Ha: μ ≤ 125 H0: μ < Ha: μ ≥ 125 H0: μ ≤ Ha: μ > 125 H0: μ ≥ Ha: μ < 125 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

There is enough evidence to reject the claim.
3. You are testing the claim that the mean cost of a new car is more than \$25,200. How should you interpret a decision that rejects the null hypothesis? There is enough evidence to reject the claim. There is enough evidence to support the claim. There is not enough evidence to reject the claim. There is not enough evidence to support the claim. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

True or false: Given H0: μ = 40 Ha: μ ≠ 40 and P = You would reject the null hypothesis at the 0.05 level of significance. True False Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley