Comparing Two Means or Two Proportions - Sections 8.3 …cathy/Math2311/Lectures/Ch… ·  ·...

Post on 28-May-2018

218 views 0 download

Transcript of Comparing Two Means or Two Proportions - Sections 8.3 …cathy/Math2311/Lectures/Ch… ·  ·...

Comparing Two Means or Two ProportionsSections 8.3 & 8.4

Cathy Poliak, Ph.D.cathy@math.uh.edu

Office hours: T Th 2:30 - 5:15 PM 620 PGH

Department of MathematicsUniversity of Houston

April 21, 2016

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 1 / 23

Outline

1 Beginning Questions

2 Comparing Two Means

3 Comparing Two Proportions

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 2 / 23

Popper Set Up

Fill in all of the proper bubbles.

Use a #2 pencil.

This is popper number 21.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 3 / 23

Steps of a Significance Test

When performing a significance test, we follow these steps:1. Check assumptions.

2. State the null and alternative hypothesis.

3. Graph the rejection region, labeling the critical values.

4. Calculate the test statistic.

5. Find the p-value. If this answer is less than the significance level,α, we can reject the null hypothesis in favor of the alternativehypothesis.

6. Give your conclusion using the context of the problem. Whenstating the conclusion give results with a confidence of(1− α)(100)%.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 4 / 23

What if we are not given α?

If the P-value for testing H0 is less than:0.1 we have some evidence that H0 is false.

0.05 we have strong evidence that H0 is false.

0.01 we have very strong evidence that H0 is false.

0.001 we have extremely strong evidence that H0 is false.

If the P-value is greater than 0.1, we do not have any evidence thatH0 is false.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 5 / 23

Popper #21 Questions

1. In a hypothesis test if the computed P-value is less than 0.001,there is very strong evidence toa) retest with a different sample.b) fail to reject the null hypothesis.c) reject the null hypothesis.d) accept the null hypothesis.

2. A one-sided significance test gives a P-value of 0.02. From thiswe cana) say that the probability that the null hypothesis is true is 0.02.b) say that the portability that the null hypothesis is false is 0.02.c) reject the null hypothesis with 99% confidence.d) reject the null hypothesis with 95% confidence.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 6 / 23

Two - Sample t-Test

Compare the responses to two treatments or characteristics oftwo populations.This is a separate sample from each treatment or population.These tests are different than the matched pairs t-test.Hypotheses

I Null - H0 : µ1 = µ2I Alternative - Ha : µ1 6= µ2 or µ1 < µ2 or µ1 > µ2

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 7 / 23

Assumptions for a Two-Sample t-Test

The goal of inference is to compare the responses in two groups.1. Each group is considered to be a simple random sample from

two distinct populations.2. The responses in each group are independent of those in the

other group.3. The distribution of the variables are Normal or have a large

sample n1 ≥ 30 and n2 ≥ 30.

Test statistic:t =

(x̄1 − x̄2)− (µ1 − µ2)√s2

1n1

+s2

2n2

With degrees of freedom equal to the smaller of n1 − 1 or n2 − 1.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 8 / 23

Comparing mean MPG

From a random sample of 45 Prius automobiles and 45 Civicautomobiles we get the following statistics:

Automobile n Sample mean x̄ Sample SD sPrius 45 47.62 2.430Civic 45 49.4 7.226

Can we say from this information that the Civic has a differentmean mpg than the Prius?

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 9 / 23

MPG hypothesis

Is the mean MPG for Prius automobiles different from mean MPG forCivic automobiles?

Null hypothesis: H0 : µPrius = µCivic

Alternative hypothesis: HA : µPrius 6= µCivic

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 10 / 23

Two-sample t test statistic

Formula:

t =estimate− hypothesized mean of estimate

SE of estimate

=(x̄1 − x̄2)− (µ1 − µ2)√

s21

n1+

s22

n2

=(x̄1 − x̄2)− 0√

s21

n1+

s22

n2

=47.62− 49.4√

2.4302

45 + 7.2262

45

= −1.5662

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 11 / 23

Two-sample t test statistic

Formula:

t =estimate− hypothesized mean of estimate

SE of estimate

=(x̄1 − x̄2)− (µ1 − µ2)√

s21

n1+

s22

n2

=(x̄1 − x̄2)− 0√

s21

n1+

s22

n2

