SlideShare a Scribd company logo
1 of 54
ERF Training Workshop
Panel Data 2
Raimundo Soto
Instituto de Economía, PUC-Chile
STATIC MODELS OF CONTINUOUS
VARIABLES
2
MODEL STRUCTURE
• Canonical Model
𝑦𝑖𝑡 = 𝛼𝑖𝑡 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
where
• 𝑦𝑖𝑡 is the phenomenon of interest to be modelled,
• 𝑥𝑖𝑡 represents all observed controls (regressors)
• 𝛼𝑖𝑡 are the individual effects
• 𝜀𝑖𝑡 is the non-systematic part (what we choose not
to model)
3
DATA STRUCTURE
• Let us stack the data in the it structure
•
𝑦11
𝑦12
⋮
𝑦1𝑇
𝑦21
𝑦22
⋮
𝑦2𝑇
⋮
⋮
𝑦 𝑁1
⋮
𝑦 𝑁𝑇
4
DATA STRUCTURE EXAMPLE
5
DATA STRUCTURE
• Let us stack the data in the it structure
•
𝑦11
𝑦12
⋮
𝑦1𝑇
𝑦21
𝑦22
⋮
𝑦2𝑇
⋮
⋮
𝑦 𝑁1
⋮
𝑦 𝑁𝑇
=
𝛼11
𝛼12
⋮
𝛼1𝑇
𝛼21
𝛼22
⋮
𝛼2𝑇
⋮
⋮
𝛼 𝑁1
⋮
𝛼 𝑁𝑇
+
𝑤11
𝑤12
⋮
𝑤1𝑇
𝑤21
𝑤22
⋮
𝑤2𝑇
⋮
⋮
𝑤 𝑁1
⋮
𝑤 𝑁𝑇
𝑣11
𝑣12
⋮
𝑣1𝑇
𝑣21
𝑣22
⋮
𝑣2𝑇
⋮
⋮
𝑣 𝑁1
⋮
𝑣 𝑁𝑇
…
𝑧11
𝑧12
⋮
𝑧1𝑇
𝑧21
𝑧22
⋮
𝑧2𝑇
⋮
⋮
𝑧 𝑁1
⋮
𝑧 𝑁𝑇
𝛽 +
𝜀11
𝜀12
⋮
𝜀1𝑇
𝜀21
𝜀22
⋮
𝜀2𝑇
⋮
⋮
𝜀 𝑁1
⋮
𝜀 𝑁𝑇
6
DATA STRUCTURE
• Let us stack the data in the it structure
•
𝑦11
𝑦12
⋮
𝑦1𝑇
𝑦21
𝑦22
⋮
𝑦2𝑇
⋮
⋮
𝑦 𝑁1
⋮
𝑦 𝑁𝑇
=
𝛼11
𝛼12
⋮
𝛼1𝑇
𝛼21
𝛼22
⋮
𝛼2𝑇
⋮
⋮
𝛼 𝑁1
⋮
𝛼 𝑁𝑇
+
𝑤11
𝑤12
⋮
𝑤1𝑇
𝑤21
𝑤22
⋮
𝑤2𝑇
⋮
⋮
𝑤 𝑁1
⋮
𝑤 𝑁𝑇
𝑣11
𝑣12
⋮
𝑣1𝑇
𝑣21
𝑣22
⋮
𝑣2𝑇
⋮
⋮
𝑣 𝑁1
⋮
𝑣 𝑁𝑇
…
𝑧11
𝑧12
⋮
𝑧1𝑇
𝑧21
𝑧22
⋮
𝑧2𝑇
⋮
⋮
𝑧 𝑁1
⋮
𝑧 𝑁𝑇
𝛽 +
𝜀11
𝜀12
⋮
𝜀1𝑇
𝜀21
𝜀22
⋮
𝜀2𝑇
⋮
⋮
𝜀 𝑁1
⋮
𝜀 𝑁𝑇
= 𝛼 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
7
ESTIMATION IS IMPOSSIBLE
• If we allow for 𝛼 𝑁𝑇 there will be 𝑁𝑇 constants
(and, at most, NT observations), not enough
degrees of freedom to estimate the parameters.
• We will restrict ourselves to:
– 𝛼𝑖 , i.e., N constants (that do not change in time)
– 𝜆 𝑡 , i.e., T constants (that do not change by individual)
8
POOLED ESTIMATOR
• Let us ignore all heterogeneity
𝑦𝑖𝑡 = 𝛼 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
• The OLS estimator is: 𝛽 = 𝑥𝑖𝑡
′ 𝑥𝑖𝑡
−1 𝑥𝑖𝑡
′ 𝑦𝑖𝑡
• The variance estimator is
𝑉𝑎𝑟 𝛽 = 𝜎𝜀
2
𝑥𝑖𝑡
′
𝑥𝑖𝑡
−1
=
𝜎𝜀
2
𝑉(𝑥𝑖𝑡)
• Note the increase in precision (𝑁𝑥𝑇)
9
FIXED EFFECTS ESTIMATOR
• Consider that the heterogeneity is only among
individuals
𝑦𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
• 𝛼𝑖 represents individual characteristics that are
fixed
• We could use binary (dummy) variables to
represent fixed characteristics
10
FIXED EFFECTS ESTIMATOR
𝑦11
𝑦12
⋮
𝑦1𝑇
𝑦21
𝑦22
⋮
𝑦2𝑇
⋮
⋮
𝑦 𝑁1
⋮
𝑦 𝑁𝑇
=
𝛼1
𝛼1
⋮
𝛼1
0
0
⋮
0
⋮
⋮
0
⋮
0
0
0
⋮
0
𝛼2
𝛼2
⋮
0
⋮
⋮
0
⋮
0
…
0
0
⋮
0
0
0
⋮
0
⋮
⋮
𝛼 𝑁
⋮
𝛼 𝑁
+
𝑤11
𝑤12
⋮
𝑤1𝑇
𝑤21
𝑤22
⋮
𝑤2𝑇
⋮
⋮
𝑤 𝑁1
⋮
𝑤 𝑁𝑇
𝑣11
𝑣12
⋮
𝑣1𝑇
𝑣21
𝑣22
⋮
𝑣2𝑇
⋮
⋮
𝑣 𝑁1
⋮
𝑣 𝑁𝑇
…
𝑧11
𝑧12
⋮
𝑧1𝑇
𝑧21
𝑧22
⋮
𝑧2𝑇
⋮
⋮
𝑧 𝑁1
⋮
𝑧 𝑁𝑇
𝛽 +
𝜀11
𝜀12
⋮
𝜀1𝑇
𝜀21
𝜀22
⋮
𝜀2𝑇
⋮
⋮
𝜀 𝑁1
⋮
𝜀 𝑁𝑇
11
FIXED EFFECTS ESTIMATOR
• 𝑦𝑖𝑡 = 𝛼𝐷 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
• Note: same slope, different intercept (constant)
• All classic results on econometric estimation
techniques hold: nature of the OLS estimator,
optimality, goodness of fit, and asymptotic
distributions of estimators and tests.
• This estimator is called LSDV least squares dummy
variables.
12
FIXED EFFECTS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
13
FIXED EFFECTS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
𝛼2
𝛼1
𝑦2 = 𝛼2 + 𝑥2β
𝑦1 = 𝛼1 + 𝑥1β
14
FIXED EFFECTS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
𝛼2
𝛼1
𝑦2 = 𝛼2 + 𝑥2β
𝑦1 = 𝛼1 + 𝑥1β
𝑦 = 𝛼 + 𝑥β
15
FIXED EFFECTS ESTIMATOR
• Example:
– Vial y Soto (2002) revise the opinion that “university
selection tests (PSU) do not predict student performance
(R) in their faculties, only secondary-school marks are
important”.
– When running the pooled regression:
𝑅𝑖𝑡 = 𝛼 + 𝛽𝑃𝑆𝑈𝑖𝑡 + 𝜇𝑖𝑡
The estimated 𝛽 is small, not significant or displays the
“wrong” sign (negative).
16
PREDICTED EFFECT OF SELECTION TESTS ON
STUDENTS’ PERFORMANCE
Note: * significant at 10% size
PREDICTED EFFECT OF SELECTION TESTS ON
STUDENTS’ PERFORMANCE
Note: * significant at 10% size
POOLED ESTIMATOR
𝑃𝑆𝑈
𝑅
10
1
19
“Low-quality” faculties “High-quality” faculties
FIXED EFFECTS ESTIMATOR
𝑃𝑆𝑈
𝑅
10
1
20
“Low-quality” faculties “High-quality” faculties
POOLED VS FIXED EFFECTS ESTIMATORS
𝑃𝑆𝑈
𝑅
21
“Low-quality” faculties “High-quality” faculties
POOLED VS FIXED EFFECTS ESTIMATORS
𝑃𝑆𝑈
𝑅
22
“Low-quality” faculties “High-quality” faculties
FIXED EFFECTS ESTIMATOR
• LSDV estimator is unfeasible if N is too large
– HIECS has 24,000 households
• Recall that constants in regressions only take away the
means of the variables
• It would be much simpler to eliminate the means of the
variables and avoid specifying 24,000 dummy variables
23
FIXED EFFECTS ESTIMATOR
𝑦𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
• Let us take expected value for each individual “i” in time:
𝐸𝑖 𝑦𝑖𝑡 = 𝐸𝑖 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
𝑦𝑖 = 𝛼𝑖 + 𝑥𝑖 𝛽
• and subtract from the original model to eliminate 𝛼𝑖:
𝑦𝑖𝑡 − 𝑦𝑖 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖 𝛽
𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡
24
FIXED EFFECTS ESTIMATOR
𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡
• This is a very simple estimation, without the problems
derived from dimensionality.
• Obviously, we cannot estimate 𝛼𝑖, but they are easily
recovered as:
𝛼𝑖 = 𝑦𝑖 − 𝑥𝑖 𝛽
25
FIXED EFFECTS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
𝛼2
𝛼1
26
FIXED EFFECTS ESTIMATOR
Group 2
𝑥
𝑦
Group 1
w/o means
27
FIXED EFFECTS ESTIMATOR
Groups 1 & 2
w/o means
𝑥
𝑦
28
FIXED EFFECTS ESTIMATOR
𝑥
𝑦
29
Groups 1 & 2
w/o means
FIXED EFFECTS ESTIMATOR
𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡
• This estimator uses only information within each group
and it is therefore called within-groups estimator
• Let us obtain certain useful “sums” in order to better
understand the nature of estimators.
30
POOLED ESTIMATOR
𝑆
𝑝
𝑥𝑥
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥
𝑆
𝑝
𝑥𝑦
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥 ′ 𝑦𝑖𝑡 − 𝑦
𝛽 𝑝 =
𝑆
𝑝
𝑥𝑦
𝑆
𝑝
𝑥𝑥
31
WITHIN-GROUPS ESTIMATOR
𝑆 𝑤
𝑥𝑥
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖𝑡 − 𝑥𝑖
𝑆 𝑤
𝑥𝑦
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑦𝑖𝑡 − 𝑦𝑖
𝛽 𝑤 =
𝑆 𝑤
𝑥𝑦
𝑆 𝑤
𝑥𝑥
32
WITHIN-GROUPS ESTIMATOR
• From the pooled estimator
𝑆
𝑝
𝑥𝑥
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖 − 𝑥 +
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
𝑆
𝑝
𝑥𝑥
= 𝑆 𝑤
𝑥𝑥
+
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
33
WITHIN-GROUPS ESTIMATOR
• Thus
𝑆
𝑝
𝑥𝑥
= 𝑆 𝑤
𝑥𝑥
+
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
𝑆 𝑤
𝑥𝑥
= 𝑆
𝑝
𝑥𝑥
−
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
• Double sums are either zero or positive (these are squares)
hence
𝑆 𝑤
𝑥𝑥
≤ 𝑆
𝑝
𝑥𝑥
34
WITHIN-GROUPS ESTIMATOR
• The variance of the within-groups estimator is
𝑉𝑎𝑟 𝛽 𝑤 =
𝜎2
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖 − 𝑥 + 𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
𝑉𝑎𝑟 𝛽 𝑤 =
𝜎2
𝑆
𝑝
𝑥𝑥
− 𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
• Therefore, this variance is larger than that of the pooled
estimator
• The within-groups estimator is less precise than the pooled
estimator
35
LET US SEE THIS IN PRACTICE
• Open Stata
• Open file ERF_Continuous Static.do
– Declare Panel Data and Variables
• xtset
– Panel Data Analysis: commands xt
• xtdes
• xtsum
– Panel Data Regression
• xtreg
• Let us check the estimation results
36
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
37
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
Total
Observations
38
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
Total
Groups
39
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
Group
Characteristics
40
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
Different
estimates
41
F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000
rho .95557807 (fraction of variance due to u_i)
sigma_e .32607847
sigma_u 1.5123647
_cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932
l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163
l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204
l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
corr(u_i, Xb) = -0.9200 Prob > F = 0.0000
F(3,5270) = 859.53
overall = 0.0036 max = 55
between = 0.0140 avg = 33.3
R-sq: within = 0.3285 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Fixed-effects (within) regression Number of obs = 5436
_cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742
l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762
l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588
l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .64482
Adj R-squared = 0.0793
Residual 2258.61346 5432 .415797764 R-squared = 0.0798
Model 195.831563 3 65.2771875 Prob > F = 0.0000
F( 3, 5432) = 156.99
Source SS df MS Number of obs = 5436
Different
Fit
42
BETWEEN-GROUPS ESTIMATOR
• Recall that the regression model goes through the
averages (mean) of variables
𝐸𝑖 𝑦𝑖𝑡 = 𝐸𝑖 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
• We can run a regression on the means of each
group
𝑦𝑖 = 𝛼 + 𝑥𝑖 𝛽
43
BETWEEN-GROUPS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
44
BETWEEN-GROUPS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
45
BETWEEN-GROUPS ESTIMATOR
Group 2
Group 1
𝑥
𝑦
46
𝑦𝑖 = 𝛼 + 𝑥𝑖 𝛽
BETWEEN-GROUPS ESTIMATOR
• Let´s look at the estimator using sums
𝑆 𝑏
𝑥𝑥
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥
𝑆 𝑏
𝑥𝑦
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑥𝑖 − 𝑥 ′ 𝑦𝑖 − 𝑦
𝛽 𝑏 =
𝑆 𝑏
𝑥𝑦
𝑆 𝑏
𝑥𝑥
47
BETWEEN-GROUPS ESTIMATOR
• Note that
𝑆
𝑝
𝑥𝑥
= 𝑆 𝑤
𝑥𝑥
+ 𝑆 𝑏
𝑥𝑥
𝑆
𝑝
𝑥𝑦
= 𝑆 𝑤
𝑥𝑦
+ 𝑆 𝑏
𝑥𝑦
• Hence
𝛽 𝑝 = 𝐹 𝑤
𝛽 𝑤 + 𝐼 − 𝐹 𝑤
𝛽 𝑏
𝐹 𝑤
=
𝑆 𝑤
𝑥𝑥
𝑆 𝑤
𝑥𝑥
+ 𝑆 𝑏
𝑥𝑥
48
BETWEEN-GROUPS ESTIMATOR
𝛽 𝑝 = 𝐹 𝑤 𝛽 𝑤 + 𝐼 − 𝐹 𝑤 𝛽 𝑏
• The pooled estimator is a weighted average of the
between and within-group estimators
• Weights depend on the information content of the
data:
– If groups are very similar, information comes from
individuals within groups
– If groups are very different, information comes from
differences between groups
49
RESULTS BETWEEN-GROUPS ESTIMATOR
50
_cons 2.450055 .4769026 5.14 0.000 1.508174 3.391936
l_popt .008753 .029578 0.30 0.768 -.0496633 .0671694
l_infl2 -.4064124 .0650977 -6.24 0.000 -.53498 -.2778448
l_realgdp -.0062972 .0168565 -0.37 0.709 -.0395887 .0269942
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
sd(u_i + avg(e_i.))= .5167678 Prob > F = 0.0000
F(3,159) = 14.81
overall = 0.0787 max = 55
between = 0.2185 avg = 33.3
R-sq: within = 0.0155 Obs per group: min = 4
Group variable: idwbcode Number of groups = 163
Between regression (regression on group means) Number of obs = 5436
. xtreg l_money l_realgdp l_infl2 l_popt, be
ESTIMATING THE VARIANCE OF RESIDUALS
• Compute the sample residuals as:
𝜀𝑖𝑡 = 𝑦𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖𝑡 𝛽
• The residual variance estimator is simply:
𝜎2
=
𝑖=1
𝑁
𝑡=1
𝑇
𝑦𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖𝑡 𝛽
2
𝑁𝑇 − 𝑁 − 𝐾
51
HYPOTHESIS TESTING
• Having the estimated parameters and the residual
variance estimator hypotheses testing is
straightforward
– Individual parameter tests distribute t in small samples
and Normal in large samples
– Multiple parameter tests distribute 𝜒2 or 𝐹(𝑚, 𝑛)
52
TWO-WAY FIXED EFFECTS ESTIMATOR
• Model with fixed individual effects and fixed time
effects
𝑦𝑖𝑡 = 𝛼𝑖 + 𝜆 𝑡 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡
where
• 𝜆 𝑡 is a time effect affecting equally all individuals
• 𝛼𝑖 is, again, an individual effect for all times
53
RESULTS OF THE TWO-WAY ESTIMATOR
54
1966 .1359131 .0705045 1.93 0.054 -.0023053 .2741315
1965 .1098147 .0730354 1.50 0.133 -.0333653 .2529947
1964 .1550872 .0736255 2.11 0.035 .0107504 .2994241
1963 .1448196 .0739148 1.96 0.050 -.0000844 .2897236
1962 .0419273 .0757742 0.55 0.580 -.1066219 .1904766
1961 -.0976766 .0752323 -1.30 0.194 -.2451635 .0498103
year
l_popt -.1974149 .0380194 -5.19 0.000 -.2719489 -.1228809
l_infl2 -.0301174 .0054168 -5.56 0.000 -.0407367 -.0194982
l_realgdp .2112165 .0187937 11.24 0.000 .1743731 .24806
l_money Coef. Std. Err. t P>|t| [95% Conf. Interval]
Total 2454.44502 5435 .451599819 Root MSE = .31621
Adj R-squared = 0.7786
Residual 521.554775 5216 .09999133 R-squared = 0.7875
Model 1932.89024 219 8.82598285 Prob > F = 0.0000
F(219, 5216) = 88.27
Source SS df MS Number of obs = 5436
⋮ ⋮ ⋮ ⋮ ⋮⋮ ⋮

