LECTURE 5 Introduction to Econometrics Hypothesis testing October 20, 2017 1 / 1 ON TODAY’S LECTURE 2 / 1 ON TODAY’S LECTURE We are going to discuss how hypotheses about coefficients can be tested in regression models 2 / 1 ON TODAY’S LECTURE We are going to discuss how hypotheses about coefficients can be tested in regression models We will explain what significance of coefficients means 2 / 1 ON TODAY’S LECTURE We are going to discuss how hypotheses about coefficients can be tested in regression models We will explain what significance of coefficients means We will learn how to read regression output 2 / 1 ON TODAY’S LECTURE We are going to discuss how hypotheses about coefficients can be tested in regression models We will explain what significance of coefficients means We will learn how to read regression output Readings for this week: Studenmund, Chapter 5.1 - 5.4 Wooldridge, Chapter 4 2 / 1 QUESTIONS WE ASK 3 / 1 QUESTIONS WE ASK What conclusions can we draw from our regression? 3 / 1 QUESTIONS WE ASK What conclusions can we draw from our regression? What can we learn about the real world from a sample? 3 / 1 QUESTIONS WE ASK What conclusions can we draw from our regression? What can we learn about the real world from a sample? Is it likely that our results could have been obtained by chance? 3 / 1 QUESTIONS WE ASK What conclusions can we draw from our regression? What can we learn about the real world from a sample? Is it likely that our results could have been obtained by chance? If our theory is correct, what are the odds that this particular outcome would have been observed? 3 / 1 HYPOTHESIS TESTING 4 / 1 HYPOTHESIS TESTING We cannot prove that a given hypothesis is “correct” using hypothesis testing 4 / 1 HYPOTHESIS TESTING We cannot prove that a given hypothesis is “correct” using hypothesis testing All that can be done is to state that a particular sample conforms to a particular hypothesis 4 / 1 HYPOTHESIS TESTING We cannot prove that a given hypothesis is “correct” using hypothesis testing All that can be done is to state that a particular sample conforms to a particular hypothesis We can often reject a given hypothesis with a certain degree of confidence 4 / 1 HYPOTHESIS TESTING We cannot prove that a given hypothesis is “correct” using hypothesis testing All that can be done is to state that a particular sample conforms to a particular hypothesis We can often reject a given hypothesis with a certain degree of confidence In such a case, we conclude that it is very unlikely the sample result would have been observed if the hypothesized theory were correct 4 / 1 NULL AND ALTERNATIVE HYPOTHESES 5 / 1 NULL AND ALTERNATIVE HYPOTHESES First step in hypothesis testing: state explicitly the hypothesis to be tested 5 / 1 NULL AND ALTERNATIVE HYPOTHESES First step in hypothesis testing: state explicitly the hypothesis to be tested Null hypothesis: statement of the range of values of the regression coefficient that would be expected to occur if the researcher’s theory were not correct 5 / 1 NULL AND ALTERNATIVE HYPOTHESES First step in hypothesis testing: state explicitly the hypothesis to be tested Null hypothesis: statement of the range of values of the regression coefficient that would be expected to occur if the researcher’s theory were not correct Alternative hypothesis: specification of the range of values of the coefficient that would be expected to occur if the researcher’s theory were correct 5 / 1 NULL AND ALTERNATIVE HYPOTHESES First step in hypothesis testing: state explicitly the hypothesis to be tested Null hypothesis: statement of the range of values of the regression coefficient that would be expected to occur if the researcher’s theory were not correct Alternative hypothesis: specification of the range of values of the coefficient that would be expected to occur if the researcher’s theory were correct In other words: we define the null hypothesis as the result we do not expect 5 / 1 NULL AND ALTERNATIVE HYPOTHESES Notation: H0 . . . null hypothesis HA . . . alternative hypothesis 6 / 1 NULL AND ALTERNATIVE HYPOTHESES Notation: H0 . . . null hypothesis HA . . . alternative hypothesis Examples: 6 / 1 NULL AND ALTERNATIVE HYPOTHESES Notation: H0 . . . null hypothesis HA . . . alternative hypothesis Examples: One-sided test H0 : β ≤ 0 HA : β > 0 6 / 1 NULL AND ALTERNATIVE HYPOTHESES Notation: H0 . . . null hypothesis HA . . . alternative hypothesis Examples: One-sided test H0 : β ≤ 0 HA : β > 0 Two-sided test H0 : β = 0 HA : β = 0 6 / 1 TYPE I AND TYPE II ERRORS 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make Type I : We reject a true null hypothesis 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make Type I : We reject a true null hypothesis Type II : We do not reject a false null hypothesis 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make Type I : We reject a true null hypothesis Type II : We do not reject a false null hypothesis Example: H0 : β = 0 HA : β = 0 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make Type I : We reject a true null hypothesis Type II : We do not reject a false null hypothesis Example: H0 : β = 0 HA : β = 0 Type I error: it holds that β = 0, we conclude that β = 0 7 / 1 TYPE I AND TYPE II ERRORS It would be unrealistic to think that conclusions drawn from regression analysis will always be right There are two types of errors we can make Type I : We reject a true null hypothesis Type II : We do not reject a false null hypothesis Example: H0 : β = 0 HA : β = 0 Type I error: it holds that β = 0, we conclude that β = 0 Type II error: it holds that β = 0, we conclude that β = 0 7 / 1 TYPE I AND TYPE II ERRORS 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent HA : The defendant is guilty 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent HA : The defendant is guilty Type I error = Sending an innocent person to jail 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent HA : The defendant is guilty Type I error = Sending an innocent person to jail Type II error = Freeing a guilty person 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent HA : The defendant is guilty Type I error = Sending an innocent person to jail Type II error = Freeing a guilty person Obviously, lowering the probability of Type I error means increasing the probability of Type II error 8 / 1 TYPE I AND TYPE II ERRORS Example: H0 : The defendant is innocent HA : The defendant is guilty Type I error = Sending an innocent person to jail Type II error = Freeing a guilty person Obviously, lowering the probability of Type I error means increasing the probability of Type II error In hypothesis testing, we focus on Type I error and we ensure that its probability is not unreasonably large 8 / 1 DECISION RULE 9 / 1 DECISION RULE 1. Calculate sample statistic 2. Compare sample statistic with the critical value (from the statistical tables) The critical value divides the range of possible values of the statistic into two regions: acceptance region and rejection region If the sample statistic falls into the rejection region, we reject H0 If the sample statistic falls into the acceptance region, we do not reject H0 The idea is that if the value of the coefficient does not support H0, the sample statistic should fall into the rejection region 9 / 1 ONE-SIDED REJECTION REGION 10 / 1 ONE-SIDED REJECTION REGION H0 : β ≤ 0 vs HA : β > 0 10 / 1 ONE-SIDED REJECTION REGION H0 : β ≤ 0 vs HA : β > 0 Distribution of β: Acceptance region Rejection region Probability of Type I error 10 / 1 TWO-SIDED REJECTION REGION 11 / 1 TWO-SIDED REJECTION REGION H0 : β = 0 vs HA : β = 0 11 / 1 TWO-SIDED REJECTION REGION H0 : β = 0 vs HA : β = 0 Distribution of β: Acceptance region Rejection regionRejection region Probability of Type I error 11 / 1 THE t-TEST 12 / 1 THE t-TEST We use t-test to test hypothesis about individual regression slope coefficients 12 / 1 THE t-TEST We use t-test to test hypothesis about individual regression slope coefficients Test of more than one coefficient at a time (joint hypotheses) are typically done with the F-test (see next lecture) 12 / 1 THE t-TEST We use t-test to test hypothesis about individual regression slope coefficients Test of more than one coefficient at a time (joint hypotheses) are typically done with the F-test (see next lecture) The t-test is appropriate to use when the stochastic error term is normally distributed and when the variance of that distribution is unknown 12 / 1 THE t-TEST We use t-test to test hypothesis about individual regression slope coefficients Test of more than one coefficient at a time (joint hypotheses) are typically done with the F-test (see next lecture) The t-test is appropriate to use when the stochastic error term is normally distributed and when the variance of that distribution is unknown These are the usual assumptions in regression analyses 12 / 1 THE t-TEST We use t-test to test hypothesis about individual regression slope coefficients Test of more than one coefficient at a time (joint hypotheses) are typically done with the F-test (see next lecture) The t-test is appropriate to use when the stochastic error term is normally distributed and when the variance of that distribution is unknown These are the usual assumptions in regression analyses The t-test accounts for differences in the units of measurement of the variables 12 / 1 THE t-TEST Consider the model y = β0 + β1x1 + β2x2 + ε 13 / 1 THE t-TEST Consider the model y = β0 + β1x1 + β2x2 + ε Suppose we want to test (b is some constant) H0 : β1 = b vs HA : β1 = b 13 / 1 THE t-TEST Consider the model y = β0 + β1x1 + β2x2 + ε Suppose we want to test (b is some constant) H0 : β1 = b vs HA : β1 = b We know that β1 ∼ N β1, Var(β1) ⇒ β1 − β1 Var(β1) ∼ N(0, 1) 13 / 1 THE t-TEST Problem: Var(β1) depends on the variance of error term σ2, which is unobservable and therefore unknown 14 / 1 THE t-TEST Problem: Var(β1) depends on the variance of error term σ2, which is unobservable and therefore unknown It has to be estimated as ˆσ2 := s2 = e e n − k , k is the number of regression coefficients (here k = 3) e is the vector of residuals 14 / 1 THE t-TEST Problem: Var(β1) depends on the variance of error term σ2, which is unobservable and therefore unknown It has to be estimated as ˆσ2 := s2 = e e n − k , k is the number of regression coefficients (here k = 3) e is the vector of residuals We denote standard error of β1 (sample counterpart of standard deviation σβ1 ) as s.e. β1 14 / 1 THE t-TEST We define the t-statistic t := β1 − β1 s.e. β1 ∼ tn−k where β1 is the estimated coefficient and β1 is the value of the coefficient that is stated in our hypothesis 15 / 1 THE t-TEST We define the t-statistic t := β1 − β1 s.e. β1 ∼ tn−k where β1 is the estimated coefficient and β1 is the value of the coefficient that is stated in our hypothesis This statistic depends only on the estimate β1, our hypothesis about β1, and it has a known distribution 15 / 1 TWO-SIDED t-TEST 16 / 1 TWO-SIDED t-TEST Our hypothesis is H0 : β1 = b vs HA : β1 = b 16 / 1 TWO-SIDED t-TEST Our hypothesis is H0 : β1 = b vs HA : β1 = b Hence, our t-statistic is t = β1 − b s.e. β1 16 / 1 TWO-SIDED t-TEST Our hypothesis is H0 : β1 = b vs HA : β1 = b Hence, our t-statistic is t = β1 − b s.e. β1 where β1 is the estimated regression coefficient of β1 b is the constant from our null hypothesis s.e. β1 is the estimated standard error of β1 16 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? 17 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? The critical value is the value that distinguishes the acceptance region from the rejection region 17 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? The critical value is the value that distinguishes the acceptance region from the rejection region 1. We set the probability of Type I error 17 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? The critical value is the value that distinguishes the acceptance region from the rejection region 1. We set the probability of Type I error Let’s set the Type I. error to 5% We say the p-value of the test is 5% or that we have a test at 95% confidence level 17 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? The critical value is the value that distinguishes the acceptance region from the rejection region 1. We set the probability of Type I error Let’s set the Type I. error to 5% We say the p-value of the test is 5% or that we have a test at 95% confidence level 2. We find the critical values in the statistical tables: tn−k,0.975 and tn−k,0.025 17 / 1 TWO-SIDED t-TEST How to determine the critical value for this test statistic? The critical value is the value that distinguishes the acceptance region from the rejection region 1. We set the probability of Type I error Let’s set the Type I. error to 5% We say the p-value of the test is 5% or that we have a test at 95% confidence level 2. We find the critical values in the statistical tables: tn−k,0.975 and tn−k,0.025 The critical value depends on the chosen level of Type I error and n − k Note that tn−k,0.975 = −tn−k,0.025 17 / 1 TWO-SIDED t-TEST Rejection region : p-value = 5% Distribution tn-k 2.5 % 2.5 % tn-k,0.975tn-k,0.025 18 / 1 TWO-SIDED t-TEST Rejection region : p-value = 5% Distribution tn-k 2.5 % 2.5 % tn-k,0.975tn-k,0.025 We reject H0 if |t| > tn−k,0.975 18 / 1 ONE-SIDED t-TEST 19 / 1 ONE-SIDED t-TEST Suppose our hypothesis is H0 : β1 ≤ b vs HA : β1 > b 19 / 1 ONE-SIDED t-TEST Suppose our hypothesis is H0 : β1 ≤ b vs HA : β1 > b Our t-statistic still is t = β1 − b s.e. β1 19 / 1 ONE-SIDED t-TEST Suppose our hypothesis is H0 : β1 ≤ b vs HA : β1 > b Our t-statistic still is t = β1 − b s.e. β1 We set the probability of Type I error to 5% 19 / 1 ONE-SIDED t-TEST Suppose our hypothesis is H0 : β1 ≤ b vs HA : β1 > b Our t-statistic still is t = β1 − b s.e. β1 We set the probability of Type I error to 5% We compare our statistic to the critical value tn−k,0.95 19 / 1 ONE-SIDED t-TEST Rejection region : p-value = 5% Distribution tn-k 5% tn-k,0.95 20 / 1 ONE-SIDED t-TEST Rejection region : p-value = 5% Distribution tn-k 5% tn-k,0.95 We reject H0 if t > tn−k,0.95 20 / 1 SIGNIFICANCE OF THE COEFFICIENT 21 / 1 SIGNIFICANCE OF THE COEFFICIENT The most common test performed in regression is H0 : β = 0 vs HA : β = 0 21 / 1 SIGNIFICANCE OF THE COEFFICIENT The most common test performed in regression is H0 : β = 0 vs HA : β = 0 with the t-statistic t = β s.e. β ∼ tn−k 21 / 1 SIGNIFICANCE OF THE COEFFICIENT The most common test performed in regression is H0 : β = 0 vs HA : β = 0 with the t-statistic t = β s.e. β ∼ tn−k If we reject H0 : β = 0, we say the coefficient β is significant 21 / 1 SIGNIFICANCE OF THE COEFFICIENT The most common test performed in regression is H0 : β = 0 vs HA : β = 0 with the t-statistic t = β s.e. β ∼ tn−k If we reject H0 : β = 0, we say the coefficient β is significant This t-statistic is displayed in most regression outputs 21 / 1 THE p-VALUE 22 / 1 THE p-VALUE Classical approach to hypothesis testing: first choose the significance level, then test the hypothesis at the given level of significance (e.g. 5%) However, there is no ”correct” significance level. 22 / 1 THE p-VALUE Classical approach to hypothesis testing: first choose the significance level, then test the hypothesis at the given level of significance (e.g. 5%) However, there is no ”correct” significance level. 22 / 1 THE p-VALUE Classical approach to hypothesis testing: first choose the significance level, then test the hypothesis at the given level of significance (e.g. 5%) However, there is no ”correct” significance level. Or we can ask a more informative question: What is the smallest significance level at which the null hypothesis would still be rejected? This level of significance is known as the p-value. Remember that the significance level describes the probability of type I. error. The smaller the p-value, the smaller the probability of rejecting the true null hypothesis (the bigger the confidence the null hypothesis is indeed correctly rejected). The p-value for H0 : β = 0 is displayed in most regression outputs 22 / 1 EXAMPLE 23 / 1 EXAMPLE Let us study the impact of years of education on wages: 23 / 1 EXAMPLE Let us study the impact of years of education on wages: wage = β0 + β1education + β2experience + ε 23 / 1 EXAMPLE Let us study the impact of years of education on wages: wage = β0 + β1education + β2experience + ε Output from Gretl: 23 / 1 EXAMPLE Let us study the impact of years of education on wages: wage = β0 + β1education + β2experience + ε Output from Gretl:              23 / 1 CONFIDENCE INTERVAL 24 / 1 CONFIDENCE INTERVAL A 95% confidence interval of β is an interval centered around β such that β falls into this interval with probability 95% 24 / 1 CONFIDENCE INTERVAL A 95% confidence interval of β is an interval centered around β such that β falls into this interval with probability 95% P β − c < β < β + c = = P  − c s.e. β < β − β s.e. β < c s.e. β   = 0.95 24 / 1 CONFIDENCE INTERVAL A 95% confidence interval of β is an interval centered around β such that β falls into this interval with probability 95% P β − c < β < β + c = = P  − c s.e. β < β − β s.e. β < c s.e. β   = 0.95 Since β−β s.e.(β) ∼ tn−k, we derive the confidence interval: β ± tn−k,0.975 · s.e. β 24 / 1 CONFIDENCE INTERVAL Output from Gretl (wage regression): 25 / 1 CONFIDENCE INTERVAL Output from Gretl (wage regression):               25 / 1 CONFIDENCE INTERVAL Output from Gretl (wage regression):               Confidence interval for coefficient on education: β ± tn−k,0.975 · s.e. β = 0.644 ± 1.960 · 0.054 β ∈ [0.538; 0.750] with 95% probability 25 / 1 SUMMARY 26 / 1 SUMMARY We discussed the principle of hypothesis testing 26 / 1 SUMMARY We discussed the principle of hypothesis testing We derived the t-statistic 26 / 1 SUMMARY We discussed the principle of hypothesis testing We derived the t-statistic We defined the concept of the p-value 26 / 1 SUMMARY We discussed the principle of hypothesis testing We derived the t-statistic We defined the concept of the p-value We explained what significance of a coefficient means 26 / 1 SUMMARY We discussed the principle of hypothesis testing We derived the t-statistic We defined the concept of the p-value We explained what significance of a coefficient means We observed a regression output on an example 26 / 1