ECON3150/4150 Spring 2015

Similar documents
ECON3150/4150 Spring 2016

ECON3150/4150 Spring 2016

ECON2228 Notes 2. Christopher F Baum. Boston College Economics. cfb (BC Econ) ECON2228 Notes / 47

The Simple Linear Regression Model

Wooldridge, Introductory Econometrics, 4th ed. Chapter 2: The simple regression model

ECON The Simple Regression Model

Econometrics I KS. Module 1: Bivariate Linear Regression. Alexander Ahammer. This version: March 12, 2018

Essential of Simple regression

ECON Introductory Econometrics. Lecture 5: OLS with One Regressor: Hypothesis Tests

Econometrics I KS. Module 2: Multivariate Linear Regression. Alexander Ahammer. This version: April 16, 2018

Lecture 5. In the last lecture, we covered. This lecture introduces you to

Chapter 2: simple regression model

Linear Regression with Multiple Regressors

ECON Introductory Econometrics. Lecture 7: OLS with Multiple Regressors Hypotheses tests

Applied Statistics and Econometrics

Review of Econometrics

Simple Linear Regression: The Model

ECON Introductory Econometrics. Lecture 4: Linear Regression with One Regressor

Econometrics I Lecture 3: The Simple Linear Regression Model

The Simple Regression Model. Part II. The Simple Regression Model

Empirical Application of Simple Regression (Chapter 2)

Lab 6 - Simple Regression

2. Linear regression with multiple regressors

Introductory Econometrics

Linear Regression with 1 Regressor. Introduction to Econometrics Spring 2012 Ken Simons

Statistical Inference with Regression Analysis

Linear Regression with Multiple Regressors

Regression Analysis with Cross-Sectional Data

Introduction to Econometrics Third Edition James H. Stock Mark W. Watson The statistical analysis of economic (and related) data

THE MULTIVARIATE LINEAR REGRESSION MODEL

Intermediate Econometrics

ECON Introductory Econometrics. Lecture 17: Experiments

Homoskedasticity. Var (u X) = σ 2. (23)

The Simple Regression Model. Simple Regression Model 1

Economics 113. Simple Regression Assumptions. Simple Regression Derivation. Changing Units of Measurement. Nonlinear effects

ECON Introductory Econometrics. Lecture 6: OLS with Multiple Regressors

Multiple Linear Regression CIVL 7012/8012

ECO220Y Simple Regression: Testing the Slope

Regression with a Single Regressor: Hypothesis Tests and Confidence Intervals

Applied Statistics and Econometrics

WISE MA/PhD Programs Econometrics Instructor: Brett Graham Spring Semester, Academic Year Exam Version: A

WISE MA/PhD Programs Econometrics Instructor: Brett Graham Spring Semester, Academic Year Exam Version: A

Lecture 4: Multivariate Regression, Part 2

Basic econometrics. Tutorial 3. Dipl.Kfm. Johannes Metzler

ECON Introductory Econometrics. Lecture 11: Binary dependent variables

ECON Introductory Econometrics. Lecture 13: Internal and external validity

The Classical Linear Regression Model

Intro to Applied Econometrics: Basic theory and Stata examples

Greene, Econometric Analysis (7th ed, 2012)

1 Warm-Up: 2 Adjusted R 2. Introductory Applied Econometrics EEP/IAS 118 Spring Sylvan Herskowitz Section #

Lab 07 Introduction to Econometrics

Contest Quiz 3. Question Sheet. In this quiz we will review concepts of linear regression covered in lecture 2.

Statistical Modelling in Stata 5: Linear Models

Nonlinear Regression Functions

Two-Variable Regression Model: The Problem of Estimation

Problem Set #3-Key. wage Coef. Std. Err. t P> t [95% Conf. Interval]

Question 1a 1b 1c 1d 1e 2a 2b 2c 2d 2e 2f 3a 3b 3c 3d 3e 3f M ult: choice Points

ECON Introductory Econometrics. Lecture 2: Review of Statistics

sociology sociology Scatterplots Quantitative Research Methods: Introduction to correlation and regression Age vs Income

5. Let W follow a normal distribution with mean of μ and the variance of 1. Then, the pdf of W is

