Professional Documents
Culture Documents
Applied Econometrics
Winter Term 2020/2021
Prof. Dr. Simone Maxand
Humboldt University Berlin
4.1 Linear panel data models 2 | 95
Contents I
Contents II
4.1.1 Introduction
I Panel data:
. persons, households,
. rms, industries,
. countries, regions within a country,
. assets, ...
xed T and N → ∞.
Applied Econometrics Chapter 4
4.1 Linear panel data models | 4.1.2 SUR 11 | 95
E[εit ] = 0 ∀i, t,
(
σij , t = s
E[εit εjs ] = .
0, t 6= s
. Allows for contemporaneous correlations across the equations.
I Equation i: yi = Xi θi + εi , i = 1, . . . , N,
where (assuming Ki = K for all i)
xi01
1 " #
. . αi
Xi = .. .
. , θi =
βi
1
0
xiT (K +1)×1
T ×(K +1)
yi 1 εi 1
. .
yi = . , εi = .
. .
yiT T ×1
εiT T ×1
System representation
y = X θ + ε,
where
X1 0 ··· 0
y1
0 X2 ··· 0
.
y = . , X =
. .. . .. .
. .
. . . .
yN
NT ×1 0 ··· ··· XN
NT ×(K +1)N
θ1 ε1
. .
θ= . , ε= .
. .
θN (K +1)N×1
εN NT ×1
Covariance matrix
V[ε] = E[εε0 ] = Σ ⊗ IT := Ω,
σN 1 2
. . . σN
N×N
I Denition: Let
Then,
ar 1 B ... ars B
1. (A ⊗ B)0 = A0 ⊗ B 0
2. ( A ⊗ B )( C ⊗ D ) = AC ⊗ BD
r ×s n×k s×p k×q
3. A ⊗( B + C )=A⊗B +A⊗C
r ×s n×k n×k
5. tr(A ⊗ B) = tr(A)tr(B)
6. In general: A ⊗ B 6= B ⊗ A!
I OLS estimator:
θbOLS = (X 0 X )−1 X 0 y ,
I Single equation estimators are more robust since they are not
equations, i.e. X1 = . . . = XN ,
. single equation estimation and system estimation coincide,
by
−1
V b −1 X
b θbGLS = X 0 Ω ,
with Ω b ⊗ IT
b =Σ ; Σ
b = ((b
σij ))i,j=1,...,N ,
where α
bi and βbi denote the OLS estimators of αi and βi .
. β1 = β2 = . . . = β ,
. α1 = α2 = . . . = α,
. common eects that vary over time like yit = αt + xit0 β + εit .
model:
εit = µi + νit ,
. µi : unobserved, individual-specic eects (describing the
unobserved heterogeneity across individuals); captures all
unobserved, time-constant eects that are not contained in xkit
. νit : remaining (idiosyncratic) disturbances, i.e. measurement
errors or omitted/unobservable eects that vary over time
εit = µi + λt + νit ,
(like SUR) with EC, dynamic panel data models, and panel
xi01
β1
. .
Xi = . , β = ..
.
(T ×K ) 0
xiT βK
yi 1 νi 1 εi 1
. . .
yi = . , νi = . , εi = .
. . .
(T ×1)
yiT νiT εiT
y = α1NT + X β + ε = Z θ + ε,
ε = G µ + ν,
!
where . α
Z= [1NT ..X ], θ= ,
β
µ = (µ1 , . . . , µN )0 , G = IN ⊗ 1T ,
and 1n denotes the n-vector of ones.
Contents I
Contents II
.
rk(G ..X ) = N + K (with probability one).
I The errors are homoscedastic & uncorrelated: ν|X ∼ (0, σν2 INT )
⇒ y |X ∼ (α1NT + X β + G µ, σν2 INT )
Identiability
. .
y = Aδ + ν , with A = (1NT ..X ..G ), δ = (α, β 0 , µ0 )0 ,
µ∗i := α + µi , i = 1, ..., N
⇒ y = X β + G µ∗ + ν (1)
N
X
µ· := µi = 0.
i=1
ANOVA notation
T T
X 1 1 X
xi· := xit x i· := xi· = xit
T T
t=1 t=1
I Cross sectional sum and cross sectional average
N N
X 1 1 X
x·t := xit x ·t := x·t = xit
N N
i=1 i=1
I Time and cross sectional sum and average
T X
N T X
N
X 1 1 X
x·· := xit x ·· := x·· = xit
NT NT
t=1 i=1 t=1 i=1
βb = (X 0 QX )−1 X 0 Qy
Q = I − P, P = PR(G ) := G (G 0 G )−1 G 0
time ∀i ):
y1 y 1· 1T
. NT .
y = . ∈R ⇒ Py = .
. .
yN y N· 1T
⇒ (Within-)Transformation Q yields deviations from the group
means y i· :
Qy = (yit − y i· ) i=1,...,N
t=1,...,T
Within(-group) estimator
Optimality of βbW
I βbW is OLSE of β in (1) resp. OLSE in the (Frisch-Waugh)
Residuals
I Thus
νb = y − α
b1NT − X βb − G µ
b
b∗
= y − X βb − G µ
= Qy − QX βbW
=: νbW
. Here, α
b, βb and µ
b are (any) OLS estimators of α, β and µ.
. Clearly, βb = βbW and the OLSE b∗
µ of µ∗ are unique.
0 ν
νb0 νb νbW
bν2 = σν2 ] = σν2
bW
σ = with E[b
NT − K − N NT − K − N
I Note: Actually we estimate N +K parameters (β and µ∗ ) ⇒
only NT − K − N degrees of freedom!
b∗ = (G 0 G )−1 G 0 (y − X βbW ).
µ
I Since G = IN ⊗ 1T and (G 0 G )−1 = 1
I
T N it follows that
µ∗· = α + µ· = α
⇒ µi = µ∗i − α = µ∗i − µ∗·
and therefore
∗
α b· = y ·· − x 0·· βbW
b=µ
bi = y i· − y ·· − (x i· − x ·· )0 βbW
µ
" N X
T
#−1
X
βbFD = (xit − xi,t−1 )(xit − xi,t−1 )0
i=1 t=2
N
XX T
· (xit − xi,t−1 )(yit − yi,t−1 )
i=1 t=2
I T =2 ⇒ βbFD = βbW
I T >2 ⇒ βbFD is less ecient than βbW (under our
assumptions)
I The Pooled OLS estimator uses cross sectional and time series
sectional heterogeneity):
βbPOOL = [X 0 (I − P0 )X ]−1 X 0 (I − P0 )y ,
1
where P0 = NT JNT (orthogonal projection onto R(1NT )).
I Clearly, V(βbPOOL ) V(βbW ), however βbPOOL is biased unless,
(RRSS − RSS)/(N − 1)
F = F (y ) = ∼ FN−1,NT −N−K
RSS/(NT − N − K ) H0
I Unrestricted residual sum of squares:
y = α1NT + X β + ν
kQ0 y − Q0 X βbPOOL k2 ,
!
= Q0 = I − P0
I H0 is rejected by a α0 -test, if
1−α0
F (y ) > FN−1,NT −N−K
10,000 people).
yb = 2.01 + 0.15x
states etc)
Model extension
consumption)
Contents I
Contents II
.
I Assumptions: (X and Z = [1NT ..X ] as in the FE model)
. One-Way- EC Model:
Moments of ε
I If X is stochastic, it is assumed to be strictly exogenous [w.r.t.
2 2
σµ + σν ,
if i = j and t = s (variances)
0, else (i 6= j)
Spectral decomposition of Ω
P = IN ⊗ Q = I − P, Ω
1
I Because of JT and can be written
T
as
GLS transformation
Ω−1/2 y = |Ω−{z
1/2
Z} θ + Ω −1/2
| {z ε}
| {z }
=e
y =Ze =e
ε
1
Ω−1/2 1NT = 1NT .
σ1
I Therefore the transformed model can be written as
α
ye = −1/2
| {z X} β + εe ,
1NT + Ω εe|X ∼ (0, INT ) (4)
σ1
=:X
e
I GLS Estimator:
!
α
b/σ1 . . .
= ((1NT ..Xe )0 (1NT ..Xe ))−1 (1NT ..Xe )0 ye
βb
Q0 ye = Q0 Xe β + Q0 εe, (5)
|{z} |{z} |{z}
=:y ∗ =X ∗ =ε∗
1
P0 = 1NT (10NT 1NT )−1 10NT = JNT .
| {z } NT
=NT
I P0 Q0 = 0
I P0 P = P0
I P0 Q = 0
I Q0 Q = Q
I Q0 P = P − P0
y ∗ = By and X ∗ = BX ,
where
1 1 1 1
B = Q0 Ω−1/2 = Q0 ( P+ Q)= (P − P0 ) + Q = B 0.
σ1 σν σ1 σν
I On account of (P − P0 )Q = PQ − P0 Q = 0, it follows
1 1
B 0B = B 2 = (P − P0 ) + Q.
σ12 σν2
⇒ The GLS estimator of β (OLSE in (5)) can be written as
I βbB only takes into account the variation between the groups,
Py = αP1NT + PX β + Pε
= α1NT + PX β + Pε (6)
⇔ y i . = α + x i . 0 β + εi . i = 1, ..., N; (∀t).
I It follows:
βbB = [X 0 (P − P0 )X ]−1 X 0 (P − P0 )y
| {z } | {z }
=BXX =BXY
" N
#−1 N
X X
= (x i . − x..)(x i . − x..)0 (x i . − x..)(y i . − y ..)
i=1 i=1
−1
V[βbW |X ] = σν2 WXX
V[βbB |X ] = σ 2 B −1
1 XX
σν2
V[βbGLS |X ] = σν2 [WXX + ψ 2 BXX ]−1 , where ψ 2 =
σ12
⇒ WXX = σν2 (V[βbW |X ])−1
ψ 2 BXX = σ 2 (V[βbB |X ])−1
ν
−1 −1 2
⇒ W1 = WXX + ψ 2 BXX WXX , W2 = WXX + ψ 2 BXX
ψ BXX
are proportional to inverse covariance matrices of βbW , βbB .
Special cases
σν2
(i) σµ2 = 0 : ⇒ ψ 2 = T ·0+σν2
=1
(ii) T → ∞:
σν2
ψ2 = → 0 ⇒ W1 → IK ⇒ βbGLS → βbW
T σµ2 + σν2
α
bGLS
1NT · y − Xe βbGLS ).
= P0 (e
σ1
I Due to
−1/2 1 1 1
P0 Ω = P0 P+ Q = P0 ,
σ1 σν σ1
we obtain
α
bGLS 1 1
1NT · = P0 (y − X βbGLS ) = 1NT (y .. − x..0 βbGLS )
σ1 σ1 σ1
and hence
2
Qε=Qν ∼ (0, σν Q) and Pε ∼ (0, σ12 P)
E[y 0 Ay ] = µ0 Aµ + tr [AΣ].
I Proof. Writing y = µ + (y − µ), we obtain
expectation.
Applied Econometrics Chapter 4
4.3 The random eects model | 4.3.3 FGLS estimation 69 | 95
Within residuals
CQ = C , CX = 0, CP = 0, C 1NT = 0.
I It can be shown that
νW ||2
||b y 0 (Q − QX (X 0 QX )−1 X 0 Q)y
bν2 =
σ = .
NT − N − K NT − N − K
DP = D, DZ = 0, DQ = 0.
I It can be shown that
c2 = εB ||2
||b y 0 Dy y 0 (P − PZ (Z 0 PZ )−1 Z 0 P)y
σ1 = =
N −K −1 N −K −1 N −K −1
2
⇒ Unbiased estimator of σµ :
b12 − σ
σ bν2
bµ2 =
σ
T
I Note: bµ2
σ can yield negative values. (In this case alternative
Contents I
Contents II
H1 : yi = αi 1T + Xi βi + εi (i = 1, ..., N)
I Test for poolability of the data across individuals:
H0 : σµ2 = 0
. Lagrange Multiplier test under normality (Breusch-Pagan)
E[ν|X ] = 0
βbW = β + (X 0 QX )−1 X 0 Qν
E[βbW ] = β + E (X 0 QX )−1 X 0 QE[ν|X ] = β
⇒
and ecient), if
I Recall:
Hausman test
P
qb := βbGLS − βbW −
→0 (under H0 )
P
but qb →
6 0 (under H1 )
I An asymptotic α0 -test rejects H0 if
q )]−1 qb
qb0 [V(b
[ > χ2K,1−α0 ,
where V(b q ) = V(βbW ) − V(βbGLS )
(generally positive denite under H0 due to ineciency of βbW ).
Contents I
Contents II
year t
I Explanatory variables:
8
firm
6
4
2
1945
year
1935
1500
inv
500
0
5000
value
2000
0
2000
capital
1000
0
2 4 6 8 0 500 1500 0 1000 2000
Call:
plm(formula = inv ~ value + capital, data = panel.gr, model = "pooling")
Balanced Panel: n=10, T=20, N=200
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-292.0 -30.0 5.3 34.8 369.0
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
(Intercept) -42.7143694 9.5116760 -4.4907 1.207e-05 ***
value 0.1155622 0.0058357 19.8026 < 2.2e-16 ***
capital 0.2306785 0.0254758 9.0548 < 2.2e-16 ***
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
Call:
plm(formula = inv ~ value + capital, data = panel.gr, model = "within")
Balanced Panel: n=10, T=20, N=200
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-184.000 -17.600 0.563 19.200 251.000
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
value 0.110124 0.011857 9.2879 < 2.2e-16 ***
capital 0.310065 0.017355 17.8666 < 2.2e-16 ***
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
I Estimates of µ∗i = α + µi
> (fix.gr.fe <- fixef(gr.fe))
1 2 3 4 5 6
-70.296717 101.905814 -235.571841 -27.809295 -114.616813 -23.161295
7 8 9 10
-66.553474 -57.545657 -87.222272 -6.567844
> summary(fixef(gr.fe))
Estimate Std. Error t-value Pr(>|t|)
1 -70.2967 49.7080 -1.4142 0.15730
2 101.9058 24.9383 4.0863 4.383e-05 ***
3 -235.5718 24.4316 -9.6421 < 2.2e-16 ***
4 -27.8093 14.0778 -1.9754 0.04822 *
5 -114.6168 14.1654 -8.0913 6.661e-16 ***
6 -23.1613 12.6687 -1.8282 0.06752 .
7 -66.5535 12.8430 -5.1821 2.194e-07 ***
8 -57.5457 13.9931 -4.1124 3.915e-05 ***
9 -87.2223 12.8919 -6.7657 1.327e-11 ***
10 -6.5678 11.8269 -0.5553 0.57867
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
> pFtest(gr.fe,gr.pool)
⇒ H0 is rejected.
Call:
plm(formula = inv ~ value + capital, data = panel.gr, model = "between")
Balanced Panel: n=10, T=20, N=200
Residuals :
Min. 1st Qu. Median 3rd Qu. Max.
-163.00 -3.68 2.97 20.70 144.00
Coefficients :
Estimate Std. Error t-value Pr(>|t|)
(Intercept) -8.527114 47.515308 -0.1795 0.86266
value 0.134646 0.028745 4.6841 0.00225 **
capital 0.032031 0.190938 0.1678 0.87152
---
Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1
I Under H0 : All slope parameters are the same, but the intercepts
may dier across rms
> # pvcm: estimation of models with variable coefficients (model under H_1)
> gr.sur <- pvcm(inv ~ value + capital,data=panel.gr,model="within")
> # Estimation under H_0:
> gr.fe.pool <- plm(inv ~ value + capital,data=panel.gr)
> pooltest(gr.fe.pool,gr.sur)
F statistic
data: inv ~ value + capital
F = 5.7805, df1 = 18, df2 = 170, p-value = 1.219e-10
alternative hypothesis: unstability
⇒ H0 is rejected.
Call:
pvcm(formula = inv ~ value + capital, data = panel.gr, model = "within")
Residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-184.5000 -7.1180 -0.3926 0.0000 5.7030 144.0000
Coefficients:
(Intercept) value capital
Min. :-149.782 Min. :0.004573 Min. :0.003102
1st Qu.: -9.639 1st Qu.:0.058518 1st Qu.:0.087132
Median : -6.956 Median :0.082738 Median :0.137738
Mean : -21.368 Mean :0.091285 Mean :0.205263
3rd Qu.: -1.507 3rd Qu.:0.128411 3rd Qu.:0.357513
Max. : 22.707 Max. :0.174856 Max. :0.437369
Hausman test
> phtest(gr.fe,gr.re)
Hausman Test
⇒ H0 is rejected.