Bennie D Waller, Longwood University Hypothesis testing Bennie Waller [email protected]...

25
Bennie D Waller, Longwood University Hypothesis testing Bennie Waller [email protected] 434-395-2046 Longwood University 201 High Street Farmville, VA 23901

Transcript of Bennie D Waller, Longwood University Hypothesis testing Bennie Waller [email protected]...

Page 1: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis testing

Bennie Waller

[email protected]

434-395-2046Longwood University

201 High StreetFarmville, VA 23901

Page 2: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

HYPOTHESIS A statement about the value of a population parameter developed for the purpose of testing.

HYPOTHESIS TESTING A procedure based on sample evidence and probability theory to determine whether the hypothesis is a reasonable statement.

10-2

Hypothesis Testing

Page 3: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Important Things to Remember about H0 and H1

• H0 is always presumed to be true • H1 has the burden of proof • A random sample (n) is used to “reject H0” • If we conclude 'do not reject H0', this does not necessarily

mean that the null hypothesis is true, it only suggests that there is not sufficient evidence to reject H0; rejecting the null hypothesis then, suggests that the alternative hypothesis may be true.

• Equality is always part of H0 (e.g. “=” , “≥” , “≤”). • “≠” “<” and “>” always part of H1

10-3

Hypothesis Testing

Page 4: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

10-4

Hypothesis TestingHypothesis Setups for Testing a Mean ()

Tests Concerning Proportion

Page 5: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

One-tail vs. Two-tail Test

10-5

Hypothesis Testing

Page 6: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis TestingDominos

Mean 32

Variance 40

N 35

Std. error 1.07

T-value 1.87

𝑍=32− 30

√ 4035

=2

1.07=1.87

H0: µD = 30H1: µD ≠ 30

@ .10 level Z=1.645@ .05 level Z=1.96@ .01 level Z=2.33

Page 7: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis Testing

Dominos

Mean 32

Variance 40

N 35

Std. error 1.07

T-value 1.87

𝑍=32− 30

√ 4035

=2

1.07=1.87

@ .05 level Z=1.645H0: µD ≤ 30

H1: µD > 30

Page 8: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

10-8

Hypothesis Testing

Page 9: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis TestingProblem: The waiting time for patients at local walk-in health clinic follows a normal distribution with a mean of 15 minutes and a population standard deviation of 5 minutes. The quality-assurance department found in a sample of 50 patients that the mean waiting time was 14.25 minutes. At the 0.025 significance level, decide if the sample data support the claim that the mean waiting time is less than 15 minutes. State your decision in terms of the null hypothesis. 

z 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09

1.4 0.4192 0.4207 0.4222 0.4236 0.4251 0.4265 0.4279 0.4292 0.4306 0.4319

1.5 0.4332 0.4345 0.4357 0.4370 0.4382 0.4394 0.4406 0.4418 0.4429 0.4441

1.6 0.4452 0.4463 0.4474 0.4484 0.4495 0.4505 0.4515 0.4525 0.4535 0.4545

1.7 0.4554 0.4564 0.4573 0.4582 0.4591 0.4599 0.4608 0.4616 0.4625 0.4633

1.8 0.4641 0.4649 0.4656 0.4664 0.4671 0.4678 0.4686 0.4693 0.4699 0.4706

1.9 0.4713 0.4719 0.4726 0.4732 0.4738 0.4744 0.4750 0.4756 0.4761 0.4767

2.0 0.4772 0.4778 0.4783 0.4788 0.4793 0.4798 0.4803 0.4808 0.4812 0.4817

Page 10: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis Testing

Problem: A manufacturer wants to increase the shelf life of a line of cake mixes. Past records indicate that the average shelf life of the mix is 216 days. After a revised mix has been developed, a sample of nine boxes of cake mix had a mean of 217.222 and a standard deviation of 1.2019. At the 0.025 significance level, decide if the sample data support the claim that shelf life has increased. State your decision in terms of the null hypothesis.

Page 11: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Hypothesis testing – Two samples

Bennie Waller

[email protected]

434-395-2046Longwood University

201 High StreetFarmville, VA 23901

Page 12: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis Testing

H0: µPJ = µD

H1: µPJ ≠ µD

H0: µPJ - µD = 0H1: µPJ - µD ≠ 0

Setting up a hypothesis test to see if there is a difference between the average delivery time of two pizza delivery companies.

H0: µPJ - µD = 5H1: µPJ - µD ≠ 5

