Week 7 - Seminar

Download Report

Transcript Week 7 - Seminar

7

Hypothesis Testing

Useful videos/websites:

Video on writing hypothesis statements: http://screencast.com/t/ZO8kMt6v Overview Video on hypothesis testing: http://screencast.com/t/qdz8F0yp Difference between Type I and II Errors: http://screencast.com/t/fhWKC3ypM8

Section 7.1

Introduction to Hypothesis Testing

Definition

A

hypothesis

is a statement or claim regarding a characteristic of one or more populations.

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 H 0

contains a statement of equality such as  , = or  .

Alternative hypothesis H a

or

H

1

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

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

Correct Type I Error Type II 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 H o: parameter = some value H 1: parameter some value 2. left-tailed test: Equal versus less than 3. right-tailed test: Equal versus greater than H H o: parameter = some value (or greater) 1: parameter some value H H o: parameter = some value (or less) 1: parameter some value

Types of Hypothesis Tests

Right-tail test

H a is more probable H a is more probable H a is more probable

Left-tail test Two-tail test

One-tailed or two?

1. A university publicizes that the proportion of its students who graduate in 4 years is 82%.

Solution:

H

0 :

H

a :

p p

= 0.82

≠ 0.82

Two-tailed test ½ P-value area -z 0 z ½ P-value area

z

14

One-tailed or two?

2. 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:

H

0

H

a : : μ ≥ 2.5 gpm μ < 2.5 gpm Left-tailed test P-value area -z 0

z

One-tailed or two?

3. A cereal company advertises that the mean weight of the contents of its 20-ounce size cereal boxes is more than 20 ounces.

Solution:

H

0

H

a : : μ ≤ 20 oz μ > 20 oz Right-tailed test 0 z P-value ar ea

z

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 H 0

. (As a consequence, you will support the alternative hypothesis.) 4. If the probability is not low enough,

fail to reject H 0

.

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. 19 Larson/Farber 4th ed.

P-values

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

For a left tail test If

z

is negative, twice the area in the left tail

z z

For a two-tail test

z

For a right tail test If

z

is positive, twice the area in the right tail

Finding P-values: 1-tail Test

The test statistic for a right-tail test is

z

= 1.56. Find the P-value.

Area in right tail

z

= 1.56

Answer: The area to the right of

z

The P-value is 0.0594.

= 1.56 is 1 – .9406 = 0.0594.

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 0.0043.

The P-value is 2(0.0043) = 0.0086.

P-value Method

1.

In Words

State the claim mathematically and verbally. Identify the null and alternative hypotheses.

2.

Specify the level of significance.

3.

Determine the standardized test statistic.

4.

Find the area that corresponds to

z

.

In Symbols

State

H

0 and

H

a . Identify  .

z

 

x

 

n

Use Table 4 in Appendix B.

23

P-value Method – Part II

5.

6.

7.

In Words In Symbols

Find the

P

-value.

a.

For a left-tailed test,

P

= (Area in left tail).

b.

c.

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.

Reject

H

0 if

P

-value is less than or equal to 

.

Otherwise, fai l to reject

H

0 .

Interpret the decision in the context of the original claim.

24

1. Identify Hypothesis and indicate which one is the claim.

H 0 H a : :

2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.]

=

z

 

x

 

n

4. Find the area corresponding to z. Use preferred method for finding area in tail. 5. Find the P-value a.

b.

For a one-tailed test, P = (Area in left tail).

For a two-tailed test, P = 2(Area in tail).

6. Make a Decision 7. Interpret the decision in the context of the original claim. Reject H0 if p-value <= , otherwise fail to reject.

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.

26

1. Identify Hypothesis and indicate which one is the claim. 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z.

= 0.05

x

 $135, 000 5. Find the P-value 6. Make a Decision 7. Interpret the decision in the context of the original claim. H0 is claim

z

 

x

 

n

Solution: Hypothesis Testing Using

P

-values

z

 

x

 

n

 30, 000   1.51

30 •

P-value

-1.51

0

z

1. Identify Hypothesis and indicate which one is the claim. 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z.

z

= 0.05

 

x

 

