Comparing Two Means or Two Proportions Sections 8.3 & 8.4 Cathy Poliak, Ph.D. [email protected]Office in Fleming 11c Department of Mathematics University of Houston Lecture 24 - 2311 Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston ) Sections 8.3 & 8.4 Lecture 24 - 2311 1 / 29
30
Embed
Comparing Two Means or Two Proportions - Sections 8.3 & 8.4
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Comparing Two Means or Two ProportionsSections 8.3 & 8.4
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 1 / 29
Outline
1 Hypothesis for Proportions
2 Comparing Two Means
3 Comparing Two Proportions
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 2 / 29
Popper Set Up
Fill in all of the proper bubbles.
Make sure your ID number is correct.
Make sure the filled in circles are very dark.
This is popper number 20.
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 3 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 4 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 5 / 29
Popper #20 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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 6 / 29
Inference for a Population Proportion
For these inferences, p0 represents the given populationproportion and the hypothesis will be
I H0 : p = p0I Ha : p 6= p0 or p < p0 or p > p0
Conditions:1. The sample must be an SRS from the population of interest.2. The population must be at least 10 times the size of the sample.3. The number of successes and the number of failures must each be
at least 10 (both np̂ ≥ 10 and n(1− p̂) ≥ 10).
Recall, the statistic used for proportions is: p̂ = # of successes# of observations = x
n .
For tests involving proportions that meet the above conditions, wewill use the z-test statistic:
z =p̂ − p0√p0(1−p0)
n
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 7 / 29
Example
A new brand of chocolate bar is being market tested. Five hundred ofthe new chocolate bars were given to consumers to try. Theconsumers were asked whether they liked or disliked the chocolatebar. The company that produces the new brand of chocolate bars saidthey will put the chocolate bar on the shelf if more than half ofconsumers (50%) like this chocolate bar. From the sample of 500, 265people liked the candy bar. Test the claim that more than half ofconsumers will like this candy bar at the level α = 0.01.
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 8 / 29
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 9 / 29
Candy
Mars Inc. claims that they produce M&Ms with the followingdistributions:
Brown 30% Red 20% Yellow 20%Orange 10% Green 10% Blue 10%
A bag of M&Ms was randomly selected from the grocery store shelf,and the color counts were:
Brown 14 Red 14 Yellow 5Orange 7 Green 6 Blue 10
Conduct an appropriate test of the manufacturer’s claim for theproportion of brown M&Ms.
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 10 / 29
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 11 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 12 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 13 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 14 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 15 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 16 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 17 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 18 / 29
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 19 / 29
Fats
Solid fats are more likely to raise blood cholesterol levels than liquidfats. Suppose a nutritionist analyzed the percentage of saturated fat fora sample of 6 brands of stick margarine (solid fat) and for a sample of6 brands of liquid margarine and obtained the following results:
We want to determine if there a significant difference in the averageamount of saturated fat in solid and liquid fats.
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 20 / 29
Popper #20 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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 21 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 22 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 23 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 24 / 29
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 25 / 29
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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 26 / 29
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 27 / 29
Popper #20 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
Cathy Poliak, Ph.D. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 28 / 29
Popper #20 Questions
5. From the previous hypothesis test, we get a p-value of 0.3658.Which is the correct conclusion 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. [email protected] Office in Fleming 11c (Department of Mathematics University of Houston )Sections 8.3 & 8.4 Lecture 24 - 2311 29 / 29