














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















ME104: Linear Regression Analysis
Kenneth Benoit
August 14, 2012
I Relationship between X and Y in the population is linear:
E(Y ) = X β
I No extraneous variables in X
I No omitted independent variables
I Parameters (β) are constant
I (^) Var() = σ
2 , or homoskedastic errors
I (^) E(r i ,j
) = 0, or no auto-correlation
I (^) Objective: minimize
e
2
i
i
i
2 , where
I (^) Yˆ i
= b 0
X i
I error ei = (Yi −
ˆ Yi )
b =
(Xi −
X )(Yi −
i
i
i
∑
2
i
I (^) The intercept is: b 0 =
Y − b 1
I (^) Formula for coefficient β:
Y = X β +
′ Y = X
′ X β + X
′
′
Y = X
′
X β + 0
′ X )
− 1 X
′ Y = β + 0
β = (X
′
X )
− 1
X
′
Y
I Formula for variance-covariance matrix: σ
2 (X
′ X )
− 1
I In simple case where y = β 0 + β 1 ∗ x, this gives
σ
2 /
∑
(x i
− ¯x)
2 for the variance of β 1
I (^) Note how increasing the variation in X will reduce the variance
of β 1
I (^) The hat matrix H is defined as:
β = (X
′
X )
− 1
X
′
y
β = X (X
′ X )
− 1 X
′ y
y ˆ = Hy
′ X )
− 1 X
′ is called the hat-matrix
I (^) Other important quantities, such as ˆy ,
e
2
i
(RSS) can be
expressed as functions of H
I (^) Corrections for heteroskedastic errors (“robust” standard
errors) involve manipulating H
TSS Total sum of squares
i
2
SSM Model or Regression sum of squares
i
2
SSE Error or Residual sum of squares
∑
e
2
i
i
i
2
The key to remember is that TSS = SSM + SSE
2
I (^) Solid arrow: variation in y when X is unknown (TSS Total Sum of
Squares
∑
(yi − ¯y )
2 )
I (^) Dashed arrow: variation in y when X is known (SSM Model Sum of
Squares
∑
(ˆyi − ¯y )
2 )
2
I (^) A much over-used statistic: it may not be what we are
interested in at all
I Interpretation: the proportion of the variation in y that is
explained linearly by the independent variables
(y i
− yˆ i
2
(y i
− y¯ )
2
I (^) Alternatively, R
2 is the squared correlation coefficient between
y and ˆy
2
I (^) When a model has no intercept, it is possible for R
2 to lie
outside the interval (0, 1)
2 rises with the addition of more explanatory variables. For
this reason we often report “adjusted R
2 ”: 1 − (1 − R
2 )
n− 1
n−k− 1
where k is the total number of regressors in the linear model
(excluding the constant)
I (^) Whether R
2 is high or not depends a lot on the overall
variance in Y
I (^) To R
2 values from different Y samples cannot be compared
2
y = ˆy +
Var(y ) = Var(ˆy ) + Var(e) + 2Cov(ˆy , e)
Var(y ) = Var(ˆy ) + Var(e) + 0
(y i
− y¯ )
2 /N =
(ˆy i
ˆy )
2 /N +
(e i
− ˆe)
2 /N
(yi − y¯ )
2
=
(ˆyi −
ˆy )
2
(ei − ˆe)
2
(y i
− y¯ )
(ˆy i
ˆy )
2
e
2
i
2
I (^) y is the dependent variable
I referred to also (by Greene) as a regressand
I X are the independent variables
I also known as explanatory variables
I (^) also known as regressors
I y is regressed on X
I (^) The error term is sometimes called a disturbance
I (^) If the observations are expressed as deviations from their
means, y ∗ = y − y¯ and x
∗ = x − ¯x, then β =
x
∗ y
∗ /
x
∗ 2
I (^) The intercept can be estimated as ¯y − β¯x. This implies that
the intercept is estimated by the value that causes the sum of
the OLS residuals to equal zero.
I The mean of the ˆy values equals the mean y values – together
with previous properties, implies that the OLS regression line
passes through the overall mean of the data points
. use dail
(Ireland 2002 Dail Election - Candidate Spending Data)
. gen spendXinc = spend_total * incumb
(2 missing values generated)
. reg votes1st spend_total incumb minister spendXinc
Source | SS df MS Number of obs = 462
-------------+------------------------------ F( 4, 457) = 229.
Model | 2.9549e+09 4 738728297 Prob > F = 0.
Residual | 1.4739e+09 457 3225201.58 R-squared = 0.
-------------+------------------------------ Adj R-squared = 0.
Total | 4.4288e+09 461 9607007.17 Root MSE = 1795.
votes1st | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
spend_total | .2033637 .0114807 17.71 0.000 .1808021.
incumb | 5150.758 536.3686 9.60 0.000 4096.704 6204.
minister | 1260.001 474.9661 2.65 0.008 326.613 2193.
spendXinc | -.1490399 .0274584 -5.43 0.000 -.2030003 -.
_cons | 469.3744 161.5464 2.91 0.004 151.9086 786.