P1.T2. Quantitative Analysis: Stock & Watson, Introduction To Econometrics Linear Regression With One Regressor
P1.T2. Quantitative Analysis: Stock & Watson, Introduction To Econometrics Linear Regression With One Regressor
Quantitative Analysis
Page 2
Linear Regression with one regressor -- continued
Page 3
Explain how regression analysis in econometrics measures the
relationship between dependent and independent variables.
A linear regression may have one or more of the following objectives:
• To estimate the (conditional) mean or average value of dependent
variable
• Test hypotheses about nature of dependence
• To predict or forecast dependent
• One or more of the above
Page 4
Explain how regression analysis in econometrics measures the
relationship between dependent and independent variables.
A linear regression may have one or more of the following objectives:
• To estimate the (conditional) mean or average value of dependent variable
• Test hypotheses about nature of dependence
• To predict or forecast dependent
• One or more of the above
In Stock and Watson, the authors regress student test scores against class size:
= + × +
Page 5
Define and interpret a population regression function, regression
coefficients, parameters, slope, intercept, and the error term.
In a univariate linear regression, there are two important coefficients:
• The slope coefficient measures the average change in the dependent variable
given a unit change in the independent variable. For example, if we regress
average weekly lotto spending against weekly income and the slope is 0.080, then a
one-dollar increase in income is associated with an 8 cent increase in lotto spending.
Page 6
Define and interpret a population regression function, regression
coefficients, parameters, slope, intercept, and the error term.
In a univariate linear regression, there are two important coefficients:
• The intercept is the predicted value of the dependent if the independent
variable is equal to zero. Assume an intercept of 7.62. This indicates that if income
were zero, the average lotto spending would be $7.62.
Page 7
Define and interpret a sample regression function, regression
coefficients, parameters, slope, intercept, and the error term.
Page 8
Define and interpret a sample regression function, regression
coefficients, parameters, slope, intercept, and the error term
(continued)
The regression coefficients and of the sample that minimize the sum of
squared errors between the observed values and those estimated by the
sample regression equation are called the ordinary least square estimators and
respectively. These OLS estimators are sample counterparts of the population
coefficients and .
Page 9
Define and interpret a sample regression function, regression
coefficients, parameters, slope, intercept, and the error term
(continued)
Note the correspondence between error term and the residual. As we specify
the model, we ex ante anticipate an error; after we analyze the observations, we
ex post observe residuals.
Page 10
Describe the key properties of a linear regression.
• The error term, u(i), has a conditional mean zero given X(i); that is E[u(i)|X(i)]
=0
• [X(i),Y(i)] are independent and identically distributed (i.i.d.) draws from their
joint distribution; and
• Large outliers are unlikely: X(i) and Y(i) have nonzero finite fourth moments
Page 11
Describe the key properties of a linear regression (continued)
Page 12
Describe the key properties of a linear regression (continued)
Page 13
Describe the key properties of a linear regression (continued)
Page 14
Describe the key properties of a linear regression (continued)
Page 15
Define an ordinary least squares (OLS) regression and calculate the
intercept and slope of the regression.
The regression coefficients chosen from the sample data are such that
these estimators of intercept and slope minimize the sum of squared
mistakes between the actual values and those estimated by the sample
regression equation. That is, the sum of the squared prediction errors is
minimized by these estimators.
( − ) = ( − − )
Page 16
Define an ordinary least squares (OLS) regression and calculate the
intercept and slope of the regression (continued)
The regression coefficients and of the sample that minimize the squared errors
are called the ordinary least square estimators and respectively. The OLS
estimators of intercept and slope are given as:
∑ ( )( )
= − = ∑
=
( )
where and are the sample averages of the independent and dependent variables
respectively. The OLS regression line, aka the sample regression line or sample
regression function, is the straight line constructed using these OLS estimators:
= +
The OLS residual is the difference between the actual and predicted values of :
= −
Page 17
Define an ordinary least squares (OLS) regression and calculate the
intercept and slope of the regression (continued)
While detailed OLS estimation in beyond our scope, consider the following two
tips. To illustrate, assume this really simple sample of ten data points (that is also
plotted below):
X(i) 1 2 3 4 5 6 7 8 9 10
Y(i) 2 4 6 7 4 5 7 9 6 9
Page 18
Define an ordinary least squares (OLS) regression and calculate the
intercept and slope of the regression (continued)
• If we are told (or can calculate) the standard deviations of the variables and the
correlation between them, we know the slope. In this case, σ(X) = 2.872, σ(Y) = 2.120,
and ρ(X,Y) = 0.7640. Because the slope is equal to σ(X,Y)/σ^2(y) = ρ(X,Y)*σ(Y)/ σ(Y),
we can see that the slope here is given by 0.7640*2.120/2.872 = 0.5636
Page 19
Describe the method and three key assumptions of OLS for
estimation of parameters.
The process of ordinary least squares estimation seeks to achieve the minimum
value for the residual sum of squares (squared residuals).
Page 20
Describe the method and three key assumptions of OLS for
estimation of parameters (continued)
The three key assumptions of the ordinary least squares (OLS) linear
regression model are:
1. Assumption # 1: The conditional distribution of the error term, given , has a
mean of zero. This assumption is a formal mathematical statement about the
“other factors” contained in the error term and asserts that these other factors are
unrelated to the independent variable, , in the following sense: given a value of
, the mean of the distribution of these other factors is zero.
3. Assumption # 3: The third least squares assumption is that large outliers are
unlikely. Large outliers can make OLS regression results misleading. Another
way to state this assumption is that X and Y have finite kurtosis. The
assumption of finite kurtosis is used in the mathematics to justify the large-
sample approximations to the distributions of the OLS test statistics.
Page 21
Summarize the benefits of using OLS estimators.
There are both practical and theoretical reasons to use the OLS
estimators.
• Commonly accepted and widely familiar: Because OLS
is the dominant method used in practice, it has become
the common language for regression analysis throughout
economics, finance and the social sciences. Presenting
results using OLS means that you are “speaking the same
language” as other economists and statisticians. The OLS
formulas are built into virtually all spreadsheet and
statistical software packages, making OLS easy to use.
Page 22
Describe the properties of OLS estimators and their sampling
distributions, and explain the properties of consistent estimators in
general.
Given the assumptions of the classical linear regression model, the least-
squares (OLS) estimates possess ideal properties. These properties are
contained in the well-known Gauss–Markov theorem. To understand this
theorem, we need to consider the best linear unbiasedness property of an
estimator. An OLS estimator is said to be a best linear unbiased estimator
(BLUE) if the following hold:
• It is linear, that is, a linear function of a random variable, such as the dependent
variable Y in the regression model.
• It is unbiased, that is, its average or expected value is equal to the true value
• It has minimum variance in the class of all such linear unbiased estimators; an
unbiased estimator with the least variance is known as an efficient estimator.
In the regression context, it can be proved that the OLS estimators are BLUE. This is the gist
of the famous Gauss–Markov theorem, which can be stated as follows:
• Gauss–Markov Theorem: Given the assumptions of the classical linear regression
model, the least-squares estimators, in the class of unbiased linear estimators, have
minimum variance, that is, they are BLUE.
Page 23
Define and interpret the explained sum of squares (ESS), the total
sum of squares (TSS), the sum of squared residuals (SSR), the
standard error of the regression (SER), and the regression .
We can break the regression equation into three parts:
1. The explained sum of squares (ESS) is the sum of squared deviation or distance
between the predicted ( )and the mean of ( )
ESS = ( − )
2. The sum of squared residuals (SSR) is the summation of each squared deviation
between the observed or actual ( )and the predicted . Thus, the sum of
squared residual (SSR) is also the square of the error term. The ordinary least square
(OLS) approach minimizes the SSR.
SSR = ( − ) =
3. The total sum of squares (TSS) is the sum of squared deviation of observed
( ) from its mean ( ). Therefore, TSS is equal to sum of ESS and SSR.
= ( − ) = +
Page 24
Define and interpret the explained sum of squares (ESS), the total sum of
squares (TSS), the sum of squared residuals (SSR), the standard error of
the regression (SER), and the regression (continued)
= = −
ranges from 0 to 1 and a larger value indicates that the regressor is good at
predicting the dependent variable.
Note: For a linear regression with only one independent variable, is the
square of the correlation between the dependent variable and the
independent variable .
Page 25
Define and interpret the explained sum of squares (ESS), the total sum of
squares (TSS), the sum of squared residuals (SSR), the standard error of
the regression (SER), and the regression (continued)
SER: It is the standard deviation of the Y values around the regression line.
That is, it is an estimator of the standard deviation of the regression error . So,
the SSR and the standard error of regression (SER) are directly related as:
= =
− −
Note the use of the use of − 2 instead of in the denominator. Division by this
smaller number—in this case ( − 2) instead of —is referred to as “an
unbiased estimate.”
Page 26
Define and interpret the explained sum of squares (ESS), the total sum of
squares (TSS), the sum of squared residuals (SSR), the standard error of
the regression (SER), and the regression (continued)
SER =
−
SER =
− −
Page 27
Interpret the results of an ordinary least squares (OLS) regression.
Taking the authors example of regressing test scores and class size, the
PRF is:
= + × +
Page 28
Interpret the results of an ordinary least squares (OLS) regression
(continued)
The sample data analyzed here consist of test scores (districtwide average) and
class sizes (districtwide student- teacher ratio) in 1999 in 420( ) California
school districts. The table below summarizes the distributions of tests cores and
class sizes for this sample. A scatterplot of these observations is shown in the
graph below.
Page 29
Interpret the results of an ordinary least squares (OLS) regression
(continued)
• The sample correlation is 0.23, indicating a weak negative relationship
between the two variables. Despite this low correlation, the sample
estimates a straight regression line which can predict the test scores
based on the class size (or STR)
• The sample regression coefficients
found using the equations given for
and are 698.93 and -2.2798
respectively.
• Thus, the sample regression line
estimated using these OLS
estimators is
= 698.93 − 2.2798 ×
Page 30
Interpret the results of an ordinary least squares (OLS) regression
(continued)
• From the slope of the regression equation, we can interpret
that an increase in the student-teacher ratio by one student
per class is, on average, associated with a decline in
districtwide test scores by approximately 2.28 points on the
test. The negative slope indicates that more students per
teacher (larger classes) is associated with poorer
performance on the test.
Page 31
Interpret the results of an ordinary least squares (OLS) regression
(continued)
The regression results are:
Excel Linest(.) This is the legend for the
regression output Linest(.) output to the left
STR intercept
(2.280) 698.933 β1 β0
0.480 9.467 SE(β1) SE(β0)
0.051 18.581 R^2 SER
22.575 418 F df
7,794 144,315 ESS SSR
Note: Both the slope and intercept are both significant at 95%, at least. The test
statistics are 73.8(=698.93/9.47) for the slope and 4.75 (=2.28/0.48). Given the
very high test statistic for the slope, its p-value is approximately zero.
Page 32
Interpret the results of an ordinary least squares (OLS) regression
(continued)
Manual regression calculations for Test Score
Data (See XLS for raw data) Note
Sum [X(i)*Y(i)] 5,392,704.6
Sum [X(i)^2 = str(i)^2) 163,513.0
Sum [Δx(i) = X(i) - Xavg] 0.0 by definition (average)
Sum [Δy(i) = Y(i) - Yavg] 0.0 by definition (average)
Sum [Δx(i)^2] 1,499.6
Sum [Δy(i)^2] 152,109.6
Sum [Δx(i)Δy(i)] (3,418.8)
Sum [(Y(i)Pred - Yavg)^2] 7,794.1 Explained sum of squares (ESS)
Sum [e(i) = Y(i) - fitted Y(i)] 0.0 by definition (OLS)
Sum [e(i)^2] 144,315.5 Sum of squared residuals (SSR)
Sum [X(i)*e(i)] 0.0 by OLS design per uncorrelated X(i), e(i)
Page 33
The End