Text On Class
Text On Class
com/spreadsheets/d/1ogNBd-K7xxNlhGfZjp5vs8RXSHIBIlqspb31yjRms1c/
edit?usp=sharing
Regression
Explaination relationship (includes causality)
Micro Macro
Factor Variable Data Sign Factor / var
Income Ok Ok + GDP
Price ??? No CPI
Taste No No
Demand No No
Education of ok Ok !!! ?
Size OK Ok + Population
Gender of Ok ?
householder
Age of Ok +/-
Weight
Height
Location Ok Urban/rural
Weather
Occupation / Interest rate
carear
Literature review
Topic
Research question
Review: background theory; economic theory (journal)
Model
Data
Estimate
Test / check
Analyze
Forecast
Turn back to the question:
Conclusion: Summary what you have done
^
w age i=2.23+1.654 ex pi
wag e i=2.23+1.654 ex pi + ei
2.23: estimated intercept: When experience is zero, average wage is
estimated by 2.23 (units)
1.654: estimated slope: When experience increases 1 unit (1 year),
average wage increases by 1.654, cet.par
*NOTE: in this sample of 5 observations only*
A
Value 5 6 8 9
Overall mean 7
Deviation -2 -1 +1 +2
Group Under Grad
Mean of group 5.5 8.5
Group - deviation -1.5 -1.5 1.5 1.5
Within - deviation -0.5 +0.5 -0.5 +0.5
F-test:
BSS/(k−1)
F stat =
WSS /(n−k )
IF F stat > f crit =f ( k−1 ,n−k ) α: Reject H0
P-value of the test: P(F (k−1 , n−k ) > F stat )
Example
n=4 ;Factor: training => k =2 groups
BSS = 9, RSS = 1; TSS = 10
Source SS Df MS F-stat
Training 9 1 9/1 = 9 = 9 / 0.5 = 18
Error 1 2 ½ = 0.5
Total 10 3
Test
H 0 : μGrad =μUnder
F stat =18 ; F crit =f ( 1 ,2) 0.05=¿
F stat <18.512 : Not reject Ho => Not enough evidence to say that: Factor
Source SS Df MS F-stat
Training 1 1 1/1 = 1 = 1 / 4.5 = 0.22
Error 9 2 9/2 = 4.5
Total 10 3
H 0 : μ1=μ2=μ 3=μ4
F stat =12; F crit =f (3 ,21) 0.05=qf ( 0.95 , 3 , 21 )=3.07
Reject Ho => Means are not equal
P-value = 1- pf(12, 3, 21) = 0.000
experience.
23 Jan 2024
Example 2.2
Model
wage=β 0 + β 1 exp+ ε
(a) Test:
H 0 : β 1=0 ; H 1 : β 1 ≠ 0
^β =0 1.6538−0
1
T stat = = =8.6
se ( ^β )
1
0.1923
Critical value: t (n−2) α /2, at 5%: t (3 )0.025= [ R ] qt ( 0.975 , 3 ) =3.18
|T stat|>3.18: reject H0: slope is significant at 5%
P-value ¿ 2 P ( T ( 3 ) >8.6 )=[ R ] 2[1−pt ( 8.6 , 3 ) ]=0.0033
(b) Intercept
H 0 : β 0=0 ; H 1 : β0 ≠ 0
^β =0 2.231−0
0
T stat = = =4.449
se ( ^β 0) 0.5015
Critical value: t (n−2) α /2, at 5%: t (3 )0.025= [ R ] qt ( 0.975 , 3 ) =3.18
|T stat|>3.18 reject H0: intercept is significant at 5%
P-value ¿ 2 P ( T ( 3 ) >4.449 )=[ R ] 2[1− pt ( 4.449 , 3 ) ]=0.021
Test the hypothesis that when exp increases 1 year, on average, wage increases
less than 2 thousands, and find p-value.
H 0 : β 1=2
H 1 : β1 <2
1.6538−2
T stat = =−1.8
0.1923
Critical value: −t (3 )0.05 =[ R ] =¿−2.35
T stat >−2.35: Not reject H0: hypothesis is not correct.
P-value = P ( T ( 3 ) ←1.8 ) =[ R ] pt (−1.8 , 3 ) =0.085
(d) exp=6=¿ ^
wage=2.231+1.6538∗6=12.1538
√
2
1 ( 6−2.4 )
se ( pred ) =0.4385 1+ + =0.843
n 5.2
CI 95% of predicted value of wage
12.1538 ± 3.18∗0.843=(9.478 ; 14.83)
Call:
lm(formula = wage ~ gen)
Residuals:
1 2 3 4 5
-2.3333 -0.3333 -1.0000 1.0000 2.6667
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.0000 1.5635 3.838 0.0312 *
gen 0.3333 2.0184 0.165 0.8793
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.2308 0.5015 4.448 0.02113 *
year 1.6538 0.1923 8.600 0.00331 **
Call:
lm(formula = wage ~ 0 + year)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
year 2.4412 0.1795 13.6 0.000169 ***
Residual standard error: 1.047 on 4 degrees of freedom
Multiple R-squared: 0.9788, Adjusted R-squared: 0.973
27 February 2024
R : proportion of total variation in dependent variable is explained by model (by
2
n−1
Adj−R =1−( 1−R )
2 2
n−k −1
n=10
2 10−1
(1) Y <- x, z => R2=0.6 → Adj R =1−( 1−0.6 ) =0.486
n−( 2+1 )
2 10−1
(2) Y <- x, z, w => R =0.65 → Adj R =1−( 1−0.6 ) =0.475
2
n−( 3+1 )
(3) Y <- x, w => R2=0.62
y=β 0 + β 1 x + β 2 z y=β 0 x z
β1 β2
∂y β1 β0 β1 x
β1−1
z
β2
∂x
Constant at any point (at x=x 0 , z =z 0 ¿
y ∂y x x β1−1 β2 x
εx= × β1 β0 β1 x z = β1
∂x y β 0+ β1 x+ β2 z β β
β0 x z 1 2
β1 β2
y=β 0 x z u
ln y =ln β 0+ β1 ln x+ β2 ln z +ln u
¿
ln y =β0 + β 1 ln x+ β2 ln z+ ε
Log-log model (log-linear model) !!!!
β 1=elasticity
dy dx dz
=β 1 + β 2
y x z
Significant level: 5%
Question Answer
1. Mean of wage
7. Coefficient of determination =?
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
S S S S ¿
ric e =β 1 siz e + β 2 incom e + β3 nric e + ε
Call:
lm(formula = rices ~ 0 + sizes + incomes + nrices)
Residuals:
Min 1Q Median 3Q Max
-2.6381 -0.4252 -0.0988 0.3343 7.5584
Coefficients:
Estimate Std. Error t value Pr(>|t|)
sizes 0.636886 0.042547 14.969 <2e-16 ***
incomes -0.007037 0.056232 -0.125 0.900
nrices 0.004236 0.059573 0.071 0.943
Firm A Firm B
2022 K = 400; Y = 1000 K = 400; Y = 2000
2023 K = 404; Y = 1010 K = 404; Y = 2010
Absolute effect Δ K =4 ; Δ Y =10 Δ K =4 ; Δ Y =10
ΔY ΔY
=2.5 =2.5
ΔK ΔK
When Capital increases 1
unit => Output increases
2.5 units
ICOR: Increment Capital
Output Ratio = 4/10 = 0.4
Relative effect ΔK ΔK
% Δ K= ( 100 % ) =0.01=1 % % Δ K= ( 100 % ) =0.01=1 %
K K
ΔY ΔY
% ΔY = ( 100 % )=0.01=1 % % ΔY = ( 100 % )=0.005=0.5 %
Y Y
Y % ΔY 1% Y % Δ Y 0.5 %
εK= = =1 εK= = =0.5
% Δ K 1% % ΔK 1%
Y =f ( K ) :continuous
' dY '
Absolute effect: Derivative: Y = → dY =f ( K ) dK
dK
Relative effect
Y %dY dY /Y dY K ' K
εK= = = × =f ( K )
%dY dK / K dK Y Y