Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stats: Modeling the World

Similar presentations


Presentation on theme: "Stats: Modeling the World"— Presentation transcript:

1 Stats: Modeling the World
Chapter 20 Testing Hypothesis About Proportions

2 A Hypothesis Test Large ingots are used in structural parts for cars and planes, if these ingots are cracked during the manufacturing process, then they must be remade costing the companies thousands of dollars for each ingot. In one plant only about 80% of ingots are free of cracks. In order to reduce cracking, engineers and chemists have developed a new process. In testing the new process on 400 ingots only 17% of the ingots have cracked. Has the crack rate really decreased or was 17% just due to luck?

3 A Hypothesis Test Questions such as this are asked all of the time.
Has the president’s approval rating changed? Has drug usage decreased in the past four years? Did the advertising campaign increase sales? To answer these questions, statisticians use hypothesis tests.

4 A Hypothesis Test Hypothesis Tests are models we adopt temporarily. To test whether engineers have improved the cracking rate, we assume that the new process made no difference and that the improvement to 17% is just random chance (sampling error). So, our starting hypothesis, the null hypothesis, is that the cracking rate is still 20%. In symbols we will write: Ho: p = 0.20 Since we want to improve the cracking rate (make it lower) our alternative hypothesis will be the cracking rate is less than 20 In symbols we will write: HA: p< 0.20

5 A Hypothesis Test We wouldn’t be surprised to see some difference in the rate of cracking since all sample proportions vary. So what would convince you that the cracking rate had actually gone down? What is the new rate was: 18%? 10%? 5%? 1%?

6 A Hypothesis Test We want to find the size of the statistical difference between our Ho (20%) and our HA (17%). If we had a Normal Model we could use z-scores as our measuring device And perform a one-proportion z-test. Could we use a Normal Model? Let’s check. Independence? Random? 10% condition? np and nq > 10? So we are good to go!

7 A Hypothesis Test Since we can use a Normal Model, we need the standard deviation. Remember we are assuming p = 0.20 (our null hypothesis) and our sample is 400 So, And

8 A Hypothesis Test To finish our test we ask – How likely is it to observe a z-score of at least -1.5 standard deviations below the mean using a Normal Model? Or- How likely will we get 17% or lower given that the mean is 20% (Ho)? P(z<-1.5) = 0.067 In other words the probability of observing a cracking rate of 17% or lower in a sample of 400 ingots if the 20% crack rate is true is 6.7%

9 A Hypothesis Test Management would now need to decide whether an event that would happen 6.7% of the time is strong enough evidence to conclude that the new method has decreased the cracking rate – or maybe they need stronger evidence. Or we could ask is this event (17%) unlikely to happen beyond a reasonable doubt if it could happen 6.7% of the time?

10 A Hypothesis Test The probability we got from our test (.067) is called a P-value. The probability that we would see this result (17%) given that the null hypothesis (20%) is true. If the P-value is high, we haven’t seen anything surprising – the data is consistent with the null hypothesis. If this happens the null hypothesis could be true (we can’t prove it is true)- it doesn’t appear to be false. In Stat Speak we say we “Fail to reject” the null hypothesis

11 A Hypothesis Test If the P-value is low enough – if our data is unlikely to happen if Ho were true, then either Ho is correct and we have just seen something remarkable or Ho is wrong and we were wrong to use it as our model. Maybe another model is correct and the data we got wasn’t that remarkable. Since we assumed that Ho was correct and statisticians believe in data more than assumptions we reject the null hypothesis.

12 Example A large city’s DMV claimed that 80% of candidates passed the driving exam. A reporter has results from a random survey from 90 teens and found that 61 passed. Does this suggest that the passing rate for teens is lower that the DMV reported? We will assume that the passing rate for teens is the same as the overall rate, unless there is strong evidence that it’s lower Ho: p = 0.80 HA: p < 0.80

13 Example B) Are the conditions satisfied? Independence? Random Sample?
A large city’s DMV claimed that 80% of candidates passed the driving exam. A reporter has results from a random survey from 90 teens and found that 61 passed. Does this suggest that the passing rate for teens is lower that the DMV reported? B) Are the conditions satisfied? Independence? Random Sample? Is 90 < 10% of teens tested? Is 90(.8) and 90(.2) > 10?