More Related Content

What's hot

06 ch ken black solution
06 ch ken black solution06 ch ken black solution
06 ch ken black solution
Krunal Shah
 

What's hot (17)

Chap12 multiple regression
Chap12 multiple regressionChap12 multiple regression
Chap12 multiple regression
 
Chap12 simple regression
Chap12 simple regressionChap12 simple regression
Chap12 simple regression
 
Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2
 
Tokyo conference
Tokyo conferenceTokyo conference
Tokyo conference
 
Scatter diagrams
Scatter diagramsScatter diagrams
Scatter diagrams
 
Simple linear regression and correlation
Simple linear regression and correlationSimple linear regression and correlation
Simple linear regression and correlation
 
Applied Business Statistics ,ken black , ch 6
Applied Business Statistics ,ken black , ch 6Applied Business Statistics ,ken black , ch 6
Applied Business Statistics ,ken black , ch 6
 
Standard normal distribution
Standard normal distributionStandard normal distribution
Standard normal distribution
 
06 ch ken black solution
06 ch ken black solution06 ch ken black solution
06 ch ken black solution
 
Chapter9 the normal curve distribution
Chapter9 the normal curve distributionChapter9 the normal curve distribution
Chapter9 the normal curve distribution
 
Applied Business Statistics ,ken black , ch 5
Applied Business Statistics ,ken black , ch 5Applied Business Statistics ,ken black , ch 5
Applied Business Statistics ,ken black , ch 5
 
