the simple regression model
DESCRIPTION
The Simple Regression Model. y = b 0 + b 1 x + u. Some Terminology. In the simple linear regression model, where y = b 0 + b 1 x + u , we typically refer to y as the Dependent Variable, or Left-Hand Side Variable, or Explained Variable, or Regressand. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/1.jpg)
The Simple Regression Model
y = 0 + 1x + u
![Page 2: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/2.jpg)
Some Terminology
In the simple linear regression model, where y = 0 + 1x + u, we typically refer to y as the Dependent Variable, or Left-Hand Side Variable, or Explained Variable, or Regressand
![Page 3: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/3.jpg)
Some Terminology, cont.
In the simple linear regression of y on x, we typically refer to x as the Independent Variable, or Right-Hand Side Variable, or Explanatory Variable, or Regressor, or Covariate, or Control Variables
![Page 4: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/4.jpg)
A Simple Assumption
The average value of u, the error term, in the population is 0. That is,
E(u) = 0
This is not a restrictive assumption, since we can always use 0 to normalize E(u) to 0
![Page 5: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/5.jpg)
Zero Conditional Mean
We need to make a crucial assumption about how u and x are related We want it to be the case that knowing something about x does not give us any information about u, so that they are completely unrelated. That is, that E(u|x) = E(u) = 0, which implies
E(y|x) = 0 + 1x
![Page 6: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/6.jpg)
..
x1 x2
E(y|x) as a linear function of x, where for any x the distribution of y is centered about E(y|x)
E(y|x) = 0 + 1x
y
f(y)
![Page 7: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/7.jpg)
Ordinary Least Squares
Basic idea of regression is to estimate the population parameters from a sample
Let {(xi,yi): i=1, …,n} denote a random sample of size n from the population
For each observation in this sample, it will be the case that
yi = 0 + 1xi + ui
![Page 8: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/8.jpg)
.
..
.
y4
y1
y2
y3
x1 x2 x3 x4
}
}
{
{
u1
u2
u3
u4
x
y
Population regression line, sample data pointsand the associated error terms
E(y|x) = 0 + 1x
![Page 9: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/9.jpg)
Deriving OLS Estimates
To derive the OLS estimates we need to realize that our main assumption of E(u|x) = E(u) = 0 also implies that
Cov(x,u) = E(xu) = 0
Why? Remember from basic probability that Cov(X,Y) = E(XY) – E(X)E(Y)
![Page 10: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/10.jpg)
Deriving OLS continued
We can write our 2 restrictions just in terms of x, y, 0 and , since u = y – 0 – 1x
E(y – 0 – 1x) = 0
E[x(y – 0 – 1x)] = 0
These are called moment restrictions
![Page 11: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/11.jpg)
Deriving OLS using M.O.M.
The method of moments approach to estimation implies imposing the population moment restrictions on the sample moments
What does this mean? Recall that for E(X), the mean of a population distribution, a sample estimator of E(X) is simply the arithmetic mean of the sample
![Page 12: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/12.jpg)
More Derivation of OLS
We want to choose values of the parameters that will ensure that the sample versions of our moment restrictions are true
The sample versions are as follows:
0ˆˆ
0ˆˆ
110
1
110
1
n
iiii
n
iii
xyxn
xyn
![Page 13: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/13.jpg)
More Derivation of OLS
Given the definition of a sample mean, and properties of summation, we can rewrite the first condition as follows
xy
xy
10
10
ˆˆ
or
,ˆˆ
![Page 14: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/14.jpg)
More Derivation of OLS
n
iii
n
ii
n
iii
n
iii
n
iiii
xxyyxx
xxxyyx
xxyyx
1
21
1
11
1
111
ˆ
ˆ
0ˆˆ
![Page 15: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/15.jpg)
So the OLS estimated slope is
0 that provided
ˆ
1
2
1
2
11
n
ii
n
ii
n
iii
xx
xx
yyxx
![Page 16: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/16.jpg)
Summary of OLS slope estimate
The slope estimate is the sample covariance between x and y divided by the sample variance of x If x and y are positively correlated, the slope will be positive If x and y are negatively correlated, the slope will be negative Only need x to vary in our sample
![Page 17: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/17.jpg)
More OLS
Intuitively, OLS is fitting a line through the sample points such that the sum of squared residuals is as small as possible, hence the term least squares
The residual, û, is an estimate of the error term, u, and is the difference between the fitted line (sample regression function) and the sample point
![Page 18: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/18.jpg)
.
..
.
y4
y1
y2
y3
x1 x2 x3 x4
}
}
{
{
û1
û2
û3
û4
x
y
Sample regression line, sample data pointsand the associated estimated error terms
xy 10ˆˆˆ
![Page 19: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/19.jpg)
Alternate approach to derivation
Given the intuitive idea of fitting a line, we can set up a formal minimization problem
That is, we want to choose our parameters such that we minimize the following:
n
iii
n
ii xyu
1
2
101
ˆˆˆ
![Page 20: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/20.jpg)
Alternate approach, continued
If one uses calculus to solve the minimization problem for the two parameters you obtain the following first order conditions, which are the same as we obtained before, multiplied by n
0ˆˆ
0ˆˆ
110
110
n
iiii
n
iii
xyx
xy
![Page 21: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/21.jpg)
Algebraic Properties of OLS
The sum of the OLS residuals is zero
Thus, the sample average of the OLS residuals is zero as well
The sample covariance between the regressors and the OLS residuals is zero
The OLS regression line always goes through the mean of the sample
![Page 22: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/22.jpg)
Algebraic Properties (precise)
xy
ux
n
uu
n
iii
n
iin
ii
10
1
1
1
ˆˆ
0ˆ
0
ˆ
thus,and 0ˆ
![Page 23: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/23.jpg)
More terminology
SSR SSE SSTThen
(SSR) squares of sum residual theis ˆ
(SSE) squares of sum explained theis ˆ
(SST) squares of sum total theis
:following thedefine then Weˆˆ
part, dunexplainean and part, explainedan of up
made being asn observatioeach ofcan think We
2
2
2
i
i
i
iii
u
yy
yy
uyy
![Page 24: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/24.jpg)
Proof that SST = SSE + SSR
0 ˆˆ that know weand
SSE ˆˆ2 SSR
ˆˆˆ2ˆ
ˆˆ
ˆˆ
22
2
22
yyu
yyu
yyyyuu
yyu
yyyyyy
ii
ii
iiii
ii
iiii
![Page 25: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/25.jpg)
Goodness-of-Fit
How do we think about how well our sample regression line fits our sample data?
Can compute the fraction of the total sum of squares (SST) that is explained by the model, call this the R-squared of regression
R2 = SSE/SST = 1 – SSR/SST
![Page 26: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/26.jpg)
Using Stata for OLS regressions
Now that we’ve derived the formula for calculating the OLS estimates of our parameters, you’ll be happy to know you don’t have to compute them by hand
Regressions in Stata are very simple, to run the regression of y on x, just type
reg y x
![Page 27: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/27.jpg)
Unbiasedness of OLS
Assume the population model is linear in parameters as y = 0 + 1x + u Assume we can use a random sample of size n, {(xi, yi): i=1, 2, …, n}, from the population model. Thus we can write the sample model yi = 0 + 1xi + ui
Assume E(u|x) = 0 and thus E(ui|xi) = 0
Assume there is variation in the xi
![Page 28: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/28.jpg)
Unbiasedness of OLS (cont)
In order to think about unbiasedness, we need to rewrite our estimator in terms of the population parameter
Start with a simple rewrite of the formula as
22
21 where,ˆ
xxs
s
yxx
ix
x
ii
![Page 29: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/29.jpg)
Unbiasedness of OLS (cont)
ii
iii
ii
iii
iiiii
uxx
xxxxx
uxx
xxxxx
uxxxyxx
10
10
10
![Page 30: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/30.jpg)
Unbiasedness of OLS (cont)
211
21
2
ˆ
thusand ,
asrewritten becan numerator the,so
,0
x
ii
iix
iii
i
s
uxx
uxxs
xxxxx
xx
![Page 31: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/31.jpg)
Unbiasedness of OLS (cont)
1211
21
1ˆ
then,1ˆ
thatso ,let
iix
iix
i
ii
uEds
E
uds
xxd
![Page 32: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/32.jpg)
Unbiasedness Summary
The OLS estimates of 1 and 0 are unbiased Proof of unbiasedness depends on our 4 assumptions – if any assumption fails, then OLS is not necessarily unbiased Remember unbiasedness is a description of the estimator – in a given sample we may be “near” or “far” from the true parameter
![Page 33: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/33.jpg)
Variance of the OLS Estimators
Now we know that the sampling distribution of our estimate is centered around the true parameter Want to think about how spread out this distribution is Much easier to think about this variance under an additional assumption, soAssume Var(u|x) = 2 (Homoskedasticity)
![Page 34: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/34.jpg)
Variance of OLS (cont)
Var(u|x) = E(u2|x)-[E(u|x)]2
E(u|x) = 0, so 2 = E(u2|x) = E(u2) = Var(u)
Thus 2 is also the unconditional variance, called the error variance
, the square root of the error variance is called the standard deviation of the error
Can say: E(y|x)=0 + 1x and Var(y|x) = 2
![Page 35: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/35.jpg)
..
x1 x2
Homoskedastic Case
E(y|x) = 0 + 1x
y
f(y|x)
![Page 36: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/36.jpg)
.
x x1 x2
yf(y|x)
Heteroskedastic Case
x3
..
E(y|x) = 0 + 1x
![Page 37: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/37.jpg)
Variance of OLS (cont)
12
222
22
22
2222
2
2
22
2
2
2
211
ˆ1
11
11
1ˆ
Vars
ss
ds
ds
uVards
udVars
uds
VarVar
xx
x
ix
ix
iix
iix
iix
![Page 38: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/38.jpg)
Variance of OLS Summary
The larger the error variance, 2, the larger the variance of the slope estimate
The larger the variability in the xi, the smaller the variance of the slope estimate
As a result, a larger sample size should decrease the variance of the slope estimate
Problem that the error variance is unknown
![Page 39: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/39.jpg)
Estimating the Error Variance
We don’t know what the error variance, 2, is, because we don’t observe the errors, ui
What we observe are the residuals, ûi
We can use the residuals to form an estimate of the error variance
![Page 40: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/40.jpg)
Error Variance Estimate (cont)
2/ˆ2
1ˆ
is ofestimator unbiasedan Then,
ˆˆ
ˆˆ
ˆˆˆ
22
2
1100
1010
10
nSSRun
u
xux
xyu
i
i
iii
iii
![Page 41: The Simple Regression Model](https://reader035.vdocuments.site/reader035/viewer/2022062217/56812a5f550346895d8dce9a/html5/thumbnails/41.jpg)
Error Variance Estimate (cont)
21
21
1
2
/ˆˆse
, ˆ oferror standard the
have then wefor ˆ substitute weif
ˆsd that recall
regression theoferror Standardˆˆ
xx
s
i
x