14 Example C) What is the P-value for the one-proportion z-test?
A large city’s DMV claimed that 80% of candidates passed the driving exam. A reporter has results from a random survey from 90 teens and found that 61 passed. Does this suggest that the passing rate for teens is lower that the DMV reported? C) What is the P-value for the one-proportion z-test? n = 90, x = 61, hypothesized p = 0.80

15 Example D) What can the reporter conclude?
A large city’s DMV claimed that 80% of candidates passed the driving exam. A reporter has results from a random survey from 90 teens and found that 61 passed. Does this suggest that the passing rate for teens is lower that the DMV reported? D) What can the reporter conclude? If the passing rate for teens was really 80%, we would expect the survey result of 68% to happen 0.2% of the time. This seems highly unlikely. Because the P-value of is very low, I reject the null hypothesis. These survey data provide strong evidence that the passing rate for teenagers is lower than 80%.

16 Example People who follow sports often talk of the “home field advantage”, that teams tend to win more often when they play at home. Is this true? If there were no home field advantage, the home team would win about 50% of their games during the season. In the 2007 Major League Baseball season, there were 2431 regular season home games and the home team won 1319 games or 54.26% of the time. Is there enough evidence to support the “home field advantage” theory in Major League Baseball?

17 Example Is there enough evidence to support the “home field advantage” theory in Major League Baseball? A) State the null and alternative hypothesis. This time we want to know if the home team wins more of their games. Ho: p=0.50 HA: p>0.50

18 Example Is there enough evidence to support the “home field advantage” theory in Major League Baseball? B) Check Conditions and Assumptions Independence ? Random? 10% condition? Success/Failure Condition?

19 Example Is there enough evidence to support the “home field advantage” theory in Major League Baseball? C) What is the P-value for the one-proportion z-test? , hypothesized p = 0.50

20 Example D) What can we conclude?
Is there enough evidence to support the “home field advantage” theory in Major League Baseball? D) What can we conclude? If there were no home field advantage then the result of the home team winning 54.25% of the time would happen approximately 0% of the time. This is highly unlikely. With a P-value approximately zero, I reject Ho and I have strong evidence that there is a home field advantage.

21 Size of effect Now that we know there is a home field advantage – but, how big is the advantage? In other words, is the effect of the home field advantage big enough for it to be a real advantage. Or in the ingot example, if we reduce the cracking percent has it been reduced enough to justify the cost? We can look at this issue by finding the confidence interval using p-hat.

22 Size of effect Let’s use our calculator to find the 95% confidence interval for the home field advantage. Run the 1-PropZInt command The 95% Confidence interval is (.5227, ) So we are 95% confident that the home team wins between 52.3% and 56.2% of their home games. For 81 games this is between 2 and 5 extra victories.

23 Other Alternatives We don’t always know if we want our alternative hypothesis to be greater than or less than (these are called one sided alternatives). We might be interested if the proportion from our sample was different from the null hypothesis or you might be looking for any change due to a new procedure. This is a two sided alternative. In the case of the ingots we would write For the same data, the one-sided P-value is half the two-sided P-value. Which means the two sided test will reject Ho less often, making the test more conservative. This is supposed to be decided before you collect the data! Be sure you can justify the use of a one-sided test by looking at the Why of the situation.

24 Example: The proportion of orange M&M’s is supposed to be 20%. Suppose a bag of 122 M&M’s contains 21 orange one’s. Does this contradict the company’s claim? Even though this looks like their were not enough orange ones, before we took the sample we would have been equally interested to discover there were too many orange M&M’s – so this is a two-tailed test. Step 1: write our Hypotheses:

25 Example: The proportion of orange M&M’s is supposed to be 20%. Suppose a bag of 122 M&M’s contains 21 orange one’s. Does this contradict the company’s claim? Step 2: Check Conditions Independence Assumption: Yes, M &M’s can be considered independent of each other. Random Sampling Condition: We will assume the M&M’s are randomly placed in the bag. 10% Condition: 122 M&M’s are less than 10% of M&M’s produced Success/Failure Condition: 122(.2)>10 and 122(.8)>10

26 Example: The proportion of orange M&M’s is supposed to be 20%. Suppose a bag of 122 M&M’s contains 21 orange one’s. Does this contradict the company’s claim? Step 3: Calculations the 2 is because it is a two-sided test.