Project2
Project2Project2
Project2
 
Simple & Multiple Regression Analysis
Simple & Multiple Regression AnalysisSimple & Multiple Regression Analysis
Simple & Multiple Regression Analysis
 
Usuario stata
Usuario stataUsuario stata
Usuario stata
 
Generalized linear model
Generalized linear modelGeneralized linear model
Generalized linear model
 
Increasing Power without Increasing Sample Size
Increasing Power without Increasing Sample SizeIncreasing Power without Increasing Sample Size
Increasing Power without Increasing Sample Size
 
Simple regression and correlation
Simple regression and correlationSimple regression and correlation
Simple regression and correlation
 

Similar to Static Models of Continuous Variables

Summary statistics (1)
Summary statistics (1)Summary statistics (1)
Summary statistics (1)
Godwin Okley
 
Chapter 9 learning more about sample data(1)
Chapter 9 learning more about sample data(1)Chapter 9 learning more about sample data(1)
Chapter 9 learning more about sample data(1)
Celumusa Godfrey Nkosi
 
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
Neeraj Bhandari
 
measure of variability (windri). In research include example
measure of variability (windri). In research include examplemeasure of variability (windri). In research include example
measure of variability (windri). In research include example
windri3
 

Similar to Static Models of Continuous Variables (20)

Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptx
 
