Topic 1. The simple linear
regression model:
estimation, inference and
prediction
Professor:
Jens Peters
Econometrics (EN)
Grado en Economía y Negocios Internacionales
UNIVERSIDAD DE ALCALÁ
CURSO 2024/2025
The Simple Linear Regression Model
Content
Definition of the Simple Regression Model (SLR).
Deriving the Ordinary Least Squares Estimates.
Deriving the Maximum-likelihood Estimation
Statistical Properties of Estimators
Inference
Definition of the SLR Model
Definition of the SLR Model and
key assumptions
Definition of the SLR Model
Some Terminology
Our goal is to find if one variable has causal effect on
another variable, ceteris paribus.
X has causal effect on Y: X→Y
Ceteris paribus: other factors are held constant
Example: How does one more year of education changes
income level, if all other relevant factors are held fixed?
Definition of the SLR Model
We will now look at the
relationship between two variables.
Assume that change in X causes change in Y:
∆X→∆Y
Y=hourly wage rate, X=years of education
1.
2.
3.
How about other factors affecting Y? Experience? Personal
ability? Other?
What is the functional form that describes the relationship
between Y and X?
How can we be sure we are capturing a ceteris paribus
relationship between Y and X?
Definition of the SLR Model
Let y = α + β x + u
be our simple (=one variable) linear regression (SLR) model.
Then:
y:
dependent variable, explained variable, regressand
x:
independent variable (not in statistical sense),
explanatory variable, regressor
u:
error term, disturbance, random disturbance term,
unobserved factors
Definition of the SLR Model
In the simple linear regression model y = α + β x + u
α and β are called parameters:
- α intercept parameter
- β slope parameter
Estimation of these parameters is the primary interest in
applied econometrics.
In our model,
•
β shows by how much y changes when x changes by
one unit, holding other factors constant.
•
α gives value of Y when X = 0
α and β are often also called β0 and β1
Definition of the SLR Model
Estimator or Estimate?
Estimators are the formulae used to calculate the
coefficients
Estimates are the actual numerical values for the
coefficients.
Assumptions of SLR
Assumptions
we are only able to get reliable estimators of α and β from a
random sample of data when we make assumptions
restricting how the unobservable u is related to the
explanatory variable x.
Without such a restriction, we will not be able to estimate the
ceteris paribus effect, β.
Because u and x are random variables, we need a concept
grounded in probability
Assumptions of SLR
Assumption SLR.1 – Linearity
The SLR model is linear in parameters. In other words:
In the population model, the dependent variable ‘y’ is related
to the independent variable ‘x’ and to the error ‘u’, as:
y = β 0 + β 1x + u
where
β0 is the population intercept and
β1 is the slope parameter
→ A one-unit change in x has the same effect on y, regardless
of the initial value of x
Assumptions of SLR
Assumption SLR.2 – Random sampling
We have a random sample of size n, {(xi,yi): i = 1, 2, …, n},
following the population model y = β0 + β1x + u
(as defined under SLR.1)
Failure of SLR.2 creates a bias in our sample and therefore in
the estimation of the SLR model
The random sampling condition is critical, yet often difficult to
ensure and not given in many datasets.
Assumptions of SLR
Assumption SLR.3 – Sample variation
The sample outcomes on x, namely, {xi, i = 1, …, n}, are not
all the same value.
-> Weak assumption, but:
OLS slope and intercept estimates are not defined unless we
have some sample variation in the explanatory variable.
Assumptions of SLR
Assumption SLR.4 - Zero Conditional Mean
An important assumption about how x and u are related is:
The error u has an expected value of zero,
given any value of the explanatory variable.
In other words, E(u|x)=0
➔
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) = α + x
population regression function (PRF)
Assumptions of SLR
Assumption SLR.4 - Zero Conditional Mean
Then, E(y|x) as a linear function of x, where for any x the
distribution of y is centered around E(y|x):
Econometrics I:
Lesson 2
Assumptions of SLR
Assumption SLR.4 - Zero Conditional Mean
This is not a very restrictive assumption, because our
empirical equation contains an intercept, α :
If E(u)=a≠0, we can always write:
y =
+a + x + u
− a = '+ x + u '
'
And now E(u’)=0.
u'
Another result is that:
y = + x + u = E ( y | x) + u
E ( y| x )
Systematic part
Unsystematic part
Assumptions of SLR
Assumption SLR.5 - Homoscedasticity
The error u has the same variance given any value of the
explanatory variable. In other words,
Var(u|x) = 2 , and, because E(u|x)=0 (SLR.4):
Var (u|x) = 2
We have so far assumed that the variance of the errors is
constant, 2 - this is known as homoscedasticity.
If the errors do not have a constant variance, we say that
they are heteroscedastic.
Assumptions of SLR
The Gauss-Markov Assumptions for SLR
SLR.1 – SLR.5 are also called the Gauss-Markov
Assumptions for simple linear regression (SLR)
Under the four Assumptions SLR.1 through SLR.4, the
OLS estimators (see next section) are unbiased .
The key assumption is SLR.4 i.e., that the error term u
has zero mean given any value of the independent
variable x
Deriving the OLS Estimates
Deriving the SLR Ordinary Least
Squares (OLS) Estimates
Deriving the OLS Estimates
The Basic idea of regression is to estimate the population
parameters from the available 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 = + Xi + ui
Deriving the OLS Estimates
As this relation of the population is not directly observable,
we estimate it from the sample:
Yˆi = a + bX i
where Yˆi denotes the fitted value from the regression line.
And the difference between the actual point and the fitted
value is:
ei = Yi − Yˆi = Yi - a - bX i
ei is the residual, not to be
confounded with the error term
ui!
Deriving the OLS Estimates
ei = Yi − Yˆi = Yi - a - bX i
Econometrics I:
Lesson 2
Deriving the OLS Estimates
The most common method used to fit a line to the data
is known as OLS (ordinary least squares).
What we actually do is take each distance and square it
(i.e. take the area of each of the squares in the
diagram) and minimise the total sum of the squares
(hence least squares).
There are others (such as maximum likelihood
estimators) that are better suited under specific
conditions.
However, under the Gauss-Markov Assumptions,
OLS is the Best Linear Unbiased Estimator (BLUE)
Deriving the OLS Estimates
Ordinary Least Squares (OLS)
1. The method of OLS (ordinary least squares) provides us
estimates of α and β that give the smallest possible value of
ei2. So:
n
n
e = (Y -a-bX ) = f(a,b)
i =1
2
i
2
i
i =1
n
i
n
2
e
=
(
Y
−
a
−
bX
)
i
min i min i
a ,b
i =1
2
a ,b
i =1
Deriving the OLS Estimates
2. First order conditions:
n
n
ei2
i =1
a
=0
ei2
i =1
b
=0
n
2
(Yi − a − bX i )
n
i =1
= 0 − 2 (Y − a − b X ) = 0
i
i
a
i =1
n
2
(Yi − a − bX i )
n
i =1
= 0 − 2 X (Y − a − b X ) = 0
i
i
i
b
i =1
These equations are known as the normal equations
Deriving the OLS Estimates
These conditions can be solved as a system of two
equations with two unknowns. And then:
_
_
a =Y−b X
n
_
_
(X − X)(Y − Y)
b = i=1 n
i
i
( X − X )
i
i=1
2
=
Cov(x,y)
Var(X)
Requires SLR.3 to hold!!
The estimators obtained are known as the least-squares
estimators.
Deriving the OLS Estimates
Example: Estimation of the consumption function
Given the Keynesian consumption function,
Consi = + Inci + ui
we will estimate it using data from six households:
(yi)
(xi)
.. and applying the equations from
_
_
the previous slide:
a =Y−b X
n
b=
_
_
(X − X)(Y − Y)
i
i
i=1
( X − X )
n
i
i=1
2
Deriving the OLS Estimates
Example: Estimation of the consumption function
(yi)
(xi)
(yi*xi)
(xi2)
(yi-𝑦)
ത
(xi-𝑥)
ҧ
(xi-𝑥)
ҧ 2
Applying the formulae for b and a from the previous slide, we obtain:
n
_
_
σ
(X − X)(Yi − Y) 50
β = i=1 i
= = 0.83
60
σni=1 X i − 𝑋ሜ 2
_
_
ෝ = Y − bX =
α
54
66
- 0.83 * = -0.16
6
6
𝒊 = -0.16 + 0.83 Inci + ei
Our estimated consumption function then is: 𝑪𝒐𝒏𝒔
Deriving the OLS Estimates
Interpretation of OLS coefficients
Our estimated consumption function is:
𝒊 = -0.16 + 0.83 Inci + ei
𝑪𝒐𝒏𝒔
.. but what does this mean?
➢ If income increases by one unit, the consumption increases (on average) by
0.83 units
Model
Level-level
Y = β0 + β1 X+ u
Log-level
LnY = β0 + β1 X+ u
Level-log
Y = β0 + β1 LnX+ u
Log-Log
LnY = β0 + β1 LnX+ u
Interpretation of the parameters
ΔY =β1Δ X
β1 gives us the expected change in Y if X
varies by one unit
Δ%Y =(100β1) ΔX
β1 *100 gives us the expected percentual
change in Y if X varies by one unit
ΔY =(β1/100) %ΔX
β1 /100 gives us the expected change in Y
if X varies by one per cent.
%ΔY =β1%ΔX
β1 gives us the expected percentual
change in Y if X varies by one per cent.
Properties the OLS Estimates
Properties the OLS Estimates
Properties the OLS Estimates
Algebraic Properties of OLS:
a) The point ( 𝑋ത , 𝑌ത ) is always on the OLS regression line.
Then, the mean value of the residuals ei is zero.
(First normal equation)
b) The sample covariance between the regressors and the
OLS residuals is zero (again, see second normal
𝑖
equation), and it is zero also between the predicted 𝑌
and the OLS residuals.
Properties of the OLS Estimates
Algebraic Properties of OLS:
c) Also, we can define the estimators:
_
_
a =Y−b X
n
x y
b = i=1n
i
i
x
2
i
sample covariance between x and y
Sample variance of x
i=1
Where:
xi = X i − X
yi = Yi − Y
Properties of the OLS Estimates
Algebraic Properties of OLS:
d) We can think of each observation as being made up of an
explained part, and an unexplained part, Yi = Yˆi + ei
Then, we define the following:
𝑌𝑖 − 𝑌ሜ 2 is the total sum of squares (SST)
2
ሜ
𝑌𝑖 − 𝑌 is the explained sum of squares (SSE)
𝑒𝑖2 is the residual sum of squares (SSR)
Then SST = SSE + SSR
Properties of the OLS Estimates
Estimating the Variance of the Disturbance Term
The variance of the random variable ui is given by:
Var(ui) = E[(ui)-E(ui)]2
which reduces to
Var(ui) = E(ui2) under SLR.4
We could estimate this using the average of ui2 . Unfortunately, this
is not feasible since ui is not observable. We can use the sample
counterpart to ui, which is 𝑢ො 𝑖 , or ei :
2
𝑁
σ
𝑆𝑆𝑅
𝑒
𝑛=1
𝑖
𝑠𝑢2 = 𝜎ො 2 =
=
𝑑𝑓
𝑑𝑓
2
𝑁
σ
𝑆𝑆𝑅
𝑒
𝑛=1
𝑖
=
For SLR: 𝑠𝑢2 = 𝜎ො 2 =
𝑛−2
𝑛−2
With
▪ df the ‘degrees of freedom’ i.e., the (number of observations) – (number
of estimated parameters), or: df = n – (k + 1)
n = number of observations, k= number of model parameters.
For simple linear regression (SLR), k = 1
Properties of the OLS Estimates
Goodness of Fit : R2
We would like some measure of how well our regression
model actually fits the data.
We have goodness of fit statistics to test this: i.e. how
well the sample regression function fits the data.
The most common goodness of fit statistic is known as
R2. One way to define R2 is to say that it is the square of
the correlation coefficient between Y and Yˆ. The R2 is also
called the coefficient of determination
Properties of the OLS Estimates
Goodness of Fit : R2
We can divide SST=SSE+SSR by SST to get:
1 = SSE/SST + SSR/SST
The R2, also called the coefficient of determination is
defined as:
R2 = SSE/SST = 1-SSR/SST
The quantity R2 thus defined is known as the (sample)
coefficient of determination and is the most commonly
used measure of the goodness of fit of a regression line.
Verbally, R2 measures the proportion or percentage of
the total variation in Y explained by the regression
model
Properties of the OLS Estimates
Goodness of Fit : R2
Properties of R2
1. It is a nonnegative quantity, if the regression has intercept.
2. Its limits are 0 R2 1.
◼
An R2 of 1 means a perfect fit, that is,
Yi = Yˆi for each i.
◼
An R2 of 0 means that there is no relationship between
the regressand (Y) and the regressor (X).
Properties of the OLS Estimates
Properties of R2
1. It is a nonnegative quantity, if the regression has
intercept.
2. Its limits are 0 R2 1.
◼ An R2 of 1 means a perfect fit
◼ An R2 of 0 means that there is no relationship
between the regressand (Y) and the regressor (X).
y
t
yt
No
relationship
R2=0
y
xt
Perfect fit
R2=1
xt
Properties of the OLS Estimates
Example: Estimation of the consumption function
In column 2
is calculated; in columns 3, 4 and 5, you can
see the fulfillment of algebraic properties of OLS. The
remainder of the columns shows the calculations to obtain
2
𝑆𝑆𝐸 = σ 𝑌𝑖 − 𝑌ሜ = 41.67
𝑆𝑆𝑇 = σ 𝑌𝑖 − 𝑌ሜ 2 = 42
(yi)
𝑆𝑆𝐸
41.67
R2 = 𝑆𝑆𝑇 = 42 = 0.992
(xi)
𝑐𝑜𝑛𝑠 = 𝑦ത =
54
=9
6
SST
SSE
Properties of the OLS Estimates
ഥ 2)
Adjusted R2 (𝑹
To compare two R2 terms, one must take into account the
number of X variables present in the model. This can be
done readily if we consider an alternative coefficient of
determination (the adjusted), which is as follows:
𝑅ሜ 2 = 1 −
𝑆𝑆𝑅/(𝑛 − 𝑘)
(𝑛 − 1)
=1−
(1 − 𝑅2 )
𝑆𝑆𝑇/(𝑛 − 1)
(𝑛 − 𝑘)
where k = the number of parameters in the model including
the intercept term.
This penalizes models where the reduction in the sum of
squared residuals is not enough to compensate for the loss
of degrees of freedom.
Econometrics I:
Lesson 2
Properties of the OLS Estimates
ഥ 2)
Adjusted R2 (𝑹
Also, the last expression can be rewritten as:
ෝ2
𝑆2
σ
2
𝑅ሜ = 1 − 2 , or 1 − 2
𝑆𝑌
𝑆𝑌
Where
the numerator, S2 or ෝ
σ2 is the unbiased estimator of the
variance of the residuals of the model and
2
the denominator 𝑆𝑌 is the estimator of the sample variance
of Y.
Econometrics I:
Lesson 2
Properties of the OLS Estimates
standard error of the regression (ෝ
𝝈)
The positive square root of the variance ෝ
σ2 (=E(u2)), denoted ෝ
σ,
is called the standard error of the regression (SER).
The SER ෝ
σ is an estimator of the standard deviation of the
error term. It is usually reported in standard regression
packages, buy may be named differently (SER, standard error
of the estimate or root mean squared error / RMS)
Being the variance:
The standard error is:
σ
ෝ = [SSR / (n – k – 1)]1/2
degrees of freedom (df )
= (number of observations) - (number of estimated parameters).
Under the Gauss-Markov assumptions MLR.1 through MLR.5, E(𝜎ො 2 ) = σ2
-> The SER is an estimator of the standard deviation of the error term
Properties of the OLS Estimates
standard error of the estimator (𝒔𝒆(𝜷𝒋))
For constructing confidence intervals and conducting tests, we will
need to estimate the standard deviation of 𝛽መ𝑗 , or sd(𝛽መ𝑗 ), which is just
the square root of the variance Var(𝛽መ𝑗 ) or Sj2.
Under assumption SLR.1 to SLR.5,
with
and j = 1 for SLR (j=n for n independent variables)
SSTj is the total sample variation in xj, and Rj2 is the R-squared from
regressing xj on all other independent variables (including an intercept).
Since σ is unknown (it is a population feature), we replace it with its
estimator (the SER (ෝ
σ) from the previous slide), and obtain:
The standard error of the estimator
Since 𝑠𝑒(𝛽𝑗) is the sq.root of Var(𝛽መ𝑗 ) (or Sj2), it is also written as Sj
Properties of the OLS Estimates
Under the Gauss-Markov assumptions, the OLS
estimator is the best, linear, unbiased estimator of the
true parameters (β’s) conditional on the sample values of
the explanatory variables.
In other words, the OLS estimators are BLUE
a) They have minimum variance in the entire class of
unbiased estimators. The Gauss-Markov theorem
proves that the OLS estimator is best.
b) b is linear
c) b is unbiased. E(b) = , On average, the actual value
of the b will be equal to the true values
Properties of the OLS Estimates
Efficiency
An efficient estimator is characterized by having the smallest possible
variance, indicating that there is a small deviance between the
estimated value and the "true" value.
Under the Gauss-Markov assumptions, OLS have minimum variance
in the entire class of unbiased estimators
probability density
functions
OLS
Other unbiased
estimator
1
Properties of the OLS Estimates
Unbiasedness
The bias of an estimator is the difference between this
estimator's expected value and the true value of the
parameter being estimated
probability density
functions
Here, the estimator 𝛽෨1 has a lower
variance than 𝛽መ 1, but is biased
𝛽෨1
𝛽መ 1
1
Properties of the OLS Estimates
Consistency
An estimator that tends towards the true value as the
sample size increases is asymptotically unbiased.
1 [n]) = β1 , where ( 𝛽1 [n]) indicates a sample size of n
lim ( 𝛽
𝑛→∞
If also the variance tends to zero as 𝑛→∞ ,
then the estimator is consistent, and we write:
1 ) = β1
plim( 𝛽
➢
➢
A consistent estimator is an estimator for β1 having
the property that as the number of used data points
increases indefinitely, the resulting sequence of
estimates converges in probability to β1
Consistency is an asymptotic (large sample) property
Inference
Inference
Inference
The OLS estimation method allows obtaining point
estimates of the model parameters. Inference allows us to
complete this point estimate by means of interval
estimation and hypothesis testing.
In statistics the reliability of a point estimator is measured
by its standard error. Therefore, we may construct an
interval around the point estimator, say within two or three
standard errors on either side of the point estimator, such
that this interval has, say, 95 percent probability of
including the true parameter value.
To obtain these intervals and carry out tests we first need
another assumption
Inference
Assumption SLR.6 - Normality
Even under the Gauss-Markov assumptions, the distribution of 𝛽መ 𝑗
can have virtually any shape.
In order to perform statistical inference, we need to know the full
sampling distribution of the 𝛽መ 𝑗.
The sampling distributions of the OLS estimators depend on the
underlying distribution of the errors. To make the sampling
distributions of the 𝛽መ 𝑗 tractable, we assume that the unobserved
error is normally distributed in the population. We call this the
Normality assumption:
The population error u is independent of the explanatory
variables x1, x2, …, xk and is normally distributed with zero mean
and variance
For cross-sectional regression applications, assumptions SLR/MLR.1
through SLR/MLR.6 are called the classical linear model (CLM)
assumptions.
Inference
The t distribution
The βj are unknown features of the population, and we will
never know them with certainty.
Nevertheless, we can hypothesize about the value of βj and
then use statistical inference to test our hypothesis.
In order to construct hypotheses tests, we need the following
result:
Under the CLM assumptions MLR.1 through MLR.6,
t distribution with n – (k+1) degrees of freedom
where
k + 1 is the number of unknown parameters in the population model
y = β0 + β1x1 + β2x2 +…+ βkxk + u
(k slope parameters and the intercept b0),
n is the sample size (number of observations) and
n–(k+1) is the degrees of freedom (df ).
Inference
Interval around the point estimator
(The confidence-interval approach)
Assume that we want to find out how “close” is, say, β to β.
For this purpose, we construct a confidence interval.
CI𝛼 : β − 𝑠𝑒 β
t n−(k+1) ; β + 𝑠𝑒 β (t n−(k+1) )
❑
is the estimated standard error for coefficient β
se(β)
❑
𝛼 (0 < 𝛼 < 1) is known as the level of significance
❑
(1 − 𝛼)*100% is known as the confidence level;
❑
The endpoints of the confidence interval are known as the
confidence limits (also known as critical values)
If 𝛼 = 0.05, or 5 percent, then: The probability that the (random)
interval shown there includes the true β is 0.95, or 95 percent. The
interval estimator thus gives a range of values within which the true
β may lie.
Inference
Interval around the point estimator
(The confidence-interval approach)
It is very important to know the following aspects of interval
estimation:
1) The confidence interval does not say that the probability
of β lying between the given limits is 1 − 𝛼. What it states
is that the probability of constructing an interval that
contains β is 1 − 𝛼.
2) The interval is a random interval; that is, it will vary from
one sample to the next because it is based on β, which is
random.
3) Interval means: If in repeated sampling confidence
intervals like it are constructed many times repeatedly on
the 1 − 𝛼 probability basis, then, on the long run and on
average, such intervals will enclose in 1 − 𝛼 of the cases
the true value of the parameter.
Inference
The t Test
The property
is important in that it allows us
to test hypotheses involving the βj. In most applications, our primary
interest lies in testing the null hypothesis:
H0: βj = 0
Hypothesis on β, not β!
The statistic we use to test the null hypothesis (against any
alternative) is called t statistic or t ratio of β 𝑗 and is defined as:
The t statistic for β j is simple to compute given β j and its standard error. Most
regression packages directly report the t statistic along with each coefficient
and its standard error
Inference
The t Test
Suppose we postulate that:
H0 : β = β ∗
H1 : β ≠ β∗
∗
Most typically, H0:β =0
the test-of-significance
− β∗
β
𝑡𝑒𝑥𝑝 =
𝑠𝑒(β)
the critical values
𝑡𝑡𝑐𝑜 = 𝑡𝑛−(𝑘+1) (𝛼/2)
the decisión rule
reject H0 if |texp|>ttco
▪
A statistic is said to be statistically significant if the value of the test
statistic lies in the critical region.
▪
a test is said to be statistically insignificant if the value of the test
statistic lies in the acceptance region
Inference
The t Test
We can summarize the t test of significance approach to
hypothesis testing as shown:
Inference
The t Test
For one- and two- sided test
H0 : β > β ∗
H1 : β ≤ β∗
H0 : β = β ∗
H1 : β ≠ β∗
Region of acceptance
Critical region
𝟏−𝜶
𝜶
One- and two-tailed test for t(>120 df)
𝜶/𝟐
𝟏−𝜶
𝜶/𝟐
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )