Vous êtes sur la page 1sur 8

UNIVERSITE DE PARIS 11

TD dconomtrie

Anne Plunket
Les modles de panel

Vous disposez dun chantillon de 545 hommes sur une dure allant de 1980 1987. Les
variables sont les suivantes :
use "wagepan.dta"
. describe lwage exper union married hisp black educ expersq
storage display
value
variable name
type
format
label
variable label
------------------------------------------------------------------------------lwage
float %9.0g
log(wage)
exper
byte
%9.0g
labor mkt experience
union
byte
%9.0g
=1 if in union
married
byte
%9.0g
=1 if married
hisp
byte
%9.0g
=1 if Hispanic
black
byte
%9.0g
=1 if black
educ
byte
%9.0g
years of schooling
expersq
int
%9.0g
exper^2
. summarize lwage exper union married hisp black educ expersq
Variable |
Obs
Mean
Std. Dev.
Min
Max
-------------+-------------------------------------------------------lwage |
4360
1.649147
.5326094 -3.579079
4.05186
exper |
4360
6.514679
2.825873
0
18
union |
4360
.2440367
.4295639
0
1
married |
4360
.4389908
.4963208
0
1
hisp |
4360
.1559633
.3628622
0
1
-------------+-------------------------------------------------------black |
4360
.1155963
.3197769
0
1
educ |
4360
11.76697
1.746181
3
16
expersq |
4360
50.42477
40.78199
0
324

1. On vous propose une rgression des MCO pour les deux premires annes. Quel problme
est engendr lorsque lon utilise lon regroupe -pooled-des donnes de panel et quon les
estime par la mthodes des moindres carrs ordinaires ? Quelles solutions peuvent tre
envisages.
. reg lwage exper expersq year married black hisp if year<1982
Source |
SS
df
MS
-------------+-----------------------------Model | 11.7925648
6 1.96542747
Residual | 314.391356 1083 .290296728
-------------+-----------------------------Total | 326.183921 1089 .299526098

Number of obs
F( 6, 1083)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

1090
6.77
0.0000
0.0362
0.0308
.53879

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]

-------------+---------------------------------------------------------------exper |
.0965928
.0326945
2.95
0.003
.032441
.1607446
expersq |
-.009292
.0032182
-2.89
0.004
-.0156067
-.0029773
year |
.0729724
.0351822
2.07
0.038
.0039394
.1420053
married |
.1473654
.0397022
3.71
0.000
.0694633
.2252674
black | -.0556556
.0521995
-1.07
0.287
-.1580792
.046768
hisp | -.0475284
.046154
-1.03
0.303
-.1380898
.0430331
_cons | -143.2867
69.65456
-2.06
0.040
-279.9598
-6.613502
------------------------------------------------------------------------------

2. Soit une rgression par la mthode des moindres carrs ordinaires avec introduction de
variables indicatrices pour chaque individu -least squares dummy variable LSDV- pour
les deux premires annes. Comparez cette rgression avec la prcdente. Expliquez pourquoi black et hisp sont limins de la rgression. En quoi consiste le test du Fisher en bas
du tableau ?
. areg lwage exper expersq year married black hisp if year<1982, absorb(id)
Linear regression, absorbing indicators

Number of obs
F( 3,
542)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

1090
9.15
0.0000
0.7316
0.4606
.40194

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.2133325
.0575233
3.71
0.000
.1003365
.3263285
expersq | -.0135697
.0073653
-1.84
0.066
-.0280377
.0008982
year | (dropped)
married |
.0140556
.0709368
0.20
0.843
-.1252891
.1534004
black | (dropped)
hisp | (dropped)
_cons |
.9081648
.110831
8.19
0.000
.6904539
1.125876
-------------+---------------------------------------------------------------id |
F(544, 542) =
2.581
0.000
(545 categories)
. list id year id1 id2 lwage exper black hisp

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

+-------------------------------------------------------------+
|
id
year
id1
id2
lwage
exper
black
hisp |
|-------------------------------------------------------------|
|
13
1980
1
0
1.19754
1
0
0 |
|
13
1981
1
0
1.85306
2
0
0 |
|
13
1982
1
0
1.344462
3
0
0 |
|
13
1983
1
0
1.433213
4
0
0 |
|
13
1984
1
0
1.568125
5
0
0 |
|-------------------------------------------------------------|
|
13
1985
1
0
1.699891
6
0
0 |
|
13
1986
1
0
-.7202626
7
0
0 |
|
13
1987
1
0
1.669188
8
0
0 |
|
17
1980
0
1
1.675962
4
0
0 |
|
17
1981
0
1
1.518398
5
0
0 |
|-------------------------------------------------------------|
|
17
1982
0
1
1.559191
6
0
0 |