27 Example: The proportion of orange M&M’s is supposed to be 20%. Suppose a bag of 122 M&M’s contains 21 orange one’s. Does this contradict the company’s claim? Step 4: Conclusions The P-value is quite high (.44). If the proportion of orange M&M’s is 20% the probability of getting this result or smaller (17%) or the result (23%) or larger is about 44% of the time. This is not unusual. We fail to reject the null hypothesis. We have no evidence to suggest the proportion of orange M&M’s differs from the advertised 20%. What would be the 95% confidence interval for 17%? Use your calculator… (.105, .239)

28 You Try! A 1996 report from the US Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio, TV, and the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate?

29 You Try! Step 1: State the hypotheses:
A 1996 report from the US Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio, TV, and the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate? Step 1: State the hypotheses: This will be a one-sided test because we want to know if the smoke detector rate went higher.

30 You Try! Step 2 Check the Conditions: Independence:
A 1996 report from the US Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio, TV, and the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate? Step 2 Check the Conditions: Independence: Yes, homes can be considered independent of each. Random: Yes, we are told the homes were selected randomly. 10% Condition: 400 homes should be less than 10% of a city’s homes Success Failure Condition: (400)(0.9)>10, 400(0.1)>10

31 You Try! Step 3: Calculations
A 1996 report from the US Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio, TV, and the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate? Step 3: Calculations

32 You Try! Step 4 Conclusions
A 1996 report from the US Consumer Product Safety Commission claimed that at least 90% of all American homes have at least one smoke detector. A city’s fire department has been running a public safety campaign about smoke detectors consisting of posters, billboards, and ads on radio, TV, and the newspaper. The city wonders if this concerted effort has raised the local level above the 90% national rate. Building inspectors visit 400 randomly selected homes and find that 376 have smoke detectors. Is this strong evidence that the local rate is higher than the national rate? Step 4 Conclusions The P-value of is very low, making it unlikely that the observed results can be explained by sampling error. We reject the null hypothesis. There is strong evidence that the city’s efforts to raise the level of smoke detectors above 90% is working. Further Considerations: The 95% confidence interval for the city is that between 91.7% and 96.3% of the city’s homes have smoke detectors.

33 You Try! A company is criticized because only 13 of 43 people in executive-level positions are women. The company explains that although this proportion is lower than it might wish, it’s not surprising given that only 40% of all its employees are women. Is there evidence to suggest the company is not promoting enough women into executive-level positions? Step 1: State the hypotheses: This will be a one-sided test since we want to know if the percent of women in executive-level conditions is too low

34 You Try! Step 2: Check Conditions:
A company is criticized because only 13 of 43 people in executive-level positions are women. The company explains that although this proportion is lower than it might wish, it’s not surprising given that only 40% of all its employees are women. Is there evidence to suggest the company is not promoting enough women into executive-level positions? Step 2: Check Conditions: Independence: We can assume that the executives are independent of each other. Random: The executive level positions were probably not chosen at random,, but we can consider these executives to be representative of executives hired in the past 10% Condition: If we look at the executives as employees of the company then if the company has more than 500 employees, we are okay. Success/Failure Condition: 43(.4)=17.2, 43(.6)=25.8 Both are greater than 10

35 You Try! Step 3: Calculations
A company is criticized because only 13 of 43 people in executive-level positions are women. The company explains that although this proportion is lower than it might wish, it’s not surprising given that only 40% of all its employees are women. Is there evidence to suggest the company is not promoting enough women into executive-level positions? Step 3: Calculations

36 You Try! Step 4: Conclusions
A company is criticized because only 13 of 43 people in executive-level positions are women. The company explains that although this proportion is lower than it might wish, it’s not surprising given that only 40% of all its employees are women. Is there evidence to suggest the company is not promoting enough women into executive-level positions? Step 4: Conclusions The P-value of is not very small (we would expect a result like this 9.5% of the time due to sampling error). We do not reject the null hypothesis. We do not have sufficient evidence to suggest that the company is not promoting women into executive level positions. Further Considerations: The 95% confidence interval for companies of this type is that between 16.5% and 44% of the executives are women.


Download ppt "Stats: Modeling the World"

Similar presentations


Ads by Google