simple linear regression - brief introduction
simple linear regression - brief introductionsimple linear regression - brief introduction
simple linear regression - brief introduction
 
Measures of dispersion range qd md
Measures of dispersion range qd mdMeasures of dispersion range qd md
Measures of dispersion range qd md
 
Regression Analysis , A statistical approch to analysis data.pptx
Regression Analysis , A statistical  approch to analysis data.pptxRegression Analysis , A statistical  approch to analysis data.pptx
Regression Analysis , A statistical approch to analysis data.pptx
 
Measures of dispersion
Measures of dispersionMeasures of dispersion
Measures of dispersion
 
Business statistics solved numericals
Business statistics solved numericalsBusiness statistics solved numericals
Business statistics solved numericals
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Normal probability distribution
Normal probability distributionNormal probability distribution
Normal probability distribution
 
Standard deviation
Standard deviationStandard deviation
Standard deviation
 
Interpolation and Extrapolation
Interpolation and ExtrapolationInterpolation and Extrapolation
Interpolation and Extrapolation
 
Statistics 3, 4
Statistics 3, 4Statistics 3, 4
Statistics 3, 4
 
Summary statistics (1)
Summary statistics (1)Summary statistics (1)
Summary statistics (1)
 
Statistics
StatisticsStatistics
Statistics
 
Chapter 9 learning more about sample data(1)
Chapter 9 learning more about sample data(1)Chapter 9 learning more about sample data(1)
Chapter 9 learning more about sample data(1)
 
Regression
RegressionRegression
Regression
 
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
Measure of dispersion by Neeraj Bhandari ( Surkhet.Nepal )
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
measure of variability (windri). In research include example
measure of variability (windri). In research include examplemeasure of variability (windri). In research include example
measure of variability (windri). In research include example
 
Different Types of Machine Learning Algorithms
Different Types of Machine Learning AlgorithmsDifferent Types of Machine Learning Algorithms
Different Types of Machine Learning Algorithms
 
Advanced-Differentiation-Rules.pdf
Advanced-Differentiation-Rules.pdfAdvanced-Differentiation-Rules.pdf
Advanced-Differentiation-Rules.pdf
 

More from Economic Research Forum

More from Economic Research Forum (20)

Session 4 farhad mehran, single most data gaps
Session 4 farhad mehran, single most data gapsSession 4 farhad mehran, single most data gaps
Session 4 farhad mehran, single most data gaps
 
Session 3 mahdi ben jelloul, microsimulation for policy evaluation
Session 3 mahdi ben jelloul, microsimulation for policy evaluationSession 3 mahdi ben jelloul, microsimulation for policy evaluation
Session 3 mahdi ben jelloul, microsimulation for policy evaluation
 
Session 3 m.a. marouani, structual change, skills demand and job quality
Session 3 m.a. marouani, structual change, skills demand and job qualitySession 3 m.a. marouani, structual change, skills demand and job quality
Session 3 m.a. marouani, structual change, skills demand and job quality
 
Session 3 ishac diwn, bridging mirco and macro appraoches
Session 3 ishac diwn, bridging mirco and macro appraochesSession 3 ishac diwn, bridging mirco and macro appraoches
Session 3 ishac diwn, bridging mirco and macro appraoches
 
Session 3 asif islam, jobs flagship report
Session 3 asif islam, jobs flagship reportSession 3 asif islam, jobs flagship report
Session 3 asif islam, jobs flagship report
 
Session 2 yemen hlel, insights from tunisia
Session 2 yemen hlel, insights from tunisiaSession 2 yemen hlel, insights from tunisia
Session 2 yemen hlel, insights from tunisia
 
Session 2 samia satti, insights from sudan
Session 2 samia satti, insights from sudanSession 2 samia satti, insights from sudan
Session 2 samia satti, insights from sudan
 
Session 2 mona amer, insights from egypt
Session 2 mona amer, insights from egyptSession 2 mona amer, insights from egypt
Session 2 mona amer, insights from egypt
 
Session 2 ali souag, insights from algeria
Session 2 ali souag, insights from algeriaSession 2 ali souag, insights from algeria
Session 2 ali souag, insights from algeria
 
Session 2 abdel rahmen el lahga, insights from tunisia
Session 2 abdel rahmen el lahga, insights from tunisiaSession 2 abdel rahmen el lahga, insights from tunisia
Session 2 abdel rahmen el lahga, insights from tunisia
 
Session 1 ragui assaad, moving beyond the unemployment rate
Session 1 ragui assaad, moving beyond the unemployment rateSession 1 ragui assaad, moving beyond the unemployment rate
Session 1 ragui assaad, moving beyond the unemployment rate
 
Session 1 luca fedi, towards a research agenda
Session 1 luca fedi, towards a research agendaSession 1 luca fedi, towards a research agenda
Session 1 luca fedi, towards a research agenda
 