=47.62− 49.4√

2.4302

45 + 7.2262

45

= −1.5662

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 11 / 23

Two-sample t test statistic

Formula:

t =estimate− hypothesized mean of estimate

SE of estimate

=(x̄1 − x̄2)− (µ1 − µ2)√

s21

n1+

s22

n2

=(x̄1 − x̄2)− 0√

s21

n1+

s22

n2

=47.62− 49.4√

2.4302

45 + 7.2262

45

= −1.5662

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 11 / 23

P-value and Conclusion

P − value = 2P(T < −1.5663)

In R:

2*pt(-1.5663,df=44)[1] 0.1244429

P-value = 0.1244, which is greater than 0.1 (10%). Thus we fail toreject the null hypothesis. Thus we cannot conclude that the meanMPG of Honda Civic automobiles is significantly different than themean MPG of a Toyota Prius automobile.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 12 / 23

Remediation

A study was conducted to determine whether remediation in basicmathematics enabled students to be more successful in an elementarystatistics course. Samples of final exam scores were taken fromstudents who had remediation and from students who did not. Hereare the results of the study:

Remedial Non-remedialSample size 100 40

Mean Exam Grade 83.0 76.5SD for Exam 2.76 4.11

Test, at the 5% level, whether the remediation helped the students tobe more successful.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 13 / 23

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 14 / 23

Popper #21 Questions

3. The use the two-sample t procedure to perform a significance teston the difference of two two means, we assume:a) The sample sizes are large.

b) The distributions are exactly Normal in each population.

c) The samples from each population are independent.

d) The population standard deviations are known.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 15 / 23

Two-Sample Proportion Test

When comparing two population proportions in an inference test,we use a two-sample z test for the proportions.

The hypotheses are:I Null - H0 : p1 = p2I Alternative - Ha : p1 6= p2 or p1 < p2 or p1 > p2

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 16 / 23

Assumptions for Two-Sample Proportion Test

1. Both samples must be independent SRSs from the populations ofinterest.

2. The population sizes are both at least ten times the sizes of thesamples.

3. The number of successes and failures in both sample must all beat least 10.

Test statistic:

z =(p̂1 − p̂2)− (p1 − p2)√

p̂1(1−p̂1)n1

+ p̂2(1−p̂2)n2

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 17 / 23

Left-handedness

Is the proportion of left-handed students higher in honors classes thanin academic classes? Two hundred academic and one hundred honorsstudents from grades 6 - 12 were selected throughout a school districtand their left handedness was recorded. The sample information is:

Honors AcademicSample Size 100 200Number of left-handed students 18 32

Is there sufficient evidence at the 1% significance level to conclude thatthe proportion of left-handed students is greater in honor classes?

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 18 / 23

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 19 / 23

M&Ms

From a random sample of milk chocolate m&ms and peanutm&ms we get the following results.

Candy type n Number of Blue Sample proportion (p̂)milk chocolate 81 28 p̂1 = 28

81 = 0.3457peanut 100 20 p̂2 = 20

100 = 0.2Is there a evidence of a difference of the proportion of m&ms thatare blue for all of milk chocolate and peanut m&ms? Use 5%significance level.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 20 / 23

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 21 / 23

Popper #21 Questions

Is lying about credentials by job applicants changing? To see if there isa change over time, we can compare that period with the following sixmonths. Here are the data:

Period n X(lied)1 84 152 106 21

Have the lies increased?4. Give the null and alternative hypotheses to answer the previous

question.a) H0 : p1 = p2, Ha : p1 6= p2b) H0 : p1 = p2, Ha : p1 < p2c) H0 : p1 = p2, Ha : p1 > p2d) H0 : p̂1 = p̂2, Ha : p̂1 6= p̂2

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 22 / 23

Popper #21 Questions

5. From the previous hypothesis test, we get a p-value of 0.3658.Which is the correct conculsion of this test?a) Reject H0, the lies have significantly increased.

b) Fail to reject H0, the lies have significantly increased.

c) Reject H0, the lies have not significantly increased.

d) Fail to reject H0, the lies have not significantly increased.

Cathy Poliak, Ph.D. cathy@math.uh.edu Office hours: T Th 2:30 - 5:15 PM 620 PGH (Department of Mathematics University of Houston )Sections 8.3 & 8.4 April 21, 2016 23 / 23