Sections 9.1 and 9.2 HYPOTHESIS TESTS FOR PROPORTIONS
Inferential Statistics Two important features ◦ Information is obtained from a sample ◦ This information is used to draw a conclusion (an inference ) about the entire population from which the sample was drawn. Two major types ◦ Using hypothesis tests ◦ Using confidence intervals (next time)
A Hypothesis Testing Way of Thinking Claim: The population proportion is 60% Result of survey: 54% was the proportion for the sample Conclusion: I believe the claim is not correct Claim: The population proportion is 50% Result of survey: 54% was the proportion for the sample Conclusion: I believe the claim could be correct
Another Example Setup ◦ If we roll a pair of fair dice, the total on the two dice ranges from 2 to 12. ◦ The probability of totaling 7 is 6/36 = 1/6 = 0.1667. ◦ If the dice are loaded, this probability can be changed. ◦ State gaming commissions inspect casino equipment including dice. Particularly important when machines are simulating dice, cards, etc. Claim: The casino claims that two dice are fair, i.e., that the probability of totaling 7 is 16.67%
Our Experiment Roll the dice many times ◦ If the proportion of 7’s is not close to 1/6, we have evidence that the probability is not 1/6. We will reject the claim. ◦ If the proportion of 7’s is close to 1/6, we acknowledge that the claim could be true.
Our Experiment Roll the dice many times ◦ If the proportion of 7’s is not close to 1/6, we have evidence that the probability is not 1/6. We will reject the claim ◦ If the proportion of 7’s is close to 1/6, we acknowledge that the claim could be true.
Are the dice fair or loaded? To answer this question by experiment, we make two choices. ◦ How many rolls should we use to test the claim? ( sample size) ◦ How close should the sample proportion be to 1/6 for us to believe the population proportion could be 1/6? ( measure of closeness)
Example 2. Suppose we think the casino is cheating by using dice that do not sum to seven as often as they should. We collect data on 1000 dice rolls and find that 153 of them sum to seven. Is this enough evidence to accuse them of cheating?
Are the dice fair or loaded? To answer this question by experiment, we make two choices. ◦ How many rolls? ( sample size) ◦ How close should we be to 1/6? ( measure of closeness) Two different ways to be correct, and two ways to be incorrect.
Types of Errors
Connection to Criminal Trials
Part II: The Logic of Hypothesis Testing
Logic of Hypothesis Testing: Dice Example Using the dice example. Claim: The population proportion is 1/6. There are two possible conclusions: ◦ The sample proportion was not close to 1/6, so we reject the claim. ◦ The sample proportion was close to 1/6, so we do not reject the claim.
The Logic of Hypothesis Testing: Unusual Data To be more precise about what is “unusual,” we use z -scores and P -values. The sample value p -hat being “unusual” means we would not expect to have such a sample value given the claimed value for p .
Components of a Hypothesis Test Claim to be investigated Hypothetical sampling distributions based on claim. Calculations based on the sample Measure of closeness
Claim to be investigated Claim: The population proportion is p 0 (a particular value hypothesized in advance) We will reject this claim if we obtain evidence that the population proportion is not equal to this value — either smaller or larger. But wait, a sample value will rarely be *exactly* the population value …so when should we reject?
Sampling Distribution Recall that if we look at the sample proportions for many, many samples of the same size, the resulting values have an approximately normal distribution with ◦ mean = p (where p is the population proportion) ◦ standard deviation (called standard error) = � p (1 − p ) n
Sampling Distribution (cont.) We do not know the value of p . However, we know that it is claimed to be p 0 , so we can build a hypothetical distribution. Thus, we use p 0 in our calculations. ◦ mean = p 0 ◦ standard deviation (called standard error) = � p 0 (1 − p 0 ) n
Calculations based on the sample We obtain a simple random sample, and compute the sample proportion ˆ p From the sampling distribution we know what to expect if the claim is true: should be close to p 0 . ˆ p
Measure of closeness Reasoning: ◦ If the claim is true, the sample proportion should not be unusually large or small. ◦ The smaller the P-value, the more unusual the sample. The P-value is literally the probability that a p -hat would be this far from the mean, within the framework of our hypothetical distribution.
Measure of closeness Reasoning: ◦ If the claim is true, the sample proportion should not be unusually large or small. ◦ The smaller the (two-tail) P-value, the more unusual the sample
Measure of closeness (cont.) But how small is small? This decision should be made in advance, prior to taking the sample and varies depending on the situation. For example, we might decide that small will mean “less than 0.05.” So, we reject the claim if our sample is in the most unusual 5% of all possible samples.
Conclusion We reject the claim if the calculated P-value is less than the chosen value. Otherwise, we do not reject the claim. Recall: We calculate a P-value using the z - score and Table A or a web app. For mean and standard deviation we use: ◦ mean = p 0 ◦ standard deviation (called standard error) = � p 0 (1 − p 0 ) n
Part III: Terminology and Two-Tail Tests
Our Assumptions We are taking a simple random sample. We expect a normal sampling distribution. For this we need our sample size n to satisfy both of the following: ◦ np 0 ≥ 15 ◦ n(1-p 0 ) ≥ 15 In other words, if you think in terms of a yes/no survey question, you need to reasonably expect at least 15 “yes”s and at least 15 “no”s.
The Null Hypothesis The null hypothesis is the claim that is to be investigated. (This gives us our hypothetical sampling distribution.) The claim is that the population proportion is equal to some value p 0 . We use the notation H 0 : p = p 0 .
The Alternative Hypothesis The alternative hypothesis is the conclusion we will reach if we reject to null hypothesis. For a two-tail P-value test, we use the notation H a : p ≠ p 0 .
An Example Recall the example when we had two dice and the casino claimed that the dice are fair, i.e., the probability of totaling 7 is 16.67% The null hypothesis: H 0 : p = 0.1667 The alternative hypothesis: H a : p ≠ 0.1667
Significance Level If the P-value of the sample proportion is less than a pre-specified cutoff, then we reject the claim. We have used 0.05 for this cutoff. This cutoff is called the significance level, and is denoted by α . So we might set α =0.05 or α =0.01.
Conclusion of Hypothesis Test If the P-value of the sample proportion is less than α , reject the null hypothesis, and conclude the alternative hypothesis is true. ◦ P-value < α → reject H 0 Otherwise, fail to reject the null hypothesis – it might be true, there is not enough evidence to conclude that the alternative hypothesis is true. ◦ P-value ≥ α → fail to reject H 0
Hypothesis-Testing Steps 1. Write the null and alternative hypothesis. The null hypothesis: H 0 : p = p 0 The alternative hypothesis: H a : p ≠ p 0 2. Calculate the from data and find the z- ˆ p score ( test statistic ). Remember how?
Steps (Step 2 details) z = ˆ p − p 0 We get z-scores by se Where for mean and standard deviation we use: ◦ mean = p 0 ◦ standard deviation (called standard error) se = � p 0 (1 − p 0 ) n
Steps 1. Write the null and alternative hypothesis. The null hypothesis: H 0 : p = p 0 The alternative hypothesis: H a : p ≠ p 0 2. Calculate the from data and find the z- ˆ p score. 3. From the z -score get a P-value.
Steps (Step 3 details) Given a z-score use Table A to calculate area. Total Area= P-value A z-score Will always DOUBLE area for a two-sided test. This total area is the P-value for your sample.
Steps (Step 3 details)
Steps 1. Write the null and alternative hypothesis. The null hypothesis: H 0 : p = p 0 The alternative hypothesis: H a : p ≠ p 0 2. Based on sample size, find s.e. for hypothetical dist. 3. Calculate the from data and find the z-score. ˆ p 4. From the z-score get a P-value. 5. Decision time: Reject H 0 Yes Is P-value < α ? No Fail to reject H 0
Could We Have Made an Error? Yes, if we rejected H 0 but in fact H 0 is true that is a Type I error. If we failed to reject H 0 when H 0 was not true that is a Type II error.
One-Tail Test If a researcher, prior to taking the sample, has reason to believe that the proportion in the null hypothesis is too low , then H a : p > p 0 . In this case, we use the one-tail ( right-tail ) P-value of the sample proportion.
Recommend
More recommend