من البيانات الى السياسات : مبادرة إتاحة البيانات المنسقة
من البيانات الى السياسات : مبادرة إتاحة البيانات المنسقةمن البيانات الى السياسات : مبادرة إتاحة البيانات المنسقة
من البيانات الى السياسات : مبادرة إتاحة البيانات المنسقة
 
The Future of Jobs is Facing the Biggest Policy Induced Price Distortion in H...
The Future of Jobs is Facing the Biggest Policy Induced Price Distortion in H...The Future of Jobs is Facing the Biggest Policy Induced Price Distortion in H...
The Future of Jobs is Facing the Biggest Policy Induced Price Distortion in H...
 
Job- Creating Growth in the Emerging Global Economy
Job- Creating Growth in the Emerging Global EconomyJob- Creating Growth in the Emerging Global Economy
Job- Creating Growth in the Emerging Global Economy
 
The Role of Knowledge in the Process of Innovation in the New Global Economy:...
The Role of Knowledge in the Process of Innovation in the New Global Economy:...The Role of Knowledge in the Process of Innovation in the New Global Economy:...
The Role of Knowledge in the Process of Innovation in the New Global Economy:...
 
Rediscovering Industrial Policy for the 21st Century: Where to Start?
Rediscovering Industrial Policy for the 21st Century: Where to Start?Rediscovering Industrial Policy for the 21st Century: Where to Start?
Rediscovering Industrial Policy for the 21st Century: Where to Start?
 
How the Rise of the Intangibles Economy is Disrupting Work in Africa
How the Rise of the Intangibles Economy is Disrupting Work in AfricaHow the Rise of the Intangibles Economy is Disrupting Work in Africa
How the Rise of the Intangibles Economy is Disrupting Work in Africa
 
On Ideas and Economic Policy: A Survey of MENA Economists
On Ideas and Economic Policy: A Survey of MENA EconomistsOn Ideas and Economic Policy: A Survey of MENA Economists
On Ideas and Economic Policy: A Survey of MENA Economists
 
Future Research Directions for ERF
Future Research Directions for ERFFuture Research Directions for ERF
Future Research Directions for ERF
 

Recently uploaded

Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 

Recently uploaded (20)

Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...Call On 6297143586  Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
Call On 6297143586 Viman Nagar Call Girls In All Pune 24/7 Provide Call With...
 
A Press for the Planet: Journalism in the face of the Environmental Crisis
A Press for the Planet: Journalism in the face of the Environmental CrisisA Press for the Planet: Journalism in the face of the Environmental Crisis
A Press for the Planet: Journalism in the face of the Environmental Crisis
 
The U.S. Budget and Economic Outlook (Presentation)
The U.S. Budget and Economic Outlook (Presentation)The U.S. Budget and Economic Outlook (Presentation)
The U.S. Budget and Economic Outlook (Presentation)
 
VIP Model Call Girls Narhe ( Pune ) Call ON 8005736733 Starting From 5K to 25...
VIP Model Call Girls Narhe ( Pune ) Call ON 8005736733 Starting From 5K to 25...VIP Model Call Girls Narhe ( Pune ) Call ON 8005736733 Starting From 5K to 25...
VIP Model Call Girls Narhe ( Pune ) Call ON 8005736733 Starting From 5K to 25...
 
