1 / 53

Regression with One Regressor: Hypothesis Tests and Confidence Intervals

Regression with One Regressor: Hypothesis Tests and Confidence Intervals. Hypothesis Testing Confidence intervals Regression when X is Binary Heteroskedasticity and Homoskedasticity Weighted Least Squares Summary and Assessment. Hypothesis Testing and the Standard Error of.

trilby
Download Presentation

Regression with One Regressor: Hypothesis Tests and Confidence Intervals

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. Regression with One Regressor:Hypothesis Tests and ConfidenceIntervals

  2. Hypothesis Testing • Confidence intervals • Regression when X is Binary • Heteroskedasticity and Homoskedasticity • Weighted Least Squares • Summary and Assessment

  3. Hypothesis Testing and the Standard Error of Suppose a skeptic suggests that reducing the number of students in a class has no effect on learning or, specifically, test scores. The skeptic thus asserts the hypothesis, We wish to test this hypothesis using data— reach a tentative conclusion whether it is correct or not.

  4. Null hypothesis and two-sided alternative: or, more generally, Null hypothesis and one-sided alternative: In economics, it is almost always possible to come up with stories in which an effect could “go either way,” so it is standard to focus on two-sided alternatives.

  5. In general, where the S.E. of the estimator is the square root of an estimator of the variance of the estimator. Applied to a hypothesis about : where is the hypothesized value of .

  6. Formula for SE( ) Recall the expression for the variance of (large n): where Estimator of the variance of is

  7. where is the residual. • There is no reason to memorize this. • It is computed automatically by regression software. • is reported by regression software. • It is less complicated than it seems. The numerator estimates Var(ν), the denominator estimates Var(X).

  8. The calculation of the t-statistic: • Reject at 5% significance level if |t| > 1.96. • p-value is=probability in tails outside • Both the previous statements are based on large-n approximation; typically n = 50 is large enough for the approximation to be excellent.

  9. Example: Test Scores and ST R, California data Estimated regression line: Regression software reports the standard errors: t-statistic testing • The 1% two-sided significance level is 2.58, so we reject the null at 1% significance level. • Alternatively, we can compute the p-value.

  10. The p-value based on the large-n standard normal approximation to the t-statistic is 0.00001.

  11. Confidence intervals for In general, if the sample distribution of an estimator is nomal for large n, then a 95% confidence interval can be constructed as estimator ±1.96 standard error, that is

  12. Example: Test Scores and STR, California data Estimated regression line: Regression software reports the standard errors. 95% confidence interval for : Equivalent statements: • The 95% confidence interval does not include zero. • The hypothesis = 0 is rejected at the 5% level.

  13. A concise (and conventional) way to report regressions: Put standard errors in parentheses below the estimated coefficients to which they apply. This expression gives a lot of information. • The estimated regression line is • The standard error of is 10.4. • The standard error of is 0.52 • The R2 is .05; the standard error of the regression is 18.6.

  14. Regression when X is Binary Sometimes a regressor is binary: • X = 1 if female, = 0 if male • X = 1 if treated (experimental drug), = 0 if not • X = 1 if small class size, = 0 if not Binary regressors are sometimes called “dummy” variables. So far, has been called a “slope,” but that doesn’t make much sense if X is binary. How do we interpret regression with a binary regressor?

  15. Interpreting regressions with a binary regressor where X is binary (Xi = 0 or 1). that is: so: which is the population difference in group means.

  16. Example: TestScore and STR, California data Let The OLS estimate of the regression line relating Test Score to D (with standard errors in parentheses) is: Difference in means between groups = 7.4;

  17. Compare the regression results with the group means, computed directly: • Estimation: • Test: This is the same as in the regression.

  18. Other Regression Statistics A natural question is how well the regression line “fits” or explains the data. There are two regression statistics that provide complementary measures of the quality of fit: • The regression R2 measures the fraction of the variance of Y that is explained by X; it is unitless and ranges between zero (no fit) and one (perfect fit) • The standard error of the regression measures the fit – the typical size of a regression residual – in the units of Y. The R2

  19. Write Yi as the sum of the OLS prediction + OLS residual: Yi = + The R2 is the fraction of the sample variance of Yi “explained” by the regression, that is, by : R2 = , where ESS = and TSS = .

  20. Heteroskedasticity and Homoskedasticity Heteroskedasticity, Homoskedasticity, and the Formula for the Standard Errors of and • What do these two terms mean? • Consequences of homoskedasticity. • Implication for computing standard errors.

  21. What do these two terms mean? If Var(u|X = x) is constant— that is, the variance of the conditional distribution of u given X does not depend on X, then u is said to be homoskedasticity (變異數齊一). Otherwise, u is said to be heteroskedastic(變異數不齊一).

  22. Homoskedasticity in a picture • E(u|X = x) = 0, u satisfies Least Squares Assumption #1. • The variance of u does not depend on x.

  23. Heteroskedasticity in a picture • E(u|X = x) = 0, u satisfies Least Squares Assumption #1. • The variance of u depends on x.

  24. Heteroskedastic or homoskedastic?

  25. Is heteroskedasticity present in the class size data?

  26. Recall the three least squares assumptions: • The conditional distribution of u given X has mean zero, that is, E(u|X = x) = 0. • (Xi , Yi ), i = 1, … , n, are i.i.d. • Large outliers are rare. Heteroskedasticity and homoskedasticity concern Var(u|X = x). Because we have not explicitly assumed homoskedastic errors, we have implicitly allowed for heteroskedasticity. So far we have assumed that u is heteroskedastic

  27. What if the errors are in fact homoskedastic? • You can prove that OLS has the lowest variance among estimators that are linear in Y . A result called the Gauss-Markov theorem. • The formula for the variance of and the OLS standard error simplifies. If , then Note: Var( ) is inversely proportional to Var(X). More spread in X means more information about .

  28. The nominator of Var( ) is

  29. Gauss-Markov conditions: Gauss-Markov Theorem: Under the Gauss-Markov conditions, the OLS estimator is BLUE (Best Linear Unbiased Estimator). That is, • for all linear conditionally unbiased estimators .

  30. where • is a linear unbiased estimator.

  31. Proof of the Gauss-Markov Theorem is a linear unbiased estimator of . For to be conditionally unbiased, we need

  32. With the above two conditions for Let , then and

  33. Therefore, has a greater conditional variance than if di ≠ 0 for any i=1,… ,n. If di = 0 for all i, then = , which proves that OLS is BLUE.

  34. General formula for the standard error of is the square root of Special case under homoskedasticity is

  35. The homoskedasticity-only formula for the standard error of and the “heteroskedasticity-robust” formula (the formula that is valid under heteroskedasticity) differ. In general, you get different standard errors using the different formulas. • Homoskedasticity-only standard errors are the default setting in regression software - sometimes the only setting (e.g. Excel). To get the general “heteroskedasticity-robust” standard errors you must override the default. • If you don’t override the default and there is in fact heteroskedasticity, will get the wrong standard errors (and wrong t-statistics and confidence intervals).

  36. If you use the “, robust” option, the STATA computes heteroskedasticity-robust standard errors. • Otherwise, STATA computes homoskedasticity-only standard errors.

  37. Weighted Least Squares Since OLS under homoskedasticity is efficient, traditional approach is trying to transform a heteroskedastic model into a homoskedastic model. Suppose the conditional variance of ui is a function of Xi

  38. Then we can divide both sides of the single-variable regression model by to obtain where The WLS estimator is the OLS estimator obtained by regressing on and .

  39. However, h(Xi ) is usually unknown, then we have to estimate h(Xi ) first to obtain . Then replace h(Xi ) with . This is called feasible WLS. • More importantly, the function form of h(‧) is usually unknown, then there is no way to systematically estimate h(Xi ). This is why, in practice, we usually only run OLS with robust standard error.

  40. The critical points: • If the errors are homoskedastic and you use the heteroskedastic formula for standard errors (the one we derived), you are OK. • If the errors are heteroskedastic and you use the homoskedasticity-only formula for standard errors, the standard errors are wrong. • The two formulas coincide (when n is large) in the special case of homoskedasticity. • The bottom line: you should always use the heteroskedasticity-based formulas- these are conventionally called the heteroskedasticity-robust standard errors.

  41. The Extended OLS Assumptions (II)

  42. Efficiency of OLS, part II:

  43. Some not-so-good thing about OLS

  44. Limitations of OLS, ctd.

  45. Inference if u is Homoskedastic and Normal: the Student t Distribution

  46. Practical implication:

  47. Summary andAssessment • The initial policy question: Suppose new teachers are hired so the student-teacherratio falls by one student per class. What is the effect ofthis policy intervention (this “treatment”) on test scores? • Does our regression analysis give a convincing answer?Not really - districts with low ST R tend to be ones withlots of other resources and higher income families,which provide kids with more learning opportunitiesoutside school. This suggests that • so

More Related