12.
13.
14.
15.

|
17
1983
0
1
1.72541
7
0
0 |
|
17
1984
0
1
1.622022
8
0
0 |
|
17
1985
0
1
1.608588
9
0
0 |
|
17
1986
0
1
1.572385
10
0
0 |
|-------------------------------------------------------------|
16. |
17
1987
0
1
1.820334
11
0
0 |

3. Soit la rgression par les effets fixes (la mthode within). Y a t-il une diffrence avec la
rgression prcdente ?
. xtreg lwage exper expersq year married black hisp if year<1982, fe i(id)
warning: existing panel variable is not id
Fixed-effects (within) regression
Group variable: id

Number of obs
Number of groups

=
=

1090
545

R-sq:

Obs per group: min =


avg =
max =

2
2.0
2

within = 0.0482
between = 0.0075
overall = 0.0127

corr(u_i, Xb)

F(3,542)
Prob > F

= -0.2177

=
=

9.15
0.0000

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.2133325
.0575233
3.71
0.000
.1003365
.3263285
expersq | -.0135697
.0073653
-1.84
0.066
-.0280377
.0008982
year | (dropped)
married |
.0140556
.0709368
0.20
0.843
-.1252891
.1534004
black | (dropped)
hisp | (dropped)
_cons |
.9081648
.110831
8.19
0.000
.6904539
1.125876
-------------+---------------------------------------------------------------sigma_u | .47563131
sigma_e | .40194096
rho | .58338275
(fraction of variance due to u_i)
-----------------------------------------------------------------------------F test that all u_i=0:
F(544, 542) =
2.58
Prob > F = 0.0000
xtset id year
panel variable:
time variable:
delta:
.
.
.
.
.
.
.

gen
gen
gen
gen
gen
gen
gen

id (strongly balanced)
year, 1980 to 1987
1 unit

dexp = d.exper
dexp2 = d.expersq
dyear = d.year
dmarr = d.married
dblack = d.black
dhisp = d.hisp
dlwage = d.lwage

. list id dlwage exper dexp dexp2 dyear dmarr dblack, nol noo nod
+-------------------------------------------------------------------+
|
id
dlwage
exper
dexp
dexp2
dyear
dmarr
dblack |

|-------------------------------------------------------------------|
|
13
.
1
.
.
.
.
. |
|
13
.6555198
2
1
3
1
0
0 |
|
13
-.5085983
3
1
5
1
0
0 |
|
13
.0887517
4
1
7
1
0
0 |
|
13
.1349118
5
1
9
1
0
0 |
|-------------------------------------------------------------------|
|
13
.1317658
6
1
11
1
0
0 |
|
13
-2.420154
7
1
13
1
0
0 |
|
13
2.389451
8
1
15
1
0
0 |
|
17
.
4
.
.
.
.
. |
|
17
-.1575643
5
1
9
1
0
0 |
|-------------------------------------------------------------------|
|
17
.0407923
6
1
11
1
0
0 |

. reg dlwage dexp dexp2 dyear dmarr dblack dhisp if year< 1982
Source |
SS
df
MS
-------------+-----------------------------Model | 1.10459105
2 .552295523
Residual | 175.127289
542 .323113079
-------------+-----------------------------Total |
176.23188
544 .323955662

Number of obs
F( 2,
542)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

545
1.71
0.1820
0.0063
0.0026
.56843

-----------------------------------------------------------------------------dlwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------dexp | (dropped)
dexp2 | -.0135697
.0073653
-1.84
0.066
-.0280377
.0008982
dyear | (dropped)
dmarr |
.0140556
.0709368
0.20
0.843
-.1252891
.1534004
dblack | (dropped)
dhisp | (dropped)
_cons |
.2133325
.0575233
3.71
0.000
.1003365
.3263285
-----------------------------------------------------------------------------. reg dlwage dexp dexp2 dyear dmarr dblack dhisp if year< 1983
Source |
SS
df
MS
-------------+-----------------------------Model | 1.85609505
2 .928047523
Residual |
287.68175 1087 .264656624
-------------+-----------------------------Total | 289.537845 1089 .265874973

Number of obs
F( 2, 1087)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

1090
3.51
0.0303
0.0064
0.0046
.51445

-----------------------------------------------------------------------------dlwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------dexp | (dropped)
dexp2 | -.0108202
.0045143
-2.40
0.017
-.0196779
-.0019625
dyear | (dropped)
dmarr |
.0490769
.0478281
1.03
0.305
-.0447689
.1429228
dblack | (dropped)
dhisp | (dropped)
_cons |
.1717418
.0398248
4.31
0.000
.0935996
.2498839

-----------------------------------------------------------------------------. xtreg lwage exper expersq year married black hisp if year<1983, fe i(id)
Fixed-effects (within) regression
Group variable: id

Number of obs
Number of groups

=
=

1635
545

R-sq:

Obs per group: min =


avg =
max =

3
3.0
3

within = 0.0622
between = 0.0011
overall = 0.0073

corr(u_i, Xb)

F(3,1087)
Prob > F

= -0.3164

=
=

24.05
0.0000

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper | (dropped)
expersq | -.0096686
.0033856
-2.86
0.004
-.0163116
-.0030256
year |
.1612026
.0298573
5.40
0.000
.1026182
.2197871
married |
.0640683
.0446676
1.43
0.152
-.0235763
.1517129
black | (dropped)
hisp | (dropped)
_cons | -317.6788
59.08473
-5.38
0.000
-433.6118
-201.7458
-------------+---------------------------------------------------------------sigma_u | .45922815
sigma_e | .37488352
rho | .60009562
(fraction of variance due to u_i)
-----------------------------------------------------------------------------F test that all u_i=0:
F(544, 1087) =
3.80
Prob > F = 0.0000
. reg lwage exper expersq year married black hisp if year<1983
Source |
SS
df
MS
-------------+-----------------------------Model | 22.6120652
6 3.76867753
Residual | 443.284137 1628 .272287553
-------------+-----------------------------Total | 465.896202 1634 .285126194

Number of obs
F( 6, 1628)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

1635
13.84
0.0000
0.0485
0.0450
.52181

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.0851297
.0262017
3.25
0.001
.0337371
.1365223
expersq | -.0080752
.0023391
-3.45
0.001
-.0126632
-.0034873
year |
.0548031
.0186986
2.93
0.003
.0181273
.0914789
married |
.1623551
.0299007
5.43
0.000
.1037072
.2210029
black | -.0867096
.04137
-2.10
0.036
-.1678536
-.0055657
hisp | -.0323874
.0364623
-0.89
0.375
-.1039053
.0391306
_cons | -107.2864
37.01138
-2.90
0.004
-179.8813
-34.69145
-----------------------------------------------------------------------------. predict resid if e(sample), resid
. gen resid1 =l.resid
. reg resid resid1 if e(sample)

Source |
SS
df
MS
-------------+-----------------------------Model |
73.883776
1
73.883776
Residual | 205.582489 1088 .188954494
-------------+-----------------------------Total | 279.466265 1089 .256626506

Number of obs
F( 1, 1088)
Prob > F
R-squared
Adj R-squared
Root MSE

=
=
=
=
=
=

1090
391.01
0.0000
0.2644
0.2637
.43469

-----------------------------------------------------------------------------resid |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------resid1 |
.4844822
.0245009
19.77
0.000
.4364079
.5325566
_cons |
.0016788
.0131666
0.13
0.899
-.024156
.0275136
------------------------------------------------------------------------------

4. En quoi consiste la rgression des panels effets alatoires. Quelle diffrence faites-vous
avec les effets fixes ?
. xtreg lwage exper expersq year married black hisp if year<1982, re
Random-effects GLS regression
Group variable: id

Number of obs
Number of groups

=
=

1090
545

R-sq:

Obs per group: min =


avg =
max =

2
2.0
2

within = 0.0442
between = 0.0327
overall = 0.0357

Random effects u_i ~ Gaussian


corr(u_i, X)
= 0 (assumed)

Wald chi2(6)
Prob > chi2

=
=

43.04
0.0000

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.1051732
.0366117
2.87
0.004
.0334156
.1769308
expersq | -.0100233
.0035787
-2.80
0.005
-.0170374
-.0030093
year |
.0725566
.0287777
2.52
0.012
.0161535
.1289598
married |
.1179335
.042232
2.79
0.005
.0351603
.2007067
black | -.0597944
.0627198
-0.95
0.340
-.1827229
.0631342
hisp | -.0458667
.0554806
-0.83
0.408
-.1546067
.0628732
_cons |
-142.475
56.95574
-2.50
0.012
-254.1062
-30.84384
-------------+---------------------------------------------------------------sigma_u | .35906291
sigma_e | .40194096
rho | .44383424
(fraction of variance due to u_i)
------------------------------------------------------------------------------