n

 5. Find the P-value 30, 000 30 H0 is claim   1.51

6. Make a Decision 7. Interpret the decision in the context of the original claim.

Solution: Hypothesis Testing Using

P

-values

z

 

x

 

n

 30, 000   1.51

30 •

P-value

0.0655

-1.51

0

P

= 2(0.0655) = 0.1310

z

30

1. Identify Hypothesis and indicate which one is the claim. H0 is claim 2. Identify level of significance 3. Compute the test statistic. [Depends on what parameter is being tested.] 4. Find the area corresponding to z.

z

= 0.05

x

 

n

   1.51

30, 000 30

Area to the left of -1.51 is equal to 0.0655

5. Find the P-value

P = 2(.0655) because this is a two-tailed test.

P = .1310

6. Make a Decision 7. Interpret the decision in the context of the original claim.

Since .1310 > , we fail to reject H0. Since the claim was that the average (mu) was equal to $143,260, we say “there is not enough evidence to reject the 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.

32

1.

H0: Mu = $45,000 (or more) H1: Mu < $45,000 (left-tailed test) 2.

Alpha = .05

3.

Xbar = $43,500, Sx = $5200 (Since n >= 30, we can use a z-statistic) 4.

Compute z-statistic (See pg 387) z = -1.58

5.

Find the P-value: P(z <= -1.58) = .0571

6.

Since the P-value of .0571 is NOT less than or equal to alpha (.05), we DO NOT REJECT H0 7.

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

Reject H 0 There is enough evidence to

reject

the claim.

Fail to reject H 0 Claim is H 0 There is not enough evidence to

reject

the claim.

Claim is H a There is enough evidence to

support

the claim.

There is not enough evidence to

support

the claim.

Critical Value method

1.

In Words

State the claim mathematically and verbally. Identify the null and alternative hypotheses.

2.

Specify the level of significance.

3.

Find the standardized test statistic 4.

Determine the critical value(s) & rejection region(s).

In Symbols

z

 

x

  or if

n

n

30 use  

s

.

Use Table 4 in Appendix B.

37

Critical Value Z method – Part II

In Words

5. Make a decision to reject or fail to reject the null hypothesis.

In Symbols

If

z

is in the rejection region, reject

H

0 . Otherwise, fail to reject

H

0 .

6.

Interpret the decision in the context of the original claim.

Larson/Farber 4th ed.

38

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

z

0 separates the rejection region from the nonrejection region. 39

Rejection Regions and Critical Values

Finding Critical Values in a Normal Distribution

1.

Specify the level of significance  .

2.

Decide whether the test is left-, right-, or two-tailed.

3.

4.

Find the critical value(s)

z

0 . If the hypothesis test is

a.

left-tailed

, find the

z

-score that corresponds to an area o f  ,

b.

c.

right-tailed

, find the

z

-score that corresponds to an area of 1 –  ,

two-tailed

, find the

z

-score that corresponds to ½  1 – ½ 

.

and Sketch the standard normal distribution. Draw a vertical li ne at each critical value and shade the rejection region(s).

40

Example: Finding Critical Values

Find the critical value and rejection region for a two-tailed test with  = 0.05.

Solution:

1 – α = 0.95

½ α = 0.025

½ α = 0.025

-z

0 =

z

0 0

z

0

z

0 1.96

z

The rejection regions are to the left of -

z

0 to the right of

z

0 = 1.96.

= -1.96 and 41

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 1.

2.

is in the rejection region, then reject

H

0 .

is

not

in the rejection region, then fail to reject

H

0 .

Fail to reject

H

0.

Fail to reject

H

o.

Reject

H

0.

z

<

z

0

z

0 0

Left-Tailed Test

z

Fail to reject

H

0 Reject

H

0

z

< -

z

z

0 0 0

z

0 Reject

H

0

z z z

0 Reject

H

o.

0

z

0

z

>

z z

0

Right-Tailed Test

42

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.

43

• • • •

H 0

: μ ≥ $45,000

H a

:

= μ < $45,000 0.05

Rejection Region:

0.05

-1.58

0 Z c =-1.645

Example – Critical Z

z

z

Test Statistic

x

 