Week 3: Simple Linear Regression

Inference. ME104: Linear Regression Analysis Kenneth Benoit. August 15, August 15, 2012 Lecture 3 Multiple linear regression 1 1 / 58

Section Least Squares Regression

Econometrics Multiple Regression Analysis: Heteroskedasticity

Introduction to Econometrics. Review of Probability & Statistics

1 Linear Regression Analysis The Mincer Wage Equation Data Econometric Model Estimation... 11

1: a b c d e 2: a b c d e 3: a b c d e 4: a b c d e 5: a b c d e. 6: a b c d e 7: a b c d e 8: a b c d e 9: a b c d e 10: a b c d e

Environmental Econometrics

LECTURE 6. Introduction to Econometrics. Hypothesis testing & Goodness of fit

Lecture 4: Multivariate Regression, Part 2

Chapter 6: Linear Regression With Multiple Regressors

ECON Introductory Econometrics. Lecture 16: Instrumental variables

Warwick Economics Summer School Topics in Microeconometrics Instrumental Variables Estimation

WISE International Masters

Measurement Error. Often a data set will contain imperfect measures of the data we would ideally like.

Final Exam. Question 1 (20 points) 2 (25 points) 3 (30 points) 4 (25 points) 5 (10 points) 6 (40 points) Total (150 points) Bonus question (10)

General Linear Model (Chapter 4)

Applied Regression. Applied Regression. Chapter 2 Simple Linear Regression. Hongcheng Li. April, 6, 2013

Section I. Define or explain the following terms (3 points each) 1. centered vs. uncentered 2 R - 2. Frisch theorem -

Simple Linear Regression

Motivation for multiple regression

Econometrics Midterm Examination Answers

Applied Statistics and Econometrics

Ordinary Least Squares Regression Explained: Vartanian

Recent Advances in the Field of Trade Theory and Policy Analysis Using Micro-Level Data

Introduction to Econometrics

MFin Econometrics I Session 4: t-distribution, Simple Linear Regression, OLS assumptions and properties of OLS estimators

Multivariate Regression Analysis

Introduction to Econometrics. Multiple Regression (2016/2017)

Handout 11: Measurement Error

Correlation and Regression

Inferences for Regression

Multiple Linear Regression

7 Introduction to Time Series

In Chapter 2, we learned how to use simple regression analysis to explain a dependent

Econometrics Homework 1

Statistics II. Management Degree Management Statistics IIDegree. Statistics II. 2 nd Sem. 2013/2014. Management Degree. Simple Linear Regression

Econometrics. Week 8. Fall Institute of Economic Studies Faculty of Social Sciences Charles University in Prague

Multiple Regression Analysis: Heteroskedasticity

Practical Econometrics. for. Finance and Economics. (Econometrics 2)

Transcription:

ECON3150/4150 Spring 2015 Lecture 3&4 - The linear regression model Siv-Elisabeth Skjelbred University of Oslo January 29, 2015 1 / 67

Chapter 4 in S&W Section 17.1 in S&W (extended OLS assumptions) 2 / 67

Overview In this lecture we will: Clear up some things from previous lecture Start on the linear regression model with one regressor 3 / 67

Standard deviation and standard error (σ) - Population standard deviation, the true standard deviation in the population. Sample standard deviation: (s) An estimator of the population standard deviation. s y is the estimate of the population standard deviation for the random variable Y of the population from which the sample was drawn. Standard error of an estimator: An estimator of the standard deviation of the estimator. SE(Ȳ ) = ˆσȲ = s y / n is the standard error of sample mean, which is an estimator of the standard deviation of Ȳ. The sample mean is an estimator of the population mean. 4 / 67

Standard deviation and standard error Population parameter Sample statistic µ = Population mean Ȳ =Sample estimate of population mean σ = Population standard deviation σȳ = Standard deviation of Ȳ s=sample standard deviation, estimator of σ SE(Ȳ ) = ˆσ ȳ =Standard error of Ȳ estimator of σȳ. 5 / 67

