CH 02 Simple Regression TQT
CH 02 Simple Regression TQT
Regression
variable, on one or more other variables, the explanatory variables, with a view to estimating and/or
predicting the (population) mean or average value of the former in terms of the known or fixed (in
repeated sampling) values of the latter” [2, p.18].
(Cont)
The slope parameter ( ) shows how much changes if increases by one-unit. But this
interpretation is only correct if all other factors are constant ( ).
Dependent variable,
outcome variable, Independent Error term
explained variable, variable, unobservables,
response variable, explanatory disturbance,
predicted variable, variable, white noise,..
regressand… control variable,
pridictor
regressor,…
Simple linear regression: graphical presentation of the
coefficients
(Cont)
The goal of the linear regression is to estimate the population mean of the
dependent variable on the basis of the known values of the independent
variable(s).
To estimate which is known as the conditional expectation function
or the population linear regression function.
The conditional mean: E)
(Cont)
Wage, tho
20000
15000
10000
The conditional mean: E)
5000
0
(Cont)
E(wages|edu)
Take the expected value of the PRM () on x using the zero conditional mean
assumption, we have the population regression function (PRF):
E) =+
E) =
𝑢𝑖=Theobservedvalue−Mean
+ : ability
To capture the ceteris paribus relationship between wage and education, we
have to assume that the average ability is the same for all levels of education.
E.g. E)=… E)… =E)=… E)=… E)=0.
?
Zero conditional mean assumption: E
(Cont)
+
: land quality
?
The sample linear regression function:
SRF
Household in
4000
3000
2000
1000
0
(Cont)
𝑇h𝑒𝑎𝑐𝑡𝑢𝑎𝑙𝑣𝑎𝑙𝑢𝑒𝑠
: sample linear regression function
0 5 10 15
Schooling years of household head
The average income for all household heads with 12 years of education is E(Income|
edu=12)=815+53*12=1451
Note: But it is false to interpret that evevery household head with 12 years of education will
earn 1451
The sample linear regression function (SRF)
(Cont)
is called as “Y-hat” or “Y-cap”,
is the estimator of , which also means the fitted or predicted value of
is the estimator of
is the estimator of
is the estimator of (u), which is also known as the residual = -
The is used to index the observations of a sample.
Population Sample
Model
Population linear regression model
Sample linear regression model
(PRM)
(SRM)
Function E) =
Population linear regression function Sample linear regression function
(PRF) (SRF)
What is OLS (Ordinary Least Squares)?
Answer:
(Cont)
Deriving the OLS estimators
(Cont)
==
These sample functions are the OLS estimators for
For a given sample, the numerical values of are
called the OLS estimates for
We have derived the formula for calculating the OLS estimates
of our parameters, but you don’t have to compute them by
hand.
Regressions in Stata are very easy and simple, to run the regression of
y on x, just type: reg y x
Estimators vs estimate
An estimator, also referred to as a "sample"
statistic, is a rule, formula, or procedure that
explains how to estimate the population parameter
from the sample data.
An estimate is a specific numerical value generated
by the estimator in an application.
Estimator: ,
Estimate:
Household
4000
3000
2000
1000
How do we fit the regression line to the data?
0
Answer:
(Cont)
𝒚𝒊
>1328
= -
^𝑖
𝒖
𝑦𝑖
^
𝒚𝒊
^
𝒚 𝒊 = 𝑓𝑖𝑡𝑡𝑒𝑑 𝑣𝑎𝑙𝑢𝑒
𝒚𝒊 E(income/edu=10)=815+53*10=1328
<1328
0 5 10 15
Schooling years of household head
: the slope=
: the constant or
intercept, which which indicates the average amount by
shows the average which changes when increases by one
value of the dependent unit, holding other factors in the model
variable when the constant ( =0).
independent variable is
set to zero. >0: a possitie association between and
<0: a negative association between and
=0: no association between and
Meat consumption and income in Lao Cai
(Cont) Monthly meat consumption
per household (1000 VND)
Monthly household income
per capita (1000 VND)
Fitted regression:
Fitted regression:
The intercept = - 856 when setting the independent variable (education) to zero
( zero years of education).
But the data shows that education has the smallest value of 6 (6 years of
education).
But the data shows that education has the smallest value of 6 (6 years of
education).
Therefore, we can’t interpret the intercept because it is outside the range of the
study data.
In
The intercept absorbs the bias for the regression model.
(Cont)
3000
2000
1000
where the new error has a zero mean:
0
(Cont)
^𝑖 ) < 0
𝐸 (𝑢
^𝑖 ) =0
𝐸 (𝑢
𝜷𝒂
^𝛽
0
𝜷𝒃 ^𝑖 ) > 0
𝐸 (𝑢
E(income/edu=10)=815+53*10=1328
0 5 10 15
Schooling years of household head
(Cont)
Thealgebraic
Some Simple properties of OLS
(Cont)
Regression Model
From the first order conditions of OLS, we have some algebraic properties of OLS:
The sum and mean of the residuals will aways equal zero
Sum =0.00000000
Cov(, ) =0.0000
Cov(, ) =0.00000
Decomposition of total
variation
ESS
RSS
TSS (Y-)
1015.818182 995 785.4230167 433.3966942 53081.93213 209.576983 43922.51
1015.818182 2900 1530.785464 3550141.124 265191.3019 1369.214536 1874748
1015.818182 1450 873.1548101 188513.8512 20352.83762 576.845190 332750.4
1015.818182 1460 1017.847866 197297.4876 4.119617482 442.152134 195498.5
1015.818182 510 1036.023947 255852.0331 408.2729503 -526.023947 276701.2
1015.818182 760 1093.271447 65442.94215 5999.008273 -333.271447 111069.9
1015.818182 1005 1198.17749 117.0330579 33254.91739 -193.177490 37317.54
1015.818182 100 741.9149168 838722.9421 75022.99858 -641.914917 412054.8
1015.818182 912 711.7168607 10778.21488 92477.61353 200.283139 40113.34
1015.818182 570 1624.098889 198753.8512 370005.4186 -1054.098889 1111124
R-Squared=ESS/TSS 0.201825363
Goodness-of-fit measure (R-squared)
Total sum of squares Explained sum of Residual sum of
squares squares
,
where =
TSS represents total variation in ESS represents variation RSS represents variation
the dependent variable(s) not
explained by regression
explained by regression
N=265; =0.172
The regression explains 17.2 %
of the total variation in monthly wage
N=11; =0.201
The regression explains 20.2 %
of the total variation in meat
consumption
Each additional year of education has the same effect on wages. Is this
reasonable?
In fact, the effect may be greater at higher levels of education.
80000
60000
40000
20000
0
and =0
0 5 10 15
average schooling years of working members
Important notes:
Exact = exp(*1)-1= .04456445 =4.45%
=0.16: shows that educ explains about 16% of the variation in log(wage) (not
wage)
Functional form
(Cont)
2.6. Standard assumptions for the simple linear regression model
variable)
This implies that a one-unit change in X has the same effect on Y regardless of X’s innial
values.
is a linear function of and the regression line is a straight line.
1,000,000 1,000,000
VND/month VND/month
Assumption SLR.2 (Random sampling)
(Cont)
(Cont)
(Cont)
Assumption SLR.4 (Zero conditional mean):
(Cont)
We have already discussed about this crucial assumption
In other words: the value of the independent variable (X) must contain
no information about the mean of the unobservables (u).
Note: There is no linear or non-linear relationship between and .
implies that the explanatory variable is exogenous:
There is no linear association between and .
Questions:
0 implies that ?
0 does not implies that
Assumption SLR.4 (Zero conditional mean):
(Cont)
Causality vs correlation
if is endogenous
)
Assumption SLR.5 (Homoskedasticity): V
(Cont)
(Cont)
Stata command:
Stata command: gen Log_Wage=ln(wage)
Reg wage edu Reg Log_Wage edu
hettest hettest
Gauss-Markov assumptions of the Simple
Linear Regression (SLR)
Under SLR.1-SLR.4, is unbiased: E()=
Under SLR.5, has the smallest variance among other linear unbiased estimator.
Under SLR.1-SLR.5, for is the best linear unbiased estimator (BLUE)
What happens if the assumptions SLR.1–SLR.4 are satisfied but the assumption SLR.5 is not?
2.7. Mean and variances of the OLS estimator
Interpretation of unbiasedness
Under SLR.1-SLR.4, is unbiased: E()=
Unbiasedness does not imply that, with a given sample, our estimated
parameters would equal the exact true values of the population parameters.
In a given sample, estimates may larger (> ; > ) or smaller (<; <) than the true
values.
Instead, the unbiasedness should be interpreted that:
is an estimate of
; , where = the residual. unobservables.
Recall that the residual ( can be seen as an estimate of the error term ()
Now we have to obtain an unbiased estimate of variance of the error
term.
N=11
measures the average distance between the observed values and the regression line (the fitted values).
Estimating the variance of the error term:
(Cont)
Note:
The standard error of the regression () has the same unit as
the dependent variable.
also has other names: the standard error of the estimate and the
root mean squared error (Root MSE).
Variances and standard errors for regression
coefficients
;
;;
(Cont)
Note:
Standard errors are the estimated standard deviations of the regression coefficients.
E()=
True
Properties of the mean and variances
Exercise:
1. Is the residual the error term? Explain
2. Why do the sum and mean of the residual always equal zero?
3. What happens to the sum and mean of the residual if we exclude
the intercept from the OLS model?
4. What happens to the OLS estimator if the sample is not randomly
selected from a population?
5. What happens to a simple linear regression model if the value of
the explanatory variable is similar for all observations?
6. Suppose our model satisfies SLR assumptions 1–4 but suffers from
heterokedasticity. In this case, are our estimates biased?. What is
the consequence of the heterokedasticity?
7. Comment on the statement that a model with a high R-squared
shows a strongly causal relationship.
8. Which model violates the assumption of the OLS?
+ ; (1)
+ ; (2)
+ (3)
Excercise
9. Let Qd denote the quantity of a given product, and let P denote the price of that product.
A simple model is presented that connects quantity demanded to price:
(i) What possible factors are contained in ? Is it likely that these will be related to price
(ii) Will a simple regression analysis show the ceteris paribus effect of price on quantity demanded? Explain.
10. The following table contains monthly meat consumption per household (thousand VND) and monthly
household income per capita (thousand VND)incom
for 20 households. incom
list meat e list meat e
1 1390 5031 11 1770 4365
2 1320 6491 12 1620 4727
3 2900 4900 13 1460 5067
4 790 3267 14 650 5094
5 1600 5164 15 995 3000
6 2400 3260 16 2900 8208
7 1310 4847 17 1450 3613
8 1690 8395 18 1460 4624
9 1880 6625 19 510 4751
10 1205 2394 20 760 5151
(i) estimate the relationship between the dependent variable (meat consumption) and the independent variable
(household income per capita) using an OLS regression model. Comment on the link between two variables. What is
the meaning of the intercept and slope coefficients?
(ii) How much higher is the level of meat consumption predicted to be if the monthly income per capita is increased
by 200 thousand VND?
(iii) Is this true if we say that given a one million VND increase in household income per capita, the value of meat
consumption increases at the same level for all households?
(iv) calculate the fitted values of the dependent variable and the residuals. Do the sum and mean of the residuals
equal zero? What is the average of the fitted values and the observed values of the dependent variables?
(v) Please interpret the R-squared. How much of the variation in meat consumption is unexplained by the regression?
(vi) calculate the standard error of the regression coefficients and the standard error of the regression. What is the
unit of analysis for the standard error of the regression?
11. Using a simple linear regression model, a researcher investigates the dependence of the monthly wage (in
thousand VND) on the number of years of education among wage workers in Hanoi in 2018.
(i) What is the average predicted wage when education equals zero?
(ii) How much does the monthly wage increase if the number of years of education increases from 12 to 16 years?
(iii) Does this model infer a causal relationship between wage and education?
(iv) What percentage of the variance in wages is explained by education?
12. A sample of 11 households with their income and food consumption is given in the table.
Income
Thousand VND/per Food consumption
person/month Thousan VND/per person/month
3000 995
8208 2900
3613 1450
4624 1460
4751 510
5151 760
5884 1005
2696 100
2485 912
8860 570
1436 512
Using the OLS estimator, estimate the relationship between the dependent variable (food consumption) and the
explanatory variable ( income):
+
(i) Using the regression result, please report the marginal propensity to consume food (MPCF) .
(iii) What is the MPCF if the regression model excludes the intercept? + . (Note, please use “constant is zero” in
excel”) or noconstant in Stata
(iv) Using the result from the model without intercept, calculate the fitted values of the dependent variable and the
residuals. Do the sum and mean of the residuals equal zero? What is the average of the fitted values and the
observed values of the dependent variables?
(v) Does the exlussion of the intercept from the model cause the bias? Explain.