1 / 65

Chapter 8 Hypothesis Testing

Chapter 8 Hypothesis Testing. 8.2 Basics of Hypothesis Testing 8.3 Testing about a Proportion p 8.4 Testing about a Mean µ ( σ known ) 8.5 Testing about a Mean µ ( σ unknown ) 8.6 Testing about a Standard Deviation σ. Section 8.2 Basics of Hypothesis Testing. Objective

Anita
Télécharger la présentation

Chapter 8 Hypothesis Testing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 8Hypothesis Testing 8.2 Basics of Hypothesis Testing 8.3 Testing about a Proportionp 8.4 Testing about a Meanµ (σknown) 8.5 Testing about a Meanµ (σunknown) 8.6 Testing about a Standard Deviationσ

  2. Section 8.2Basics of Hypothesis Testing Objective For a population parameter (p, µ, σ) we wish to test whether a predicted value is close to the actual value (based on sample values).

  3. In statistics, a Hypothesis is a claim or statement about a property of a population. A Hypothesis Test is a standard procedure for testing a claim about a property of a population. Ch. 8 will cover hypothesis tests about a Proportion p Mean µ (σ known or σ unknown) Standard Deviation σ Definitions

  4. Example 1 Claim: The XSORT method of gender selection increasesthe likelihood of birthing a girl. (i.e. increases the proportion of girls born) To test the claim, use a hypothesis test (about a proportion) on a sample of 14 couples: If 6 or 7 have girls, the method probably doesn’t increasethe probability of birthing a girl. If 13 or 14 couples have girls, this method probably does increase the probability of birthing a girl. This will be explained in Section 8.3

  5. Rare Event Rule forInferential Statistics If, under a given assumption, the probability of a particular event is exceptionally small, we conclude the assumption is probably not correct. Example: Suppose we assume the probability of pigs flying is 10-10 If we find a farm with 100 flying pigs, we conclude our assumption probably wasn’t correct

  6. Components of aHypothesis Test Null Hypothesis: H0 Alternative Hypothesis: H1

  7. The null hypothesis(denoted H0) is a statement that the value of a population parameter (p, µ, σ) isequal tosome claimed value. We test the null hypothesis directly. It will either reject H0or fail to reject H0 (i.e. accept H0) Null Hypothesis: H0 ExampleH0: p = 0.6 H1: p < 0.6

  8. Alternative Hypothesis: H1 The alternative hypothesis (denoted H1) is a statement that the parameter has a value that somehow differs from the null hypothesis. The difference will be one of <, >, ≠ (less than, greater than, doesn’t equal) ExampleH0: p = 0.6 H1: p < 0.6

  9. Example 1 • Claim: The XSORT method of gender selection • increasesthe likelihood of birthing a girl. • Let p denote the proportion of girls born. • The claim is equivilent to “p>0.5” The null hypothesis must say “equal to”: H0: p = 0.5 The alternative hypothesis states the difference: H1: p > 0.5 Here, the original claim is the alternative hypothesis

  10. Example 1 Continued Claim: The XSORT method of gender selection increasesthe likelihood of birthing a girl. If we reject the null hypothesis, then the original clam is accepted. Conclusion: The XSORT method increases the likelihood of having a baby girl. If we fail to reject the null hypothesis, then the original clam is rejected. Conclusion: The XSORT method does not increase the likelihood of having a baby girl. Note: We always test the null hypothesis

  11. Example 2 • Claim: For couples using the XSORT method, the likelihood of having a girl is 50% • Again, let p denote the proportion of girls born. • The claim is equivalent to “p=0.5” The null hypothesis must say “equal to”: H0: p = 0.5 The alternative hypothesis states the difference: H1: p ≠ 0.5 Here, the original claim is the null hypothesis

  12. Example 2 Continued Claim: For couples using the XSORT method, the likelihood of having a girl is 50% If we reject the null hypothesis, then the original clam is rejected. Conclusion: For couples using the XSORT method, the likelihood of having a girl is not 0.5 If we fail to reject the null hypothesis, then the original clam is accepted. Conclusion: For couples using the XSORT method, the likelihood of having a girl is indeed 0.5 Note: We always test the null hypothesis

  13. Example 3 • Claim: For couples using the XSORT method, the likelihood of having a girl is at least 50% • Again, let p denote the proportion of girls born. • The claim is equivalent to “p ≥ 0.5” The null hypothesis must say “equal to”: H0: p = 0.5 The alternative hypothesis states the difference: H1: p < 0.5 Here, the original claim is the null hypothesis we can’t use ≥ or ≤ in the alternative hypothesis, so we test the negation

  14. Example 3 Continued Claim: For couples using the XSORT method, the likelihood of having a girl is at least 50% If we reject the null hypothesis, then the original clam is rejected. Conclusion: For couples using the XSORT method, the likelihood of having a girl is less than 0.5 If we fail to reject the null hypothesis, then the original clam is accepted. Conclusion: For couples using the XSORT method, the likelihood of having a girl is at least 0.5 Note: We always test the null hypothesis

  15. General rules • If the null hypothesis is rejected, the alternative hypothesis is accepted. H0 rejected → H1 accepted • If the null hypothesis is accepted, the alternative hypothesis is rejected. H0 accepted → H1rejected • Acceptance or rejection of the null hypothesis is called an initial conclusion. • The final conclusion is always expressed in terms of the original claim. Not in terms of the null hypothesis or alternative hypothesis.

  16. A Type I erroris the mistake of rejecting the null hypothesis when it is actually true. Also called a “True Negative”True: means the actual hypothesis is trueNegative: means the test rejected the hypothesis The symbol (alpha) is used to represent the probability of a type I error. Type I Error

  17. A Type II erroris the mistake of acceptingthe null hypothesis when it is actually false. Also called a “False Positive”False: means the actual hypothesis is falsePositive: means the test failed to reject the hypothesis The symbol (beta) is used to represent the probability of a type II error. Type II Error

  18. Type I and Type II Errors

  19. Example 4 • Claim: A new medication has greater success rate (p) than that of the old (existing) machine (p0) • p: Proportion of success for the new medication • p0: Proportion of success for the old medication • The claim is equivalent to “p > p0” Null hypothesis: H0: p = p0 Alternative hypothesis:H1: p > p0 Here, the original claim is the null hypothesis

  20. Example 4 Continued Claim: A new medication has greater success rate (p) than that of the old (existing) machine (p0) H0: p = p0 H1: p > p0 Type I error H0 is true, but we reject it → We accept the claim So we adopt the new (inefficient, potentially harmful) medicine. (This is called a critical error, must be avoided) Type II error H1 is true, but we reject it → We reject the claim So we decline the new medicine and continue with the old one. (no direct harm…)

  21. Significance Level • The probability of a type I error (denoted ) is also called the significance level of the test. • Characterizes the chance the test will fail.(i.e. the chance of a type I error) • Used to set the “significance” of a hypothesis test.(i.e. how reliable the test is in avoiding type I errors) • Lower significance → Lower chance of type I error • Values used most:  = 0.1, 0.05, 0.01 (i.e. 10%, 5%, 1%, just like with CIs)

  22. Critical Region Consider a parameter (p, µ, σ, etc.) The “guess” for the parameter will have a probability that follows a certain distribution (z, t, χ2,etc.) Note: This is just like what we used to calculate CIs. Using the significance levelα, we determine the region where the guessed value becomes unusual. This is known as the critical region. The region is described using critical value(s).(Like those used for finding confidence intervals)

  23. Example p follows a z-distribution If we guess p > p0 the critical region is defined by the right tail whose area is α If we guess p < p0 the critical region is defined by the left tail whose area is α If we guess p ≠ p0 the critical region is defined by the two tails whose areas areα/2 tα -tα -tα/2 tα/2

  24. Testing a Claim Using a Hypothesis Test • 1. State the H0 and H1 • 2. Compute the test statistic • Depends on the value being tested • 3. Compute the critical region for the test statistic • Depends on the distribution of the test statistic (z, t, χ2) • Depends on the significance level α • Found using the critical values • 4. Make an initial conclusion from the test • RejectH0 (accept H1) if the test statistic is within the critical region • AcceptH0 if test statistic is not within the critical region • 5. Make a final conclusion about the claim • State it in terms of the original claim

  25. Example 5 Claim: The XSORT method of gender selection increasesthe likelihood of birthing a girl. Suppose 14 couples using XSORT had 13 girls and 1 boy. Test the claim at a 5% significance level H0: p = 0.5 H1: p > 0.5 1. State H0 and H1 2.Find the test statistic 3.Find the critical region 4. Initial conclusion 5. Final conclusion We accept the claim

  26. Section 8.3Testing a claim about a Proportion Objective For a population with proportion p, use a sample (with a sample proportion) to test a claim about the proportion. Testing a proportion uses the standard normal distribution(z-distribution)

  27. Notation

  28. (1) The sample used is a a simple random sample(i.e. selected at random, no biases) (2) Satisfies conditions for a Binomial distribution np0 ≥ 5 and nq0 ≥ 5 Requirements Note: 2 and 3 satisfy conditions for the normal approximation to the binomial distribution Note: p0is the assumed proportion, not the sample proportion

  29. Test Statistic Denoted z (as in z-score) since the test uses the z-distribution.

  30. Traditional method: If the test statistic falls within the critical region, reject H0. If the test statistic does not fall within the critical region, fail to reject H0 (i.e. accept H0).

  31. Types of Hypothesis Tests:Two-tailed, Left-tailed, Right-tailed The tails in a distribution are the extreme regions where values of the test statistic agree with the alternative hypothesis

  32. H0: p = 0.5 H1: p < 0.5 Left-tailed Test “<” significance level Area =  -z (Negative)

  33. H0: p = 0.5 H1: p > 0.5 Right-tailed Test “>” significance level Area = z (Positive)

  34. H0: p = 0.5 H1: p ≠ 0.5 Two-tailed Test “≠” significance level Area = /2 Area = /2 -z/2 z/2

  35. Example 1 The XSORT method of gender selection is believed to increases the likelihood of birthing a girl. 14 couples used the XSORT method and resulted in the birth of 13 girls and 1 boy. Using a 0.05 significance level, test the claim that the XSORT method increases the birth rate of girls. (Assume the normal birthrate of girls is 0.5) What we know: p0= 0.5 n= 14 x = 13 p = 0.9286 Claim: p > 0.5 using α= 0.05 np0= 14*0.5 = 7 nq0= 14*0.5 = 7 Since np0 >5 and nq0 >5, we can perform a hypothesis test.

  36. Example 1 What we know: p0= 0.5 n= 14 x = 13 p = 0.9286 Claim: p > 0.5 using α= 0.01 H0:p = 0.5 H1:p> 0.5 Right-tailed Test statistic: zα = 1.645 z = 3.207 Critical value: z in critical region Initial Conclusion:Since z is in the critical region, reject H0 Final Conclusion: We Accept the claim that the XSORT method increases the birth rate of girls

  37. P-Value The P-value is the probability of getting a value of the test statistic that is at least as extremeas the one representing the sample data, assuming that the null hypothesis is true. Example p-value (area) z Test statistic zαCritical value P-value = P(Z > z) z zα

  38. P-Value Critical region in the right tail: P-value = area to the rightof the test statistic Critical region in the left tail: P-value = area to the leftof the test statistic P-value = twice the area in the tail beyond the test statistic Critical region in two tails:

  39. P-Value method: If P-value   ,reject H0. If P-value >  , fail to reject H0. If the P is low, the null must go. If the P is high, the null will fly.

  40. Caution P-value = probability of getting a test statistic at least as extreme as the one representing sample data p= population proportion Don’t confuse a P-value with a proportion p. Know this distinction:

  41. Calculating P-value for a Proportion Stat → Proportions → One sample → with summary

  42. Calculating P-value for a Proportion Enter the number of successes (x) and the number of observations (n)

  43. Calculating P-value for a Proportion Enter the Null proportion (p0) and select the alternative hypothesis (≠, <, or >) Then hit Calculate

  44. Calculating P-value for a Proportion The resulting table shows both the test statistic (z) and the P-value P-value Test statistic P-value = 0.0007

  45. Using P-value Example 1 What we know: p0= 0.5 n= 14 x = 13 p = 0.9286 Claim: p > 0.5 using α= 0.01 H0:p = 0.5 H1:p> 0.5 Stat → Proportions→ One sample → With summary ● Hypothesis Test Number of successes: Number of observations: 13 14 0.5 > Null: proportion= Alternative P-value = 0.0007 Initial Conclusion:Since p-value < α (α = 0.05), reject H0 Final Conclusion: We Accept the claim that the XSORT method increases the birth rate of girls

  46. A statistical test cannot definitely provea hypothesis or a claim. Our conclusion can be only stated like this: The available evidence is not strong enough to warrant rejection of a hypothesis or a claim We can say we are 95% confident it holds. Do we prove a claim? “The only definite is that there are no definites” -Unknown

  47. Example 2 Problem 32, pg 424 Mendel’s Genetics Experiments When Gregor Mendel conducted his famous hybridization experiments with peas, one such experiment resulted in 580 offspring peas, with 26.2% of them having yellow pods. According to Mendel’s theory, ¼ of the offspring peas should have yellow pods. Use a 0.05 significance level to test the claim that the proportion of peas with yellow pods is equal to ¼. What we know: p0= 0.25 n= 580 p = 0.262 Claim: p= 0.25 using α= 0.05 np0= 580*0.25 = 145 nq0= 580*0.75 = 435 Since np0 >5 and nq0 >5, we can perform a hypothesis test.

  48. Example 2 What we know: p0= 0.25 n= 580 p = 0.262 Claim: p= 0.25 using α= 0.05 H0:p = 0.25 H1:p ≠ 0.25 Two-tailed Test statistic: zα = 1.960 zα = -1.960 z = 0.667 Critical value: znot in critical region Initial Conclusion:Since z is not in the critical region, accept H0 Final Conclusion: We Accept the claim that the proportion of peas with yellow pods is equal to ¼

  49. Using P-value Example 2 What we know: p0= 0.25 n= 580 p = 0.262 Claim: p= 0.25 using α= 0.05 Stat → Proportions→ One sample → With summary H0:p = 0.25 H1:p ≠ 0.25 ● Hypothesis Test Number of successes: Number of observations: 152 580 0.25 ≠ Null: proportion= Alternative x = np= 580*0.262 ≈ 152 P-value = 0.5021 Initial Conclusion:Since P-value > α, accept H0 Final Conclusion: We Accept the claim that the proportion of peas with yellow pods is equal to ¼

More Related