5. On vous propose un test de Hausman pour la rgression sur les deux premires annes.
Analysez le rsultat ?
. quietly xtreg lwage exper expersq year married black hisp if year<1982, fe
. est store fixed
. quietly xtreg lwage exper expersq year married black hisp if year<1982, re
. hausman fixed
---- Coefficients ----

|
(b)
(B)
(b-B)
sqrt(diag(V_b-V_B))
|
fixed
.
Difference
S.E.
-------------+---------------------------------------------------------------exper |
.2133325
.1051732
.1081593
.044368
expersq |
-.0135697
-.0100233
-.0035464
.0064374
married |
.0140556
.1179335
-.1038778
.0569955
-----------------------------------------------------------------------------b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test:

Ho:

difference in coefficients not systematic


chi2(3) = (b-B)[(V_b-V_B)^(-1)](b-B)
=
19.93
Prob>chi2 =
0.0002

6. En quoi consiste le test de Breusch et Pagan dans le cas des donnes de panel ?
. quietly xtreg lwage exper expersq year married black hisp if year<1982, re
. xttest0
Breusch and Pagan Lagrangian multiplier test for random effects
lwage[id,t] = Xb + u[id] + e[id,t]
Estimated results:
|
Var
sd = sqrt(Var)
---------+----------------------------lwage |
.2995261
.5472898
e |
.1615565
.401941
u |
.1289262
.3590629
Test:

Var(u) = 0
chi2(1) =
Prob > chi2 =

105.00
0.0000

7. Que se passe-t-il pour les coefficients lorsque les priodes de temps augmentent ?
. xtreg lwage exper expersq year married black hisp, fe
Fixed-effects (within) regression
Group variable: id

Number of obs
Number of groups

=
=

4360
545

R-sq:

Obs per group: min =


avg =
max =

8
8.0
8

within = 0.1741
between = 0.0014
overall = 0.0534

corr(u_i, Xb)

F(3,3812)
Prob > F

= -0.1289

=
=

267.93
0.0000

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
t
P>|t|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.1169371
.0084385
13.86
0.000
.1003926
.1334815
expersq | -.0043329
.0006066
-7.14
0.000
-.0055222
-.0031436
year | (dropped)
married |
.0473384
.0183445
2.58
0.010
.0113725
.0833043

black | (dropped)
hisp | (dropped)
_cons |
1.085044
.026295
41.26
0.000
1.033491
1.136598
-------------+---------------------------------------------------------------sigma_u | .40387668
sigma_e | .35204264
rho | .56824996
(fraction of variance due to u_i)
-----------------------------------------------------------------------------F test that all u_i=0:
F(544, 3812) =
9.33
Prob > F = 0.0000
. xtreg lwage exper expersq year married black hisp, re
Random-effects GLS regression
Group variable: id

Number of obs
Number of groups

=
=

4360
545

R-sq:

Obs per group: min =


avg =
max =

8
8.0
8

within = 0.1738
between = 0.0482
overall = 0.1054

Random effects u_i ~ Gaussian


corr(u_i, X)
= 0 (assumed)

Wald chi2(6)
Prob > chi2

=
=

827.17
0.0000

-----------------------------------------------------------------------------lwage |
Coef.
Std. Err.
z
P>|z|
[95% Conf. Interval]
-------------+---------------------------------------------------------------exper |
.0439292
.0137259
3.20
0.001
.017027
.0708315
expersq | -.0042308
.0005974
-7.08
0.000
-.0054017
-.0030599
year |
.0703197
.0103635
6.79
0.000
.0500075
.0906319
married |
.0699282
.0169834
4.12
0.000
.0366413
.1032152
black | -.1293855
.0520067
-2.49
0.013
-.2313167
-.0274542
hisp | -.0333494
.0459016
-0.73
0.468
-.123315
.0566161
_cons | -137.9134
20.49045
-6.73
0.000
-178.074
-97.75286
-------------+---------------------------------------------------------------sigma_u | .35927864
sigma_e | .35204264
rho | .51017158
(fraction of variance due to u_i)
------------------------------------------------------------------------------