Standard error Standard error SE(Ȳ ) = s y n The standard error of the sample average says something about the uncertainty around the estimate of the mean. It is an estimate of how far the sample mean is likely to be from the population mean. The standard error falls as the sample size increases as the extent of chance variation is reduced. The standard error is used to indicate uncertainty around the estimate. 6 / 67

Sample standard deviation Sample standard deviation s y = 1 n 1 n (Y i Ȳ )2 i=1 The sample standard deviation is the degree to which individuals within the sample differs from the sample mean. The sample standard deviation will tend to the population standard deviation (σ y ) as the sample size increases. The sample standard deviation is used to describe how widely scattered the measurements are. 7 / 67

T-statistic A normally distributed variable (X) can be made standard normal by: Z = X µ σ/ n In practice we rarely know the population standard deviation required to calculate the standard normal variable Z. The alternative is to calculate the T variable: T = X µ s x / n Note that the t-distribution also depends on the assumption that X is normal distributed. The sample average is normally distributed whenever: X i is normally distributed. n is large (CLT). 8 / 67

The simple linear regression model 9 / 67

Definition of the simple linear regression model Goals of regression models: Estimate how X effects Y Explain Y in terms of X Study how Y varies with changes in X For example: Explained (y) Wages Grade Smoke consumption Crop Yield Explanatory (x) Education Hours of study Cigarette tax Fertilizer Can we write this in an econometric model? 10 / 67

The econometric model Econometric model An equation relating the dependent variable to a set of explanatory variables and unobserved disturbances, where unknown population parameters determine the ceteris paribus effect of each explanatory variable. The econometric model must: Allow for other factors than X to affect Y Specify a functional relationship between X and Y Captures a ceteris paribus effect of X on Y 11 / 67

The simple linear regression model The simple linear regression model can in general form be written as: Y = β 0 + β 1 X + u It is also called the bivariate linear regression model. The econometric model specifying the relationship between Y and X is typically referred to as the population regression line u: is the error term (some books use e or ɛ instead) and represents all factors other than X that affects Y. β 0 : Population constant term/intercept. β 1 : Population slope parameter, the change in Y associated with a one unit change in X. 12 / 67

The simple linear regression model If we increase X by then: Before: Y = β 0 + β 1 X + u After: Difference: Y + Y = β 0 + β 1 (X + X ) + (u + u) Y = β 1 X + u As long as u is zero β 1 measures the effect of a unit change in X on Y. 13 / 67

Example If we are interested in the effect of education on wages the model is: wages = β 0 + β 1 years of education + other factors here β 1 measure the ceteris paribus effect (holding all other factors constant) of one more year of education, that is: β 1 = change in wages change in education = wages education 14 / 67

Linear in parameters Y = β 0 + β 1 X + u The SLRM is linear in parameters (β 0 and β 1 ). The SLRM is named linear due to being linear in parameters. Linear in parameters simply means that the different parameters appear as multiplicative factors in each term. The above model is also linear in variables, but this does not need to be the case. In chapter 5 we will cover when X is a binary variable. In chapter 8 we will cover X and Y being natural logarithms as well as other functional forms of X. In chapter 11 we cover Y being binary 15 / 67

Terminology The variables X and Y have several different names that are used interchangeably: Left side (Y) Dependent variable Explained variable Response variable Predicted variable Regressand Right side (X) Independent variable Explanatory variable Control variable Predictor variable Regressor 16 / 67

Terminology The intercept β 0 and the slope β 1 are the coefficients or parameters of the population regression line. Another name for the population regression line is the population regression function. 17 / 67

Estimating the simple linear regression model The simple linear regression model is a model where the dependent variable is a linear function of a single independent variable, plus an error term. It aims at describing the relationship between the dependent variable and the independent variable in a population. But how do we estimate this line? 18 / 67

Estimating the simple linear regression model Need a sample of size n from the population Model: y i = β 0 + β 1 x i + u i where i is observation i u i is the error term for observation i 19 / 67

Ordinary Least Squares Ordinary Least Squares (OLS) is a method for estimating the unknown parameters in a linear regression model. The method is to minimize the sum of squared errors. The OLS estimator chooses the regression coefficients so that the estimated regression line is as close as possible to the observed data. Under the assumptions that we will discuss later OLS is the most efficient estimator of the linear population regression function. 20 / 67