n

 43, 500 5200  45, 000 30   1.58

Decision: Fail to reject H 0

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.

44

Section 7.2

Hypothesis Testing for the Mean Large Samples (

n

30)

The z-Test for a Mean

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.

n

= 52

s

= 10 Test statistic 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 – 0.9251

P = 0.0749.

Area in right tail

z

= 1.44

6. Make your decision.

Compare the P-value to . Since 0.0749 > 0.05, fail to reject H 0 .

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.

Since H a contains the > symbol, this is a right-tail test.

Rejection region 4. Find the critical value. 5. Find the rejection region.

z

0 1.645

6. Find the test statistic and standardize it.

n

= 52 = 232

s

= 10 7. Make your decision.

z

= 1.44 does not fall in the rejection region, so fail to reject H 0 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 Rejection area 0.05

z

0

z

For a P-value decision, compare areas.

z 0 = 0.05

= –1.645

z

= –1.23

P = 0.1093

If reject H 0 . If fail to reject H 0 .

For a critical value decision, decide if

z

is in the rejection region If

z

is in the rejection region, reject H 0 . If

z

region, fail to reject H 0 .

is not in the rejection

Section 7.3

Hypothesis Testing for the Mean Small Samples (

n

< 30)

The t Sampling Distribution

Find the critical value

t

0 for a left-tailed test given and

n

= 18.

Area in left tail d.f. = 18 – 1 = 17

t

0 = –2.567 = 0.01

t

0 Find the critical values –

t

0 and

t

0 = 0.05 and

n

= 11.

for a two-tailed test given –

t

0 = –2.228 and

t

0 = 2.228 d.f. = 11 – 1 = 10

t

0

t

0

Testing –Small Sample

A university says the mean number of classroom hours per week for full-time faculty is 11.0. 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?

11.8 8.6 12.6 7.9 6.4 10.4 13.6 9.1 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 H a contains the ≠ symbol, this is a two-tail test.

4. Find the critical values. –

t

0 –3.499

t

0 3.499

6. Find the test statistic and standardize it 5. Find the rejection region.

n

= 8 = 10.050

s

= 2.485

7. Make your decision.

t

= –1.08 does not fall in the rejection region, so fail to reject H 0 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.

Section 7.4

Hypothesis Testing for Proportions

If

Test for Proportions

p

is the population proportion of successes. The test statistic is .

(the proportion of sample successes) 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 = 0.05. What can you conclude?

1. Write the null and alternative hypothesis.

2. State the level of significance.

= 0.05

3. Determine the sampling distribution.

1036(.40) > 5 and 1036(.60) > 5.

The s ampling distribution is normal.

Rejection region 4. Find the critical value. 5. Find the rejection region.

1.645

6. Find the test statistic and standardize it.

n

= 1036

x

= 456 7. Make your decision.

z

= 2.63 falls in the rejection region, so reject H 0 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.

1. State the null and alternative hypotheses.

A company claims the mean lifetime of its AA batteries is more than 16 hours.

A. H 0 : μ > 16 H a : μ ≤ 16 B. H 0 : μ < 16 H a : μ ≥ 16 C. H 0 : μ ≤ 16 H a : μ > 16 D. H 0 : μ ≥ 16 H a : μ < 16

Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 62

2. State the null and alternative hypotheses.

A student claims the mean cost of a textbook is at least $125.

A. H 0 : μ > 125 H a : μ ≤ 125 B. H 0 : μ < 125 H a : μ ≥ 125 C. H 0 : μ ≤ 125 H a : μ > 125 D. H 0 : μ ≥ 125 H a : μ < 125

Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 63

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?

A. There is enough evidence to reject the claim.

B. There is enough evidence to support the claim.

C. There is not enough evidence to reject the claim.

D. There is not enough evidence to support the claim.

Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 64

True or false: Given H 0 : μ = 40 H a : μ ≠ 40 and P = 0.0436. You would reject the null hypothesis at the 0.05 level of significance.

A. True B. False

Copyright © 2007 Pearson Education, I nc. Publishing as Pearson Addison-We sley Slide 7- 65

Answers

Answers: 1.

(C) 2.

3.

4.

(D) (B) (A)