Can test for difference in any value. Typically

test for zero.

Page 13: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis Testing

H0: µPJ ≤ µD

H1: µPJ > µD

H0: µD ≥ µPJ

H1: µD < µPJ

H0: µPJ - µD ≤ 0

H1: µPJ - µD > 0

Setting up a hypothesis test to see if there is a difference between the average delivery time of two pizza delivery companies.

Page 14: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis Testing

Comparing Two Population Means - Example

Step 1: State the null and alternate hypotheses.

H0: µPJ ≤ µD

H1: µPJ > µD

Step 2: Select the level of significance.

For example a .01 significance level.

Step 3: Determine the appropriate test statistic.

If the population standard deviations are known, use z-distribution as the test statistic, otherwise use t-statistic.

Page 15: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Step 4: Formulate a decision rule.

Reject H0 if Z > Z

Z > 2.33

11-15

Two-Sample Hypothesis Testing

Page 16: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Comparing Two Population Means: Equal Variances

• No assumptions about the shape of the populations are required.• The samples are from independent populations.• The formula for computing the value of z is:

2

22

1

21

21

21 unknown are and if and

30 sizes sample if Use

ns

ns

XXz

2

22

1

21

21

21 known are and ifor

30 sizes sample if Use

nn

XXz

11-16

Two-Sample Hypothesis Testing

Page 17: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis TestingDominos Papa Johns

Mean 35 38

Variance 60 48

N 35 40

Variance/N 1.71 1.2

Std. error 1.707

T-value -1.76

𝑍=35 −38

√ 6035

+4840

=−31.71

=− 1.76

H0: µPJ - µD = 0H1: µPJ - µD ≠ 0

@ .10 level Z=1.645@ .05 level Z=1.96@ .01 level Z=2.33

Page 18: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis Testing

Dominos Papa Johns

Mean 35 38

Variance 60 48

N 35 40

Variance/N 1.71 1.2

Std. error 1.707

T-value -1.76

𝑍=35 −38

√ 6035

+4840

=−31.71

=− 1.76

H0: µD ≥ µPJ

H1: µD < µPJ

@ .05 level Z=1.645@ .01 level Z=2.33

Page 19: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Two-Sample Hypothesis Testing

Page 20: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Comparing Population Means with Equal but Unknown Population Standard Deviations (the Pooled t-test)

The t distribution is used as the test statistic if one or more of the samples have less than 30 observations. The required assumptions are:

1. Both populations must follow the normal distribution.

2. The populations must have equal standard deviations.

3. The samples are from independent populations.

11-20

Two-Sample Hypothesis Testing

Page 21: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Finding the value of the test statistic requires two steps.

1. Pool the sample standard deviations.

2. Use the pooled standard deviation in the formula.

2

)1()1(

21

222

2112

nn

snsnsp

21

2

21

11

nns

XXt

p

11-21

Two-Sample Hypothesis Testing

Page 22: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) - Example

Step 1: State the null and alternate hypotheses.

(Keyword: “Is there a difference”)

H0: µ1 = µ2

H1: µ1 ≠ µ2

Step 2: State the level of significance. The 0.10 significance level is stated in the problem.

Step 3: Find the appropriate test statistic.

Because the population standard deviations are not known but are assumed to be equal, we use the pooled t-test.

11-22

Two-Sample Hypothesis Testing

Page 23: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Comparing Population Means with Unknown Population Standard Deviations (the Pooled t-test) - Example

Step 4: State the decision rule.

Reject H0 if t > t/2,n1+n2-2 or t < - t/2, n1+n2-2

t > t.05,9 or t < - t.05,9

t > 1.833 or t < - 1.833

11-23

Two-Sample Hypothesis Testing

Page 24: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

Problem: A financial planner wants to compare the yield of income and growth mutual funds. Fifty thousand dollars is invested in each of a sample of 35 income and 40 growth funds. The mean increase for a two-year period for the income funds is $900. For the growth funds the mean increase is $875. Income funds have a sample standard deviation of $35; growth funds have a sample standard deviation of $45. Assume that the population standard deviations are equal. At the 0.05 significance level, is there a difference in the mean yields of the two funds?

What decision is made about the null hypothesis using alpha = 0.05?

Two-Sample Hypothesis Testing

Page 25: Bennie D Waller, Longwood University Hypothesis testing Bennie Waller wallerbd@longwood.edu 434-395-2046 Longwood University 201 High Street Farmville,

Bennie D Waller, Longwood University

End