Ordinary Least Squares OLS finds the line that is closest to the observed data by minimizing the squared errors. 21 / 67

Ordinary Least Squares The error is the horizontal distance between the regression line and the observation The value given by the regression line is the predicted value of Y i given X i. 22 / 67

Deriving the Ordinary Least Squares Let ˆβ 0 and ˆβ 1 be some estimators of β 0 and β 1. These estimators predict Y i and the prediction mistake (û i ) is defined as Y i ˆβ 0 ˆβ 1 X i. The sum of squared prediction mistakes over all n observations is: n (Y i ˆβ 0 ˆβ 1 X i ) 2 i=1 23 / 67

Deriving the Ordinary Least Squares OLS finds the values of ˆβ 0 and ˆβ 1 that minimize the sum of the squared prediction mistakes (the OLS estimator). 1 Use calculus to obtain the following first order conditions for this minimization problem. 2 2 n (Y i ˆβ 0 + ˆβ 1 X i ) = 0 (1) i=0 n X i (Y i ˆβ 0 + ˆβ 1 X i ) = 0 (2) i=0 24 / 67

2 Solve the first order conditions for the unknown ˆβ 0 and ˆβ 1 The resulting OLS estimates of β 0 and β 1 are ˆβ 0 = Ȳ ˆβ 1 X (3) and ˆβ 1 = n (X i X )(Y i Ȳ ) i=1 (4) n (X i X ) 2 i=1 25 / 67

Properties of OLS Given ˆβ 0 and ˆβ 1 we can obtain the predicted value Ŷ i for each observation. By definition each predicted value is on the OLS regression line. The OLS residuals (û i ) is the difference between Y i and its predicted value. If û i is positive(negative) the line underpredicts (overpredicts) Y i. The ideal case is û i = 0, but in most cases this is not true. 26 / 67

Properties of OLS By the definition of û i and the first OLS first order condition the sum of the prediction error is zero: n û i = 0 (5) i=1 The OLS residuals are chosen to make the residuals add up to zero. 27 / 67

Properties of OLS By the second FOC: n û i X i = 0 i=1 The sample covariance between the independent variable and the OLS residuals is zero. 28 / 67

Properties of OLS The point ( X, Ȳ ) is always on the regression line 29 / 67

Estimating OLS - example A sample of ACT scores (American College testing) and GPA (Grade point average) for eight college students Student GPA ACT 1 2.8 21 2 3.4 24 3 3.0 26 4 3.5 27 5 3.6 29 6 3.0 25 7 2.7 25 8 3.7 30 Calculate: ˆ GPA = ˆβ 0 + ˆβ 1 ACT 30 / 67

Estimating OLS - example Remember that: ˆβ 0 = Ȳ + ˆβ 1 X ACT = x = 1 n x i = 25.875 n GPA = ȳ = 1 n i n u i = 3.2125 ˆβ 0 3.2125 + ˆβ 1 25.875 i 31 / 67

Estimating OLS - example ˆβ 1 = n i=1 (X i X )(Y i Ȳ ) n i=1 (X i X ) 2 1) 2) Obs GPA ACT (x i x) (y i ȳ) 1*2 (x i x) 2 1 2.8 21-4.875-0.4125 2.01 23.77 2 3.4 24-1.875 0.1875-0.35 3.52 3 3.0 26 0.125-0.2125-0.03 0.02 4 3.5 27 1.125 0.2875 0.32 1.27 5 3.6 29 3.125 0.3875 1.21 9.77 6 3.0 25-0.875-0.2125 0.19 0.77 7 2.7 25-0.875-0.5125 0.45 0.77 8 3.7 30 4.125 0.4875 2.01 17.02 Av. 3.2125 25.875 Sum: 5.8125 56.875 32 / 67

Estimating OLS - example ACT = x = 1 n GPA = ȳ = 1 n n x i = 25.875 i n u i = 3.2125 ˆβ 1 = 5.8125/56.875 0.1022 ˆβ 0 3.2125 (0.1022) 25.875 0.5681 GPA ˆ = 0.5681 + 0.1022ACT ˆ i 33 / 67

Interpretation of example ˆ GPA = 0.5681 + 0.1022ACT A person that has a one unit higher ACT score than another is predicted to have approximately 0.1 higher GPA. 34 / 67

Another interpretation example Given a sample of 526 individuals the following OLS regression line can be estimated: wage ˆ = 0.90 + 0.54educ Intercept indicates that a person with zero education pay 90 cents per hour to work. The regression line does poor at low levels of education because only 18 people have less than 8 years of education. β 1 indicates that one more year of education increase hourly wage by 54 cent. 35 / 67

Linear regression You may have different goals with the regression. The goal can be: To describe the data in a scatterplot and no substantive meaning is attached to the regression line. To make forecasts, or predictions, of the value of Y for an entity not in the data set, for which we know the value of X. To estimate the causal effect on Y of a change in X. 36 / 67

Causality In this course we will take a practical approach to defining causality: Causality A causal effect is defined to be the effect measured in an ideal randomized controlled experiment. 37 / 67

Ideal Randomized Controlled experiment Ideal: subjects all follow the treatment protocol. Randomized: subjects from the population of interest are randomly assigned to a treatment or control group (so there are no confounding factors). Controlled: Having a control group permits measuring the differential effect of the treatment. Experiment: The treatment is assigned as part of the experiment, subjects have no choice, so there is no reverse causality in which subjects choose the treatment they think will work best. More about this will come in lecture 17. 38 / 67

Underlying assumptions of OLS The OLS estimator is unbiased, consistent and has asymptotically normal sampling distribution if: 1 Random sampling. 2 Large outliers are unlikely. 3 The conditional mean of u i given X i is zero. 39 / 67

Random sample As covered extensively in the lecture 2, the observations in the sample must be i.i.d. We will address the failure of random sampling assumption under time-series analysis. 40 / 67

Outliers Large outliers are unlikely when X i and Y i have final fourth moments. item Outliers can arise due to: Data entry errors. Sampling from a small population where some members of the population are very different from the rest. 41 / 67

Outliers Outlying observations can provide important information by increasing the variation in explanatory variables which reduce standard errors. However, including them can dramatically change the estimated slope. When dealing with outliers one may want to report the OLS regression both with and without the outliers. 42 / 67

Outliers 43 / 67

Zero conditional mean Assumptions 1 For simplicity we assume that E(u) = 0. 2 The average value of u does not depend on the value of X E(u X ) = E(u). Combining the two assumptions gives the zero conditional mean assumption E(u X ) = 0 44 / 67

Zero conditional mean Example: wages = β 0 + β 1 educ + u Ability is one of the elements in u. The zero conditional mean requires for example E(abil educ = 8) = E(abil educ = 16). The average ability level must be the same for all education levels for the assumption to hold. 45 / 67

Zero conditional mean assumption The conditional distribution of u i given X i has a mean of zero. I.e. the factors contained in u i are unrelated to X i 46 / 67

Efficiency of OLS OLS is the most efficient (the one with the lowest variance) among all linear unbiased estimators whenever: The three OLS assumptions hold AND The error is homoskedastic. 47 / 67

Measures of fit How well does the OLS regression line fit the data? The regression line can be divided into two elements: We can write that y i = ŷ i + û i ŷ i = ˆβ 0 + ˆβ 1 x is the systematic part - the part of Y explained by X. û i is the unsystematic part, the part of Y not explained by X. 48 / 67

Total sum of squares Total sum of squares TSS = SST n (y i ȳ) 2 i=0 Total sum of squares, the sum of squared deviations of Y i from its average SST is a measure of the total sample variation in the Y i, that is it measures how spread out the Y i are in the sample. 49 / 67

Explained sum of squares Explained sum of squares ESS n (ŷ i ȳ) 2 i=0 Explained sum of squares is the sum of squared deviations of the predicted value from its average. It measures the sample variation in Ŷ i 50 / 67

Sum of squared residuals Sum of squared residuals SSR n i=0 û 2 i Sum of squared residuals measures the sample variation in û 51 / 67

