Topic 3 SRM 1
Topic 3 SRM 1
1
Historical origin of the term “Regression”:
2
The modern interpretation of REGRESSION:
3
4
Deposit Rate and Changes in Consumer Prices in Japan
(1987:Q1-2004:Q1)
5
SIMPLE REGRESSION MODEL
Y 1 2 X
1
X1 X2 X3 X4 X
Suppose that a variable Y is a linear function of another variable X, with unknown parameters 1 and 2
that we wish to estimate. Therefore, as a first approximation, we may write the function as
Y = 1 + 2X .
6
SIMPLE REGRESSION MODEL
Y 1 2 X
Q4
Q3
Q2
1 Q1
X1 X2 X3 X4 X
7
SIMPLE REGRESSION MODEL
Y P4
P1 Q4
Q3
Q2
1 Q1 P3
P2
X1 X2 X3 X4 X
In practice, most economic relationships are not exact and the actual
values of Y are different from those corresponding to the straight line.
8
SIMPLE REGRESSION MODEL
Y P4
Y 1 2 X u
P1 Q4
Q3
Q2
1 Q1 P3
P2
X1 X2 X3 X4 X
To allow for such divergences, we will write the model as Y = 1 + 2X + u, where u is a
disturbance term( 干扰项 ). A disturbance term is the deviation of an individual Yi around its
expected value. It is an unobservabable random variable taking positive or negative values.
9
SIMPLE REGRESSION MODEL
10
SIMPLE REGRESSION MODEL
12
SIMPLE REGRESSION MODEL
13
SIMPLE REGRESSION MODEL
Y P4
Y 1 2 X u
Q4
u 1 P1 Q3
Q2
1 Q1 P3
P2
1 2 X 1
X1 X2 X3 X4 X
14
SIMPLE REGRESSION MODEL
Y P4
P1
P3
P2
X1 X2 X3 X4 X
15
SIMPLE REGRESSION MODEL
Y P4
Yˆ b1 b2 X
P1
P3
b1 P2
X1 X2 X3 X4 X
16
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Yˆ b1 b2 X
R3 R4
R2
P1
R1 P3
b1 P2
X1 X2 X3 X4 X
The line is called the fitted model (估计模型) or sample regression model
(样本回归模型) and the values of Y predicted by it are called the fitted
values (估计值) of Y. They are given by the heights of the R points.
17
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Y Yˆ e (residual) e4
Yˆ b1 b2 X
R3 R4
R2
e1 P1 e3
e2
R1 P3
b1 P2
X1 X2 X3 X4 X
18
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Yˆ b1 b2 X
R3 R4
R2 Y 1 2 X u
P1
1 R1 P3
b1 P2
X1 X2 X3 X4 X
Note that the values of the residuals are not the same as the values
of the disturbance term. The diagram now shows the true unknown
relationship as well as the fitted line.
19
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Yˆ b1 b2 X
Q4 Y 1 2 X u
P1
Q3
Q2
1 Q1 P3
b1 P2
X1 X2 X3 X4 X
20
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Yˆ b1 b2 X
R3 R4
R2 Y 1 2 X u
P1
1 R1 P3
b1 P2
X1 X2 X3 X4 X
21
SIMPLE REGRESSION MODEL
Y (actual value)
Y Ŷ (fitted value) P4
Yˆ b1 b2 X
R3 R4 Y 1 2 X
R2
P1
1 R1 P3
b1 P2
X1 X2 X3 X4 X
If the fit is a good one, the residuals and the values of the disturbance
term will be similar, but they must be kept apart conceptually.
22
SIMPLE REGRESSION MODEL
We will draw the fitted line so as to minimize the sum of the squares of
the residuals, RSS. This is described as the Least Squares Criterion.
23
For PRM Y = 1 + 2X +u
n
RSS [Y (b b X )]
2
i 1
i 1 2 i
The result is the OLS estimators of β1 and β2
n
(X i X )(Yi Y )
̂ 2 i 1
n
i
( X X
i 1
) 2
ˆ1 Y ˆ2 X
e
i 1
i e1 ... en
25
SIMPLE REGRESSION MODEL
Y P4
Y P1
P3
P2
X1 X2 X3 X4 X
26
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Y
6
Y3
5 Y2
4
3 Y1
2
0
0 1 2 3 X
This sequence shows how the regression coefficients for a simple regression model are
derived, using the least squares criterion (OLS, for ordinary least squares).
27
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Y
6
Y3
5 Y2
4
3 Y1
2
0
0 1 2 3 X
We will start with a numerical example with just three observations: (1,3), (2,5), and (3,6).
28
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Y Yˆ3 b1 3b2
6
Y3
5 Y2
4 Yˆ2 b1 2b2
Yˆ1 b1 b2
3 Y1
2 b2
b1
1
0
0 1 2 3 X
^ = b + b X, we will determine the values of b and b that
Writing the fitted regression as Y 1 2 1 2
minimize RSS, the sum of the squares of the residuals.
29
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Y Yˆ3 b1 3b2
6
Y3
5 Y2
4 Yˆ2 b1 2b2
Yˆ1 b1 b2
3 Y1 e1 Y1 Yˆ1 3 b1 b2
2 b2 e2 Y2 Yˆ2 5 b1 2b2
b1
1 e3 Y3 Yˆ3 6 b1 3b2
0
0 1 2 3 X
30
SIMPLE REGRESSION ANALYSIS
RSS
0 6b1 12b2 28 0
b1
RSS
0 12b1 28b2 62 0
b2
For a minimum, the partial derivatives of RSS with respect to b1 and b2 should be zero.
31
SIMPLE REGRESSION ANALYSIS
RSS
0 6b1 12b2 28 0
b1
RSS
0 12b1 28b2 62 0
b2
b1 1.67, b2 1.50
Solving them, we find that RSS is minimized when b1 and b2 are equal to 1.67 and 1.50,
respectively.
32
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Y Yˆ3 b1 3b2
6
Y3
5 Y2
4 Yˆ2 b1 2b2
Yˆ1 b1 b2
3 Y1
2 b2
b1
1
0
0 1 2 3 X
33
DERIVING LINEAR REGRESSION COEFFICIENTS
True model : Y 1 2 X u
Fitted line : Yˆ 1.67 1.50 X
Y Yˆ3 6.17
6
Y3
5 Y2
4 Yˆ2 4.67
Yˆ1 3.17
3 Y1
2 1.50
1.67
1
0
0 1 2 3 X
34
DERIVING LINEAR REGRESSION COEFFICIENTS
Y True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Yn
Y1
X1 Xn X
Now we will do the same thing for the general case with n observations.
35
DERIVING LINEAR REGRESSION COEFFICIENTS
Y True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Yˆn b1 b2 X n
Yn
Y1
e1 e1 Y1 Yˆ1 Y1 b1 b2 X 1
.....
Yˆ1 b1 b2 X 1
b1 b2 en Yn Yˆn Yn b1 b2 X n
X1 Xn X
36
DERIVING LINEAR REGRESSION COEFFICIENTS
Y True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Yˆn b1 b2 X n
en
Yn
Y1
e1 e1 Y1 Yˆ1 Y1 b1 b2 X 1
.....
Yˆ1 b1 b2 X 1
b1 b2 en Yn Yˆn Yn b1 b2 X n
X1 Xn X
Similarly we define the residuals for the remaining observations. That for the last one is
marked.
37
DERIVING LINEAR REGRESSION COEFFICIENTS
38
DERIVING LINEAR REGRESSION COEFFICIENTS
39
SIMPLE REGRESSION ANALYSIS
RSS
0 2b2 X i2 2 X iYi 2b1 X i 0
b2
b2 X i2 X iYi b1 X i 0
b2 X i2 X iYi (Y b2 X ) X i 0
b2 X i2 X iYi (Y b2 X )nX 0
X X i
X i nX
40
SIMPLE REGRESSION ANALYSIS
RSS
0 2b2 X i2 2 X iYi 2b1 X i 0
b2
b2 X i2 X iYi b1 X i 0
b2 X i2 X iYi (Y b2 X ) X i 0
b2 X i2 X iYi (Y b2 X )nX 0
b2 X i2 nX 2 X iYi nXY
1 1
b2 X i2 X 2 X iYi XY
n n
Terms not involving b2 have been transferred to the right side and the equation has been
divided through by n.
41
SIMPLE REGRESSION ANALYSIS
RSS
0 2b2 X i2 2 X iYi 2b1 X i 0
b2
b2 X i2 X iYi b1 X i 0
b2 X i2 X iYi (Y b2 X ) X i 0
b2 X i2 X iYi (Y b2 X )nX 0
b2 X i2 nX 2 X iYi nXY
1 1
b2 X i2 X 2 X iYi XY
n n
b2 Var ( X ) Cov( X ,Y )
Hence we obtain a tidy expression for b2. Cov( X ,Y )
b2
Var( X ) 42
DERIVING LINEAR REGRESSION COEFFICIENTS
Y True model : Y 1 2 X u
Fitted line : Yˆ b1 b2 X
Yˆn b1 b2 X n
Yn
Y1
b1 Y b2 X
Yˆ1 b1 b2 X 1 Cov( X ,Y )
b2 b2
b1 Var( X )
X1 Xn X
We chose the parameters of the fitted line so as to minimize the sum of the squares of the
residuals. As a result, we derived the expressions for b1 and b2.
43
SIMPLE REGRESSION ANALYSIS
1
n
( X i X )(Yi Y )
( X i X )(Yi Y )
b2
1
(Xi X ) 2 i ( X X ) 2
n
1
n
X iYi XY
X iYi nXY
b2
1
Xi X
2 2 iX 2
n X 2
n
A further variation is obtained by using the alternative expressions for sample covariance
and variance derived in an earlier sequence.
44
INTERPRETATION OF A REGRESSION EQUATION
80
70
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
The scatter diagram shows hourly earnings in 1994 plotted against highest grade
completed for a sample of 570 respondents from the National Longitudinal Survey of Youth.
45
INTERPRETATION OF A REGRESSION EQUATION
80
70
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
Highest grade completed means just that for elementary and high school. Grades 13, 14,
and 15 mean completion of one, two and three years of college. Grade 16 means completion
of four-year college. Higher grades indicate years of postgraduate education.
46
INTERPRETATION OF A REGRESSION EQUATION
This is the output from a regression of earnings on highest grade completed, using
Eviews. For the time being, we will be concerned only with the estimates of the
parameters.
47
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
Here is the scatter diagram again, with the regression line shown.
48
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
49
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
S is measured in years (strictly speaking, grades completed), EARNINGS in dollars per
hour. So the slope coefficient implies that hourly earnings increase by $1.07 for each extra
year of schooling.
50
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
14
13
Hourly earnings ($)
$11.49
12
11
$1.07
10 One year
$10.41
9
7
10.8 11 11.2 11.4 11.6 11.8 12 12.2
Highest grade completed
The regression line indicates that completing 12th grade instead of 11th grade would
increase earnings by $1.073, from $10.413 to $11.486, as a general tendency.
52
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
You should ask yourself whether this is a plausible figure. If it is implausible, this could be
a sign that your model is misspecified in some way.
53
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
For low levels of education it might be plausible. But for high levels it would seem to be an
underestimate.
54
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
What about the constant term? Literally, the constant indicates that an individual with no
years of education would have to pay $1.39 per hour to be allowed to work. This does not
make any sense at all.
55
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
A safe solution to the problem is to limit the interpretation to the range of the sample data,
and to refuse to extrapolate on the ground that we have no evidence outside the data range.
56
INTERPRETATION OF A REGRESSION EQUATION
80
^
70
EARNINGS 1.391 1.073S
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
With this explanation, the only function of the constant term is to enable you to draw the
regression line at the correct height on the scatter diagram. It has no meaning of its own.
57
INTERPRETATION OF A REGRESSION EQUATION
80
70
60
Hourly earnings ($)
50
40
30
20
10
0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-10
Years of schooling
Another solution is to explore the possibility that the true relationship is nonlinear and that
we are approximating it with a linear regression.
58
EVIEWS
What is EViews?
• EViews provides sophisticated data analysis, regression, and
forecasting tools on windows-based computers.
• The immediate predecessor of EViews was MicroTSP, which was
initially developed by Robert Hall during his graduate studies
at Massachusetts Institute of Technology in the 1960s.
• With EViews you can quickly develop a statistical relation from your
data and then use the relation to forecast future values of the data.
• Areas where EViews can be useful include: scientific data analysis
and evaluation, financial analysis, macroeconomic forecasting,
simulation, sales forecasting, and cost analysis.
• EViews takes advantage of the visual features of modern Windows
software. Alternatively, you may use EView’s powerful command
and batch processing language.
1. Does earnings depend on education?
Earnings is the hourly earnings of the respondent, in
dollars, in 1994. Perform a regression of Earnings on S
and interpret the regression results.
2. Does weight depend on height?
Perform one regression of Weight85 on Height, and
one regression of Weight94 on Height, then interpret
the regression results and explain the difference
between those two regressions.
61