Upcoming SlideShare
×

# FEC 512.05

2,939 views

Published on

Hypothesis Testing

1 Comment
5 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• now i know..ty

Are you sure you want to  Yes  No
Views
Total views
2,939
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
261
1
Likes
5
Embeds 0
No embeds

No notes for slide

### FEC 512.05

1. 1. Introduction to Hypothesis Testing Istanbul Bilgi University FEC 512 Financial Econometrics-I Asst. Prof. Dr. Orhan Erdem
2. 2. What is a Hypothesis? <ul><li>A hypothesis is a claim </li></ul><ul><li>(assumption) about a </li></ul><ul><li>population parameter: </li></ul><ul><ul><li>population mean </li></ul></ul>Example: The mean age of the citizens of this city is  = 50.
3. 3. <ul><li>Is always about a population parameter, not about a sample statistic </li></ul><ul><li>Begin with the assumption that the null hypothesis is true </li></ul><ul><ul><li>Similar to the notion of innocent until proven guilty </li></ul></ul><ul><li>Always contains “=” , “≤” or “  ” sign </li></ul><ul><li>May or may not be rejected </li></ul>The Null Hypothesis, H 0
4. 4. The Alternative Hypothesis, H A <ul><li>Is the opposite of the null hypothesis </li></ul><ul><ul><li>e.g.: The mean age of this city is not 50 ( H A :   50 ) </li></ul></ul><ul><li>Never contains the “=” , “≤” or “  ” sign </li></ul><ul><li>May or may not be accepted </li></ul><ul><li>Is generally the hypothesis that is believed (or needs to be supported) by the researcher </li></ul>
5. 5. Formulating Hypotheses <ul><li>Example : The average annual income of citizens of this city is claimed to be \$65,000 per year. An analyst would like to test this claim. </li></ul><ul><li>What is the appropriate hypothesis test? </li></ul>
6. 6. <ul><li>Example 1 : The average annual income of city A is claimed to be \$65,000 per year. An analyst would like to test this claim. </li></ul><ul><li>What is the appropriate test? </li></ul><ul><li>H 0 : µ = 65,000 (income is as claimed) status quo </li></ul><ul><li>H A : µ ≠ 65,000 (income is different than claimed) </li></ul><ul><li>The analyst will believe the claim unless sufficient evidence is found to discredit it. </li></ul>Formulating Hypotheses
7. 7. A Trial as a Hypothesis Test <ul><li>Hypothesis testing is very much like a court trial. </li></ul><ul><li>The null hypothesis is that the defendant is innocent. </li></ul><ul><li>We then present the evidence—collect data. </li></ul><ul><li>Then we judge the evidence—”Could these data plausibly have happened by chance if the null hypothesis were true?” </li></ul><ul><ul><li>If they were very unlikely to have occurred, then the evidence raises more than a reasonable doubt in our minds about the null hypothesis. </li></ul></ul>
8. 8. What to Do with an “Innocent” Defendant <ul><li>If the evidence is not strong enough to reject the presumption of innocent, the jury returns with a verdict of “not guilty.” </li></ul><ul><ul><li>The jury does not say that the defendant is innocent.All it says is that there is not enough evidence to convict, to reject innocence. </li></ul></ul><ul><ul><li>The defendant may, in fact, be innocent, but the jury has no way to be sure. </li></ul></ul><ul><li>Said statistically, we will fail to reject the null hypothesis. </li></ul><ul><li>We never declare the null hypothesis to be true, because we simply do not know whether it’s true or not. </li></ul>
9. 9. Population Claim: the population mean age is 50. (Null Hypothesis: REJECT Suppose the sample mean age is 20: x = 20 Sample Null Hypothesis 20 likely if  = 50?  Is Hypothesis Testing Process If not likely, Now select a random sample H 0 :  = 50 ) x
10. 10. Reason for Rejecting H 0 Sampling Distribution of x  = 50 If H 0 is true If it is unlikely that we would get a sample mean of this value ... ... then we reject the null hypothesis that  = 50. 20 ... if in fact this were the population mean… x
11. 11. Level of Significance,  <ul><li>Defines unlikely values of sample statistic if null hypothesis is true </li></ul><ul><ul><li>Defines rejection region of the sampling distribution </li></ul></ul><ul><li>Is designated by  , (level of significance) </li></ul><ul><ul><li>Typical values are .01, .05, or .10 </li></ul></ul><ul><li>Is selected by the researcher at the beginning </li></ul><ul><li>Provides the critical value(s) of the test </li></ul>
12. 12. Level of Significance and the Rejection Region H 0 : μ ≥ 50 H 1 : μ < 50 0 H 0 : μ ≤ 50 H 1 : μ > 50   Represents critical value Lower-tail test Level of significance =  0 Upper-tail test Two-tail test Rejection region is shaded /2 0  /2  H 0 : μ = 50 H 1 : μ ≠ 50
13. 13. Errors in Making Decisions <ul><li>Type I Error </li></ul><ul><ul><li>Reject a true null hypothesis </li></ul></ul><ul><ul><li>Considered a serious type of error </li></ul></ul><ul><ul><li>The probability of Type I Error is  </li></ul></ul><ul><ul><ul><li>Called level of significance of the test </li></ul></ul></ul><ul><ul><ul><li>Set by researcher in advance </li></ul></ul></ul>
14. 14. Errors in Making Decisions <ul><li>Type II Error </li></ul><ul><ul><li>Fail to reject a false null hypothesis </li></ul></ul><ul><ul><li>The probability of Type II Error is β </li></ul></ul>(continued)
15. 15. Outcomes and Probabilities Actual Situation Decision Do Not Reject H 0 No error (1 - )  Type II Error ( β ) Reject H 0 Type I Error ( )  Possible Hypothesis Test Outcomes H 0 False H 0 True Key: Outcome (Probability) No Error ( 1 - β )
16. 16. Power of the Test <ul><li>The power of a test is the probability of rejecting a null hypothesis that is false </li></ul><ul><li>i.e., Power = P(Reject H 0 | H 1 is true) </li></ul><ul><ul><li>Power of the test increases as the sample size increases </li></ul></ul>
17. 17. Hypothesis Tests for the Mean <ul><li>Assume first that the population standard deviation σ is known </li></ul>σ Known σ Unknown Hypothesis Tests for 
18. 18. Test of Hypothesis f or the Mean ( σ Known) <ul><li>Convert sample result ( ) to a z value </li></ul>The decision rule is: σ Known σ Unknown Hypothesis Tests for  Consider the test (Assume the population is normal)
19. 19. Level of Significance and the Rejection Region H 0 : μ ≥ 50 H A : μ < 50 50 H 0 : μ ≤ 50 H A : μ > 50 H 0 : μ = 50 H A : μ ≠ 50   /2 Lower tail test Level of significance =  50 /2  Upper tail test Two tailed test 5 0  - ? ? - ? ? Reject H 0 Reject H 0 Reject H 0 Reject H 0 Do not reject H 0 Do not reject H 0 Do not reject H 0 Example: Example: Example:
20. 20. Level of Significance and the Rejection Region H 0 : μ ≥ 50 H A : μ < 50 0 H 0 : μ ≤ 50 H A : μ > 50 H 0 : μ = 50 H A : μ ≠ 50   /2 Lower tail test Level of significance =  0 /2  Upper tail test Two tailed test 0  -z α z α -z α /2 z α /2 Reject H 0 Reject H 0 Reject H 0 Reject H 0 Do not reject H 0 Do not reject H 0 Do not reject H 0 Example: Example: Example:
21. 21. Upper Tail Tests Reject H 0 Do not reject H 0  z α 0 μ 0 H 0 : μ ≤ μ 0 H 1 : μ > μ 0 Critical value Z Alternate rule:
22. 22. Lower Tail Tests Reject H 0 Do not reject H 0 <ul><li>The cutoff value, </li></ul><ul><li>or , is called a critical value </li></ul> -z α x α - z α x α 0 μ H 0 : μ ≥ μ 0 H A : μ < μ 0 I always find a corresponding z value to x
23. 23. Two Tailed Tests <ul><li>There are two cutoff values ( critical values ): </li></ul><ul><li>or </li></ul>Do not reject H 0 Reject H 0 Reject H 0  /2 -z α /2 x α /2 ± z α /2 x α /2 0 μ 0 H 0 : μ = μ 0 H A : μ  μ 0 z α /2 x α /2 Lower Upper x α /2 Lower Upper  /2
24. 24. Example: Upper-Tail Z Test for Mean (  Known) <ul><li>A supermarket chain manager thinks that customer age have increased, and now average over 52. The company wishes to test this claim. (Assume  = 10 is known) </li></ul>H 0 : μ ≤ 52 the average is not over 52 per month H 1 : μ > 52 the average is greater than 52 (i.e., sufficient evidence exists to support the manager’s claim) Form hypothesis test:
25. 25. <ul><li>Suppose that  = .10 is chosen for this test </li></ul><ul><li>Find the rejection region: </li></ul>Reject H 0 Do not reject H 0  = .10 1.28 0 Reject H 0 Example: Find Rejection Region (continued)
26. 26. <ul><li>Obtain sample and compute the test statistic </li></ul><ul><li>Suppose a sample is taken with the following results: n = 64, x = 53.1 (  =10 was assumed known) </li></ul><ul><ul><li>Using the sample results, </li></ul></ul>Example: Sample Results (continued)
27. 27. Example: Decision <ul><li>Reach a decision and interpret the result: </li></ul>Reject H 0 Do not reject H 0   = .10 1.28 0 Reject H 0 Do not reject H 0 since z = 0.88 < 1.28 i.e.: there is not sufficient evidence that the mean age is over 52 z = 0.88 (continued)
28. 28. Calculating the Test Statistic  Known Large Samples  Unknown Hypothesis Tests for  Small Samples The test statistic is: But is sometimes approximated using a z: (continued)
29. 29. Calculating the Test Statistic  Known Large Samples  Unknown Hypothesis Tests for  Small Samples The test statistic is: (The population must be approximately normal) (continued)
30. 30. Review: Steps in Hypothesis Testing <ul><li>1. Specify the population value of interest </li></ul><ul><li>2. Formulate the appropriate null and alternative hypotheses </li></ul><ul><li>3. Specify the desired level of significance </li></ul><ul><li>4. Determine the rejection region </li></ul><ul><li>5. Obtain sample evidence and compute the test statistic </li></ul><ul><li>6. Reach a decision and interpret the result </li></ul>
31. 31. Example: Risk and Return of an Equity Mutual Fund ( σ unknown) <ul><li>The ABC Fund, that has been in existence for 36 months achieved a monthly return of 1.5% with s =3.6%. This fund was expected to have earned at least 1.9% mean monthly return over that time period. Are the actual results consistent with an underlying population mean return of at least 1.9% with 5% level of significance? </li></ul>
32. 32. Solution Test the claim that the true mean # of ABC Fund return is at least 1.9 <ul><li>1. Specify the population value of interest </li></ul><ul><ul><li>The mean return of ABC </li></ul></ul><ul><li>2. Formulate the appropriate null and alternative hypotheses </li></ul><ul><ul><li>H 0 : μ  1.9 H A : μ < 1.9 (This is a lower tail test) </li></ul></ul><ul><li>3. Specify the desired level of significance </li></ul><ul><ul><li> = .05 is chosen for this test </li></ul></ul>
33. 33. Hypothesis Testing Example <ul><li>4. Determine the rejection region </li></ul>Reject H 0 Do not reject H 0  = .05 - t α = -1.6 8 0 This is a one-tailed test with  = .05. Since σ is not known , the cutoff value is a t value . But since we have 36 data, z-value can also be used. Reject H 0 if t < t  = -1. 68 ; otherwise do not reject H 0 (continued)
34. 34. <ul><li>5. Obtain sample evidence and compute the test statistic sample is taken with the following results: n = 36 , x = 1.5 </li></ul><ul><li>Then the test statistic is: </li></ul>Hypothesis Testing Example
35. 35. <ul><li>6. Reach a decision and interpret the result </li></ul>Hypothesis Testing Example Reject H 0 Do not reject H 0  = .05 -1. 68 0 -0 . 66 Since t = -1.6 8 <-0.66 , we fail to reject the null hypothesis that the mean return for ABC Fund is at least 1.9% (continued) z
36. 36. <ul><li>Smallest value of  for which H 0 can be rejected </li></ul><ul><li>Obtain the p-value from a table or computer </li></ul><ul><li>Compare the p-value with  </li></ul><ul><ul><li>If p-value <  , reject H 0 </li></ul></ul><ul><ul><li>If p-value   , do not reject H 0 </li></ul></ul>p-Value Approach to Testing
37. 37. <ul><li>Calculate the p-value and compare to  </li></ul><ul><li>(assuming that μ = 52.0) </li></ul>Example: p-Value Solution Reject H 0   = .10 Do not reject H 0 1.28 0 Reject H 0 Z = .88 (continued) p-value = .1894 Do not reject H 0 since p-value = .1894 >  = .10
38. 38. p-value example <ul><li>Example: How likely is it to see a sample mean of 0.93 (or something further below the mean) if the true mean is  = 1 . 9 ? </li></ul>p-value = 0.26  = .05 -1.68 -0.66 x
39. 39. <ul><li>Compare the p-value with  </li></ul><ul><ul><li>If p-value <  , reject H 0 </li></ul></ul><ul><ul><li>If p-value   , do not reject H 0 </li></ul></ul>p-value example Here: p-value = 0.26  = .05 Since .05 < 0.26 , we fail to reject the null hypothesis (continued)
40. 40. Type II Error (Revisited) <ul><li>Type II error is the probability of </li></ul><ul><li>failing to reject a false H 0 </li></ul>Reject H 0 : μ  52 Do not reject H 0 : μ  52 52 50 Suppose we fail to reject H 0 : μ  52 when in fact the true mean is μ = 50 
41. 41. Type II Error <ul><li>Suppose we do not reject H 0 :   52 when in fact the true mean is  = 50 </li></ul>Reject H 0 :   52 Do not reject H 0 :   52 52 50 This is the true distribution of x if  = 50 This is the range of x where H 0 is not rejected (continued)
42. 42. Type II Error <ul><li>Suppose we do not reject H 0 : μ  52 when in fact the true mean is μ = 50 </li></ul>Reject H 0 : μ  52 Do not reject H 0 : μ  52  52 50 β Here, β = P( x  cutoff ) if μ = 50 (continued)
43. 43. <ul><li>Suppose n = 64 , σ = 6 , and  = .05 </li></ul>Calculating β Reject H 0 : μ  52 Do not reject H 0 : μ  52  52 50 So β = P( x  50.766 ) if μ = 50 (for H 0 : μ  52) 50.766
44. 44. <ul><li>Suppose n = 64 , σ = 6 , and  = .05 </li></ul>Calculating β Reject H 0 : μ  52 Do not reject H 0 : μ  52  52 50 (continued) Probability of type II error: β = .1539
45. 45. Type I & II Error Relationship <ul><li>Type I and Type II errors can not happen at </li></ul><ul><li>the same time </li></ul><ul><ul><li>Type I error can only occur if H 0 is true </li></ul></ul><ul><ul><li>Type II error can only occur if H 0 is false </li></ul></ul><ul><li>If Type I error probability (  ) , then </li></ul><ul><li>Type II error probability ( β ) </li></ul>
46. 46. Factors Affecting Type II Error <ul><li>All else equal, </li></ul><ul><ul><li>β when the difference between hypothesized parameter and its true value </li></ul></ul><ul><ul><li>β when  </li></ul></ul><ul><ul><li>β when σ </li></ul></ul><ul><ul><li>β when n </li></ul></ul>
47. 47. Making Errors <ul><li>How often will a Type I error occur? </li></ul><ul><ul><li>Since a Type I error is rejecting a true null hypothesis, the probability of a Type I error is our  level. </li></ul></ul><ul><li>When H 0 is false and we reject it, we have done the right thing. </li></ul><ul><ul><li>A test’s ability to detect a false hypothesis is called the power of the test. </li></ul></ul>
48. 48. Making Errors <ul><li>When H 0 is false and we fail to reject it, we have made a Type II error. </li></ul><ul><ul><li>We assign the letter  to the probability of this mistake. </li></ul></ul><ul><ul><li>It’s harder to assess the value of  because we don’t know what the value of the parameter really is. </li></ul></ul><ul><ul><li>There is no single value for  --we can think of a whole collection of  ’s, one for each incorrect parameter value. </li></ul></ul>
49. 49. Making Errors (cont.) <ul><li>One way to focus our attention on a particular  is to think about the effect size . </li></ul><ul><ul><li>Ask “ How big a difference would matter? ” </li></ul></ul><ul><li>We could reduce  for all alternative parameter values by increasing  . </li></ul><ul><ul><li>This would reduce  but increase the chance of a Type I error. </li></ul></ul><ul><ul><li>This tension between Type I and Type II errors is inevitable . </li></ul></ul>
50. 50. Power <ul><li>The power of a test is the probability that it correctly rejects a false null hypothesis. </li></ul><ul><li>When the power is high, we can be confident that we’ve looked hard enough at the situation. </li></ul><ul><li>The power of a test is 1 –  . </li></ul>
51. 51. Type II Error <ul><li>Suppose we do not reject H 0 : μ  52 when in fact the true mean is μ = 50 </li></ul>Reject H 0 : μ  52 Do not reject H 0 : μ  52  52 50 β (continued) Power
52. 52. Power (cont.) <ul><li>Whenever a study fails to reject its null hypothesis, the test’s power comes into question. </li></ul><ul><li>When we calculate power, we imagine that the null hypothesis is false. </li></ul><ul><li>The value of the power depends on how far the truth lies from the null hypothesis value. </li></ul><ul><ul><li>The distance between the null hypothesis value, p 0 , and the truth, p , is called the effect size . </li></ul></ul><ul><ul><li>Power depends directly on effect size. </li></ul></ul>
53. 53. Reducing Both Type I and Type II Error <ul><li>The previous figure seems to show that if we reduce Type I error, we must automatically increase Type II error. </li></ul><ul><li>But, we can reduce both types of error by making both curves narrower. </li></ul><ul><li>How do we make the curves narrower? Increase the sample size. </li></ul>