Terminology There is no uniform agreement about the abbreviations or the names of the measures of fit: Some textbooks denote total sum of squares SST and not TSS Some textbooks use SSE instead of ESS Stata used model sum of squares to denote ESS. Some say regression sum of squares for explained sum of squares. Some say error sum of squares instead of sum of squared residuals. 52 / 67

Decomposition of TSS TSS TSS = ESS + SSR 53 / 67

R-squared The regression R 2 is the fraction of the sample variance of Y i explained by X i. R 2 = ESS TSS = 1 SSR TSS The R 2 ranges between 0 and 1 R 2 = 0 - none of the variation in Y i is explained by X i R 2 = 1 - all the variation is explained by X i, all the data points lie on the OLS line. A high R 2 means that the regressor is good at predicting Y i (not necessarily the same as a good regression) 54 / 67

Standard error of the regression The standard error of the regression (SER) is an estimator of the standard deviation of the regression error u i. It measures the spread of the observation around the regression line. SER = sû where s 2 û = 1 n 2 n i=1 û 2 i = SSR n 2 55 / 67

Example Thursday January 22 15:16:17 2015 Page 1 (R) / / / / / / / / / / / / Statistics/Data Analysis 1. reg wage educ Source SS df MS Number of obs = 526 F( 1, 524) = 103.36 Model 1179.73204 1 1179.73204 Prob > F = 0.0000 Residual 5980.68225 524 11.4135158 R-squared = 0.1648 Adj R-squared = 0.1632 Total 7160.41429 525 13.6388844 Root MSE = 3.3784 wage Coef. Std. Err. t P> t [95% Conf. Interval] educ.5413593.053248 10.17 0.000.4367534.6459651 _cons -.9048516.6849678-1.32 0.187-2.250472.4407687 56 / 67

Interpretation of coefficients The interpretation of the coefficients depend on the unit of measurement. In the wage education example the unit of measurement for education is years of education while for wage it is dollar. Thus one more year of education is predicted to give $0.54 higher wages. 57 / 67

Change the unit of measurement If the dependent variable is multiplied by the constant c, the OLS intercept and slope estimates are also multiplied by c. If the independent variable is multiplied by som nonzero constant c, then the OLS slope coefficient is divided by c. 58 / 67

Unbiasedness of OLS It can be shown that E( ˆβ 1 ) = β 1 (appendix 4.3) thus β 1 is unbiased. This means that the sampling distribution of the estimator is centered about the value of the population parameter. Note: this is a property of the estimator and says nothing about whether an estimate for a given sample is equal to the population parameter. The crucial assumption is that E(u i X i )) = 0 which we will come back to in next lecture. 59 / 67

Variance of the OLS estimators How far can we expect ˆβ 1 to be away from β 1 on average? The variance is necessary to choose the most efficient estimator. 60 / 67

Homoskedasticity Homoskedasticity The error u has the same variance given any value of the explanatory variable, in other words: Var(u x) = σ 2 Homoskedasticity is not required for unbiased estimates. But it is an underlying assumption in the standard variance calculation of the parameters. To make the variance expression easy the assumption that the errors are homoskedastic are added. 61 / 67

Homoskedasticity The figure illustrates a situation where the errors are heteroskedastic, the variance of the error increases with X. 62 / 67

Variance of the OLS estimators It can be shown (appendix 4.3) that: Var( ˆβ 1 ) = 1 n var[(x i µ x )u i ] [var(x i )] 2 = var[(x i µ x )u i ] n i=1 (x i X ) 2 63 / 67

Variance of the OLS estimators The larger the variance of X, the smaller the variance of ˆβ 1. 64 / 67

Note on caution At this point you should be careful of reading too much into the regressions we do. We have not covered the grounds for establishing causal effects yet. 65 / 67

Regression and causality I Regression and causality Three possible theoretical causal relationships between X and Y. Our regression is cau I is true, and II (join causality) and III are true r XY = 0 in all three Can also be that a t variable (Z) causes b Y and X (spurious correlation) The regression is causal if I is true and II and III are not true. II is joint causality. III is reversed causality. Spurious correlation occurs if a third variable causes both Y and X. 66 / 67

Next week: Hypothesis testing - how to test if the slope is zero Confidence intervals for the slope 67 / 67