Postal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptxPostal Ballots-For home voting step by step process 2024.pptx
Postal Ballots-For home voting step by step process 2024.pptx
 
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
Just Call Vip call girls Wardha Escorts ☎️8617370543 Starting From 5K to 25K ...
 
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORSPPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
PPT BIJNOR COUNTING Counting of Votes on ETPBs (FOR SERVICE ELECTORS
 
Pimpri Chinchwad ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi R...
Pimpri Chinchwad ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi R...Pimpri Chinchwad ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi R...
Pimpri Chinchwad ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi R...
 
The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...The Economic and Organised Crime Office (EOCO) has been advised by the Office...
The Economic and Organised Crime Office (EOCO) has been advised by the Office...
 
CBO’s Recent Appeals for New Research on Health-Related Topics
CBO’s Recent Appeals for New Research on Health-Related TopicsCBO’s Recent Appeals for New Research on Health-Related Topics
CBO’s Recent Appeals for New Research on Health-Related Topics
 
Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
Russian🍌Dazzling Hottie Get☎️ 9053900678 ☎️call girl In Chandigarh By Chandig...
 
Finance strategies for adaptation. Presentation for CANCC
Finance strategies for adaptation. Presentation for CANCCFinance strategies for adaptation. Presentation for CANCC
Finance strategies for adaptation. Presentation for CANCC
 
Item # 4 - 231 Encino Ave (Significance Only).pdf
Item # 4 - 231 Encino Ave (Significance Only).pdfItem # 4 - 231 Encino Ave (Significance Only).pdf
Item # 4 - 231 Encino Ave (Significance Only).pdf
 
Tuvalu Coastal Adaptation Project (TCAP)
Tuvalu Coastal Adaptation Project (TCAP)Tuvalu Coastal Adaptation Project (TCAP)
Tuvalu Coastal Adaptation Project (TCAP)
 
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
Get Premium Budhwar Peth Call Girls (8005736733) 24x7 Rate 15999 with A/c Roo...
 
Financing strategies for adaptation. Presentation for CANCC
Financing strategies for adaptation. Presentation for CANCCFinancing strategies for adaptation. Presentation for CANCC
Financing strategies for adaptation. Presentation for CANCC
 
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Bhosari ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Dapodi ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
↑VVIP celebrity ( Pune ) Serampore Call Girls 8250192130 unlimited shot and a...
↑VVIP celebrity ( Pune ) Serampore Call Girls 8250192130 unlimited shot and a...↑VVIP celebrity ( Pune ) Serampore Call Girls 8250192130 unlimited shot and a...
↑VVIP celebrity ( Pune ) Serampore Call Girls 8250192130 unlimited shot and a...
 
Expressive clarity oral presentation.pptx
Expressive clarity oral presentation.pptxExpressive clarity oral presentation.pptx
Expressive clarity oral presentation.pptx
 

Static Models of Continuous Variables

  • 1. ERF Training Workshop Panel Data 2 Raimundo Soto Instituto de Economía, PUC-Chile
  • 2. STATIC MODELS OF CONTINUOUS VARIABLES 2
  • 3. MODEL STRUCTURE • Canonical Model 𝑦𝑖𝑡 = 𝛼𝑖𝑡 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 where • 𝑦𝑖𝑡 is the phenomenon of interest to be modelled, • 𝑥𝑖𝑡 represents all observed controls (regressors) • 𝛼𝑖𝑡 are the individual effects • 𝜀𝑖𝑡 is the non-systematic part (what we choose not to model) 3
  • 4. DATA STRUCTURE • Let us stack the data in the it structure • 𝑦11 𝑦12 ⋮ 𝑦1𝑇 𝑦21 𝑦22 ⋮ 𝑦2𝑇 ⋮ ⋮ 𝑦 𝑁1 ⋮ 𝑦 𝑁𝑇 4
  • 6. DATA STRUCTURE • Let us stack the data in the it structure • 𝑦11 𝑦12 ⋮ 𝑦1𝑇 𝑦21 𝑦22 ⋮ 𝑦2𝑇 ⋮ ⋮ 𝑦 𝑁1 ⋮ 𝑦 𝑁𝑇 = 𝛼11 𝛼12 ⋮ 𝛼1𝑇 𝛼21 𝛼22 ⋮ 𝛼2𝑇 ⋮ ⋮ 𝛼 𝑁1 ⋮ 𝛼 𝑁𝑇 + 𝑤11 𝑤12 ⋮ 𝑤1𝑇 𝑤21 𝑤22 ⋮ 𝑤2𝑇 ⋮ ⋮ 𝑤 𝑁1 ⋮ 𝑤 𝑁𝑇 𝑣11 𝑣12 ⋮ 𝑣1𝑇 𝑣21 𝑣22 ⋮ 𝑣2𝑇 ⋮ ⋮ 𝑣 𝑁1 ⋮ 𝑣 𝑁𝑇 … 𝑧11 𝑧12 ⋮ 𝑧1𝑇 𝑧21 𝑧22 ⋮ 𝑧2𝑇 ⋮ ⋮ 𝑧 𝑁1 ⋮ 𝑧 𝑁𝑇 𝛽 + 𝜀11 𝜀12 ⋮ 𝜀1𝑇 𝜀21 𝜀22 ⋮ 𝜀2𝑇 ⋮ ⋮ 𝜀 𝑁1 ⋮ 𝜀 𝑁𝑇 6
  • 7. DATA STRUCTURE • Let us stack the data in the it structure • 𝑦11 𝑦12 ⋮ 𝑦1𝑇 𝑦21 𝑦22 ⋮ 𝑦2𝑇 ⋮ ⋮ 𝑦 𝑁1 ⋮ 𝑦 𝑁𝑇 = 𝛼11 𝛼12 ⋮ 𝛼1𝑇 𝛼21 𝛼22 ⋮ 𝛼2𝑇 ⋮ ⋮ 𝛼 𝑁1 ⋮ 𝛼 𝑁𝑇 + 𝑤11 𝑤12 ⋮ 𝑤1𝑇 𝑤21 𝑤22 ⋮ 𝑤2𝑇 ⋮ ⋮ 𝑤 𝑁1 ⋮ 𝑤 𝑁𝑇 𝑣11 𝑣12 ⋮ 𝑣1𝑇 𝑣21 𝑣22 ⋮ 𝑣2𝑇 ⋮ ⋮ 𝑣 𝑁1 ⋮ 𝑣 𝑁𝑇 … 𝑧11 𝑧12 ⋮ 𝑧1𝑇 𝑧21 𝑧22 ⋮ 𝑧2𝑇 ⋮ ⋮ 𝑧 𝑁1 ⋮ 𝑧 𝑁𝑇 𝛽 + 𝜀11 𝜀12 ⋮ 𝜀1𝑇 𝜀21 𝜀22 ⋮ 𝜀2𝑇 ⋮ ⋮ 𝜀 𝑁1 ⋮ 𝜀 𝑁𝑇 = 𝛼 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 7
  • 8. ESTIMATION IS IMPOSSIBLE • If we allow for 𝛼 𝑁𝑇 there will be 𝑁𝑇 constants (and, at most, NT observations), not enough degrees of freedom to estimate the parameters. • We will restrict ourselves to: – 𝛼𝑖 , i.e., N constants (that do not change in time) – 𝜆 𝑡 , i.e., T constants (that do not change by individual) 8
  • 9. POOLED ESTIMATOR • Let us ignore all heterogeneity 𝑦𝑖𝑡 = 𝛼 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 • The OLS estimator is: 𝛽 = 𝑥𝑖𝑡 ′ 𝑥𝑖𝑡 −1 𝑥𝑖𝑡 ′ 𝑦𝑖𝑡 • The variance estimator is 𝑉𝑎𝑟 𝛽 = 𝜎𝜀 2 𝑥𝑖𝑡 ′ 𝑥𝑖𝑡 −1 = 𝜎𝜀 2 𝑉(𝑥𝑖𝑡) • Note the increase in precision (𝑁𝑥𝑇) 9
  • 10. FIXED EFFECTS ESTIMATOR • Consider that the heterogeneity is only among individuals 𝑦𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 • 𝛼𝑖 represents individual characteristics that are fixed • We could use binary (dummy) variables to represent fixed characteristics 10
  • 11. FIXED EFFECTS ESTIMATOR 𝑦11 𝑦12 ⋮ 𝑦1𝑇 𝑦21 𝑦22 ⋮ 𝑦2𝑇 ⋮ ⋮ 𝑦 𝑁1 ⋮ 𝑦 𝑁𝑇 = 𝛼1 𝛼1 ⋮ 𝛼1 0 0 ⋮ 0 ⋮ ⋮ 0 ⋮ 0 0 0 ⋮ 0 𝛼2 𝛼2 ⋮ 0 ⋮ ⋮ 0 ⋮ 0 … 0 0 ⋮ 0 0 0 ⋮ 0 ⋮ ⋮ 𝛼 𝑁 ⋮ 𝛼 𝑁 + 𝑤11 𝑤12 ⋮ 𝑤1𝑇 𝑤21 𝑤22 ⋮ 𝑤2𝑇 ⋮ ⋮ 𝑤 𝑁1 ⋮ 𝑤 𝑁𝑇 𝑣11 𝑣12 ⋮ 𝑣1𝑇 𝑣21 𝑣22 ⋮ 𝑣2𝑇 ⋮ ⋮ 𝑣 𝑁1 ⋮ 𝑣 𝑁𝑇 … 𝑧11 𝑧12 ⋮ 𝑧1𝑇 𝑧21 𝑧22 ⋮ 𝑧2𝑇 ⋮ ⋮ 𝑧 𝑁1 ⋮ 𝑧 𝑁𝑇 𝛽 + 𝜀11 𝜀12 ⋮ 𝜀1𝑇 𝜀21 𝜀22 ⋮ 𝜀2𝑇 ⋮ ⋮ 𝜀 𝑁1 ⋮ 𝜀 𝑁𝑇 11
  • 12. FIXED EFFECTS ESTIMATOR • 𝑦𝑖𝑡 = 𝛼𝐷 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 • Note: same slope, different intercept (constant) • All classic results on econometric estimation techniques hold: nature of the OLS estimator, optimality, goodness of fit, and asymptotic distributions of estimators and tests. • This estimator is called LSDV least squares dummy variables. 12
  • 13. FIXED EFFECTS ESTIMATOR Group 2 Group 1 𝑥 𝑦 13
  • 14. FIXED EFFECTS ESTIMATOR Group 2 Group 1 𝑥 𝑦 𝛼2 𝛼1 𝑦2 = 𝛼2 + 𝑥2β 𝑦1 = 𝛼1 + 𝑥1β 14
  • 15. FIXED EFFECTS ESTIMATOR Group 2 Group 1 𝑥 𝑦 𝛼2 𝛼1 𝑦2 = 𝛼2 + 𝑥2β 𝑦1 = 𝛼1 + 𝑥1β 𝑦 = 𝛼 + 𝑥β 15
  • 16. FIXED EFFECTS ESTIMATOR • Example: – Vial y Soto (2002) revise the opinion that “university selection tests (PSU) do not predict student performance (R) in their faculties, only secondary-school marks are important”. – When running the pooled regression: 𝑅𝑖𝑡 = 𝛼 + 𝛽𝑃𝑆𝑈𝑖𝑡 + 𝜇𝑖𝑡 The estimated 𝛽 is small, not significant or displays the “wrong” sign (negative). 16
  • 17. PREDICTED EFFECT OF SELECTION TESTS ON STUDENTS’ PERFORMANCE Note: * significant at 10% size
  • 18. PREDICTED EFFECT OF SELECTION TESTS ON STUDENTS’ PERFORMANCE Note: * significant at 10% size
  • 21. POOLED VS FIXED EFFECTS ESTIMATORS 𝑃𝑆𝑈 𝑅 21 “Low-quality” faculties “High-quality” faculties
  • 22. POOLED VS FIXED EFFECTS ESTIMATORS 𝑃𝑆𝑈 𝑅 22 “Low-quality” faculties “High-quality” faculties
  • 23. FIXED EFFECTS ESTIMATOR • LSDV estimator is unfeasible if N is too large – HIECS has 24,000 households • Recall that constants in regressions only take away the means of the variables • It would be much simpler to eliminate the means of the variables and avoid specifying 24,000 dummy variables 23
  • 24. FIXED EFFECTS ESTIMATOR 𝑦𝑖𝑡 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 • Let us take expected value for each individual “i” in time: 𝐸𝑖 𝑦𝑖𝑡 = 𝐸𝑖 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 𝑦𝑖 = 𝛼𝑖 + 𝑥𝑖 𝛽 • and subtract from the original model to eliminate 𝛼𝑖: 𝑦𝑖𝑡 − 𝑦𝑖 = 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖 𝛽 𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡 24
  • 25. FIXED EFFECTS ESTIMATOR 𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡 • This is a very simple estimation, without the problems derived from dimensionality. • Obviously, we cannot estimate 𝛼𝑖, but they are easily recovered as: 𝛼𝑖 = 𝑦𝑖 − 𝑥𝑖 𝛽 25
  • 26. FIXED EFFECTS ESTIMATOR Group 2 Group 1 𝑥 𝑦 𝛼2 𝛼1 26
  • 27. FIXED EFFECTS ESTIMATOR Group 2 𝑥 𝑦 Group 1 w/o means 27
  • 28. FIXED EFFECTS ESTIMATOR Groups 1 & 2 w/o means 𝑥 𝑦 28
  • 30. FIXED EFFECTS ESTIMATOR 𝑦𝑖𝑡 − 𝑦𝑖 = 𝑥𝑖𝑡 − 𝑥𝑖 𝛽 + 𝜀𝑖𝑡 • This estimator uses only information within each group and it is therefore called within-groups estimator • Let us obtain certain useful “sums” in order to better understand the nature of estimators. 30
  • 31. POOLED ESTIMATOR 𝑆 𝑝 𝑥𝑥 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥 𝑆 𝑝 𝑥𝑦 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥 ′ 𝑦𝑖𝑡 − 𝑦 𝛽 𝑝 = 𝑆 𝑝 𝑥𝑦 𝑆 𝑝 𝑥𝑥 31
  • 32. WITHIN-GROUPS ESTIMATOR 𝑆 𝑤 𝑥𝑥 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖𝑡 − 𝑥𝑖 𝑆 𝑤 𝑥𝑦 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑦𝑖𝑡 − 𝑦𝑖 𝛽 𝑤 = 𝑆 𝑤 𝑥𝑦 𝑆 𝑤 𝑥𝑥 32
  • 33. WITHIN-GROUPS ESTIMATOR • From the pooled estimator 𝑆 𝑝 𝑥𝑥 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 ′ 𝑥𝑖𝑡 − 𝑥𝑖 + 𝑥𝑖 − 𝑥 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖 − 𝑥 + 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 𝑆 𝑝 𝑥𝑥 = 𝑆 𝑤 𝑥𝑥 + 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 33
  • 34. WITHIN-GROUPS ESTIMATOR • Thus 𝑆 𝑝 𝑥𝑥 = 𝑆 𝑤 𝑥𝑥 + 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 𝑆 𝑤 𝑥𝑥 = 𝑆 𝑝 𝑥𝑥 − 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 • Double sums are either zero or positive (these are squares) hence 𝑆 𝑤 𝑥𝑥 ≤ 𝑆 𝑝 𝑥𝑥 34
  • 35. WITHIN-GROUPS ESTIMATOR • The variance of the within-groups estimator is 𝑉𝑎𝑟 𝛽 𝑤 = 𝜎2 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖𝑡 − 𝑥𝑖 ′ 𝑥𝑖 − 𝑥 + 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 𝑉𝑎𝑟 𝛽 𝑤 = 𝜎2 𝑆 𝑝 𝑥𝑥 − 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 • Therefore, this variance is larger than that of the pooled estimator • The within-groups estimator is less precise than the pooled estimator 35
  • 36. LET US SEE THIS IN PRACTICE • Open Stata • Open file ERF_Continuous Static.do – Declare Panel Data and Variables • xtset – Panel Data Analysis: commands xt • xtdes • xtsum – Panel Data Regression • xtreg • Let us check the estimation results 36
  • 37. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 37
  • 38. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Total Observations 38
  • 39. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Total Groups 39
  • 40. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Group Characteristics 40
  • 41. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Different estimates 41
  • 42. F test that all u_i=0: F(162, 5270) = 98.59 Prob > F = 0.0000 rho .95557807 (fraction of variance due to u_i) sigma_e .32607847 sigma_u 1.5123647 _cons -7.844568 .2477214 -31.67 0.000 -8.330205 -7.358932 l_popt .0731808 .0285325 2.56 0.010 .0172453 .1291163 l_infl2 -.0281481 .004758 -5.92 0.000 -.0374757 -.0188204 l_realgdp .3846652 .0153326 25.09 0.000 .354607 .4147234 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] corr(u_i, Xb) = -0.9200 Prob > F = 0.0000 F(3,5270) = 859.53 overall = 0.0036 max = 55 between = 0.0140 avg = 33.3 R-sq: within = 0.3285 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Fixed-effects (within) regression Number of obs = 5436 _cons 3.315492 .0848041 39.10 0.000 3.149242 3.481742 l_popt .0014429 .0061381 0.24 0.814 -.0105903 .0134762 l_infl2 -.1650409 .0078825 -20.94 0.000 -.1804937 -.149588 l_realgdp -.0086728 .0036681 -2.36 0.018 -.0158636 -.0014819 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .64482 Adj R-squared = 0.0793 Residual 2258.61346 5432 .415797764 R-squared = 0.0798 Model 195.831563 3 65.2771875 Prob > F = 0.0000 F( 3, 5432) = 156.99 Source SS df MS Number of obs = 5436 Different Fit 42
  • 43. BETWEEN-GROUPS ESTIMATOR • Recall that the regression model goes through the averages (mean) of variables 𝐸𝑖 𝑦𝑖𝑡 = 𝐸𝑖 𝛼𝑖 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 • We can run a regression on the means of each group 𝑦𝑖 = 𝛼 + 𝑥𝑖 𝛽 43
  • 46. BETWEEN-GROUPS ESTIMATOR Group 2 Group 1 𝑥 𝑦 46 𝑦𝑖 = 𝛼 + 𝑥𝑖 𝛽
  • 47. BETWEEN-GROUPS ESTIMATOR • Let´s look at the estimator using sums 𝑆 𝑏 𝑥𝑥 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑥𝑖 − 𝑥 𝑆 𝑏 𝑥𝑦 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑥𝑖 − 𝑥 ′ 𝑦𝑖 − 𝑦 𝛽 𝑏 = 𝑆 𝑏 𝑥𝑦 𝑆 𝑏 𝑥𝑥 47
  • 48. BETWEEN-GROUPS ESTIMATOR • Note that 𝑆 𝑝 𝑥𝑥 = 𝑆 𝑤 𝑥𝑥 + 𝑆 𝑏 𝑥𝑥 𝑆 𝑝 𝑥𝑦 = 𝑆 𝑤 𝑥𝑦 + 𝑆 𝑏 𝑥𝑦 • Hence 𝛽 𝑝 = 𝐹 𝑤 𝛽 𝑤 + 𝐼 − 𝐹 𝑤 𝛽 𝑏 𝐹 𝑤 = 𝑆 𝑤 𝑥𝑥 𝑆 𝑤 𝑥𝑥 + 𝑆 𝑏 𝑥𝑥 48
  • 49. BETWEEN-GROUPS ESTIMATOR 𝛽 𝑝 = 𝐹 𝑤 𝛽 𝑤 + 𝐼 − 𝐹 𝑤 𝛽 𝑏 • The pooled estimator is a weighted average of the between and within-group estimators • Weights depend on the information content of the data: – If groups are very similar, information comes from individuals within groups – If groups are very different, information comes from differences between groups 49
  • 50. RESULTS BETWEEN-GROUPS ESTIMATOR 50 _cons 2.450055 .4769026 5.14 0.000 1.508174 3.391936 l_popt .008753 .029578 0.30 0.768 -.0496633 .0671694 l_infl2 -.4064124 .0650977 -6.24 0.000 -.53498 -.2778448 l_realgdp -.0062972 .0168565 -0.37 0.709 -.0395887 .0269942 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] sd(u_i + avg(e_i.))= .5167678 Prob > F = 0.0000 F(3,159) = 14.81 overall = 0.0787 max = 55 between = 0.2185 avg = 33.3 R-sq: within = 0.0155 Obs per group: min = 4 Group variable: idwbcode Number of groups = 163 Between regression (regression on group means) Number of obs = 5436 . xtreg l_money l_realgdp l_infl2 l_popt, be
  • 51. ESTIMATING THE VARIANCE OF RESIDUALS • Compute the sample residuals as: 𝜀𝑖𝑡 = 𝑦𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖𝑡 𝛽 • The residual variance estimator is simply: 𝜎2 = 𝑖=1 𝑁 𝑡=1 𝑇 𝑦𝑖𝑡 − 𝛼𝑖 − 𝑥𝑖𝑡 𝛽 2 𝑁𝑇 − 𝑁 − 𝐾 51
  • 52. HYPOTHESIS TESTING • Having the estimated parameters and the residual variance estimator hypotheses testing is straightforward – Individual parameter tests distribute t in small samples and Normal in large samples – Multiple parameter tests distribute 𝜒2 or 𝐹(𝑚, 𝑛) 52
  • 53. TWO-WAY FIXED EFFECTS ESTIMATOR • Model with fixed individual effects and fixed time effects 𝑦𝑖𝑡 = 𝛼𝑖 + 𝜆 𝑡 + 𝑥𝑖𝑡 𝛽 + 𝜀𝑖𝑡 where • 𝜆 𝑡 is a time effect affecting equally all individuals • 𝛼𝑖 is, again, an individual effect for all times 53
  • 54. RESULTS OF THE TWO-WAY ESTIMATOR 54 1966 .1359131 .0705045 1.93 0.054 -.0023053 .2741315 1965 .1098147 .0730354 1.50 0.133 -.0333653 .2529947 1964 .1550872 .0736255 2.11 0.035 .0107504 .2994241 1963 .1448196 .0739148 1.96 0.050 -.0000844 .2897236 1962 .0419273 .0757742 0.55 0.580 -.1066219 .1904766 1961 -.0976766 .0752323 -1.30 0.194 -.2451635 .0498103 year l_popt -.1974149 .0380194 -5.19 0.000 -.2719489 -.1228809 l_infl2 -.0301174 .0054168 -5.56 0.000 -.0407367 -.0194982 l_realgdp .2112165 .0187937 11.24 0.000 .1743731 .24806 l_money Coef. Std. Err. t P>|t| [95% Conf. Interval] Total 2454.44502 5435 .451599819 Root MSE = .31621 Adj R-squared = 0.7786 Residual 521.554775 5216 .09999133 R-squared = 0.7875 Model 1932.89024 219 8.82598285 Prob > F = 0.0000 F(219, 5216) = 88.27 Source SS df MS Number of obs = 5436 ⋮ ⋮ ⋮ ⋮ ⋮⋮ ⋮