Sie sind auf Seite 1von 15

. * wagepan.

dta mit (simulierter) personenspezifischer


Fehlerkomponente a
. use \hja\lehre\daten\wooldridge\stata\wagepan, clear
.
. tsset nr year, yearly
panel variable: nr, 13 to 12548
time variable: year, 1980 to 1987

. xtdes

nr: 13, 17, ..., 12548 n = 545


year: 1980, 1981, ..., 1987 T = 8
Delta(year) = 1; (1987-1980)+1 = 8
(nr*year uniquely identifies each observation)

Distribution of T_i: min 5% 25% 50% 75% 95% max


8 8 8 8 8 8 8

Freq. Percent Cum. | Pattern


---------------------------+----------
545 100.00 100.00 | 11111111
---------------------------+----------
545 100.00 | XXXXXXXX

Wir schauen kurz in die Daten hinein. Die Variable a habe ich mir „ausgedacht“ und hinzugefügt (wie,
soll hier nicht interessieren). Die Werte an sich sind egal, entscheidend ist, dass sie für alle Panelwellen
einer Person identisch sind. Die Variable a ist ein Beispiel für eine unbeobachtete Variable, die man
normalerweise nicht kennt. Hier tue ich so, wie wenn man sie kennen würde, um zu illustrieren, wie die
verschiedenen Schätzverfahren diese unbeobachtete Heterogenität kontrollieren.
.
. list nr year lwage educ union a in 1/32, separator(8)

+-------------------------------------------------+
| nr year lwage educ union a |
|-------------------------------------------------|
1. | 13 1980 1.19754 14 0 278 |
2. | 13 1981 1.85306 14 1 278 |
3. | 13 1982 1.344462 14 0 278 |
4. | 13 1983 1.433213 14 0 278 |
5. | 13 1984 1.568125 14 0 278 |
6. | 13 1985 1.699891 14 0 278 |
7. | 13 1986 -.7202626 14 0 278 |
8. | 13 1987 1.669188 14 0 278 |
|-------------------------------------------------|
9. | 17 1980 1.675962 13 0 225.1662 |
10. | 17 1981 1.518398 13 0 225.1662 |
11. | 17 1982 1.559191 13 0 225.1662 |
12. | 17 1983 1.72541 13 0 225.1662 |
13. | 17 1984 1.622022 13 0 225.1662 |
14. | 17 1985 1.608588 13 0 225.1662 |
15. | 17 1986 1.572385 13 0 225.1662 |
16. | 17 1987 1.820334 13 0 225.1662 |
|-------------------------------------------------|
17. | 18 1980 1.515963 12 0 148.9092 |
18. | 18 1981 1.735379 12 0 148.9092 |
19. | 18 1982 1.631744 12 0 148.9092 |
20. | 18 1983 1.998229 12 0 148.9092 |
21. | 18 1984 2.184014 12 0 148.9092 |
22. | 18 1985 2.266662 12 0 148.9092 |
23. | 18 1986 2.069944 12 0 148.9092 |

24. | 18 1987 2.873161 12 0 148.9092 |


|-------------------------------------------------|
25. | 45 1980 1.894115 12 1 835.8283 |

1
26. | 45 1981 1.471159 12 1 835.8283 |
27. | 45 1982 1.473498 12 0 835.8283 |
28. | 45 1983 1.740914 12 0 835.8283 |
29. | 45 1984 1.823214 12 0 835.8283 |
30. | 45 1985 1.908273 12 0 835.8283 |
31. | 45 1986 1.742447 12 0 835.8283 |
32. | 45 1987 2.135689 12 0 835.8283 |
+-------------------------------------------------+

. * Differenced data and FD estimator


. gen dlwage = D.lwage
(545 missing values generated)

. gen deduc = D.educ

(545 missing values generated)

. gen dunion = D.union


(545 missing values generated)

. gen da = D.a
(545 missing values generated)

. list lwage dlwage educ deduc union dunion a da in 1/32, separator(8)

+-----------------------------------------------------------------------+
| lwage dlwage educ deduc union dunion a da |
|-----------------------------------------------------------------------|
1. | 1.19754 . 14 . 0 . 278 . |
2. | 1.85306 .6555198 14 0 1 1 278 0 |
3. | 1.344462 -.5085983 14 0 0 -1 278 0 |
4. | 1.433213 .0887517 14 0 0 0 278 0 |
5. | 1.568125 .1349118 14 0 0 0 278 0 |
6. | 1.699891 .1317658 14 0 0 0 278 0 |
7. | -.7202626 -2.420154 14 0 0 0 278 0 |
8. | 1.669188 2.389451 14 0 0 0 278 0 |
|-----------------------------------------------------------------------|
9. | 1.675962 . 13 . 0 . 225.1662 . |
10. | 1.518398 -.1575643 13 0 0 0 225.1662 0 |
11. | 1.559191 .0407923 13 0 0 0 225.1662 0 |
12. | 1.72541 .1662196 13 0 0 0 225.1662 0 |
13. | 1.622022 -.1033878 13 0 0 0 225.1662 0 |
14. | 1.608588 -.0134341 13 0 0 0 225.1662 0 |
15. | 1.572385 -.0362028 13 0 0 0 225.1662 0 |
16. | 1.820334 .2479484 13 0 0 0 225.1662 0 |
|-----------------------------------------------------------------------|
17. | 1.515963 . 12 . 0 . 148.9092 . |
18. | 1.735379 .2194164 12 0 0 0 148.9092 0 |
19. | 1.631744 -.1036354 12 0 0 0 148.9092 0 |
20. | 1.998229 .3664851 12 0 0 0 148.9092 0 |
21. | 2.184014 .1857855 12 0 0 0 148.9092 0 |
22. | 2.266662 .0826478 12 0 0 0 148.9092 0 |
23. | 2.069944 -.1967182 12 0 0 0 148.9092 0 |
24. | 2.873161 .8032169 12 0 0 0 148.9092 0 |
|-----------------------------------------------------------------------|
25. | 1.894115 . 12 . 1 . 835.8283 . |
26. | 1.471159 -.4229556 12 0 1 0 835.8283 0 |
27. | 1.473498 .0023382 12 0 0 -1 835.8283 0 |
28. | 1.740914 .2674167 12 0 0 0 835.8283 0 |
29. | 1.823214 .0822995 12 0 0 0 835.8283 0 |
30. | 1.908273 .0850592 12 0 0 0 835.8283 0 |
31. | 1.742447 -.1658255 12 0 0 0 835.8283 0 |
32. | 2.135689 .3932416 12 0 0 0 835.8283 0 |
+-----------------------------------------------------------------------+

2
. reg dlwage deduc dunion, noconstant

Source | SS df MS Number of obs = 3815


-------------+------------------------------ F( 1, 3814) = 4.74
Model | .954299646 1 .954299646 Prob > F = 0.0295
Residual | 767.658701 3814 .201273912 R-squared = 0.0012
-------------+------------------------------ Adj R-squared = 0.0010
Total | 768.613001 3815 .201471298 Root MSE = .44864

------------------------------------------------------------------------------
dlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
deduc | (dropped)
dunion | .0433422 .019905 2.18 0.030 .0043167 .0823676
------------------------------------------------------------------------------

. * Time-demeaned data and FE estimator


Dem Datensatz habe ich auch die Mittelwerte der drei Variablen lwage, educ und union hinzugefügt (wie,
soll hier nicht interessieren). Sie heißen mlwage, meduc und munion.
. gen tlwage = lwage - mlwage

. gen teduc = educ - meduc

. gen tunion = union - munion

. set linesize 100

. list lwage mlwage tlwage educ meduc teduc union munion tunion in 1/32, separator(8)

+-----------------------------------------------------------------------------------+
| lwage mlwage tlwage educ meduc teduc union munion tunion |
|-----------------------------------------------------------------------------------|
1. | 1.19754 1.255652 -.0581119 14 14 0 0 .125 -.125 |
2. | 1.85306 1.255652 .5974079 14 14 0 1 .125 .875 |
3. | 1.344462 1.255652 .0888096 14 14 0 0 .125 -.125 |
4. | 1.433213 1.255652 .1775613 14 14 0 0 .125 -.125 |
5. | 1.568125 1.255652 .3124731 14 14 0 0 .125 -.125 |
6. | 1.699891 1.255652 .4442389 14 14 0 0 .125 -.125 |
7. | -.7202626 1.255652 -1.975915 14 14 0 0 .125 -.125 |
8. | 1.669188 1.255652 .4135358 14 14 0 0 .125 -.125 |
|-----------------------------------------------------------------------------------|
9. | 1.675962 1.637786 .0381761 13 13 0 0 0 0 |
10. | 1.518398 1.637786 -.1193882 13 13 0 0 0 0 |
11. | 1.559191 1.637786 -.0785959 13 13 0 0 0 0 |
12. | 1.72541 1.637786 .0876237 13 13 0 0 0 0 |
13. | 1.622022 1.637786 -.0157641 13 13 0 0 0 0 |
14. | 1.608588 1.637786 -.0291982 13 13 0 0 0 0 |
15. | 1.572385 1.637786 -.065401 13 13 0 0 0 0 |
16. | 1.820334 1.637786 .1825475 13 13 0 0 0 0 |
|-----------------------------------------------------------------------------------|
17. | 1.515963 2.034387 -.5184242 12 12 0 0 0 0 |
18. | 1.735379 2.034387 -.2990078 12 12 0 0 0 0 |
19. | 1.631744 2.034387 -.4026432 12 12 0 0 0 0 |
20. | 1.998229 2.034387 -.0361581 12 12 0 0 0 0 |
21. | 2.184014 2.034387 .1496274 12 12 0 0 0 0 |
22. | 2.266662 2.034387 .2322752 12 12 0 0 0 0 |
23. | 2.069944 2.034387 .035557 12 12 0 0 0 0 |
24. | 2.873161 2.034387 .838774 12 12 0 0 0 0 |
|-----------------------------------------------------------------------------------|
25. | 1.894115 1.773664 .1204513 12 12 0 1 .25 .75 |
26. | 1.471159 1.773664 -.3025043 12 12 0 1 .25 .75 |
27. | 1.473498 1.773664 -.3001661 12 12 0 0 .25 -.25 |
28. | 1.740914 1.773664 -.0327494 12 12 0 0 .25 -.25 |
29. | 1.823214 1.773664 .0495501 12 12 0 0 .25 -.25 |
30. | 1.908273 1.773664 .1346092 12 12 0 0 .25 -.25 |

3
31. | 1.742447 1.773664 -.0312163 12 12 0 0 .25 -.25 |
32. | 2.135689 1.773664 .3620254 12 12 0 0 .25 -.25 |
+-----------------------------------------------------------------------------------+

.
. reg tlwage teduc tunion, noconstant

Source | SS df MS Number of obs = 4360


-------------+------------------------------ F( 1, 4359) = 14.16
Model | 1.85182574 1 1.85182574 Prob > F = 0.0002
Residual | 570.201249 4359 .130810105 R-squared = 0.0032
-------------+------------------------------ Adj R-squared = 0.0030
Total | 572.053075 4360 .131204834 Root MSE = .36168

------------------------------------------------------------------------------
tlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
teduc | (dropped)
tunion | .0746846 .0198496 3.76 0.000 .0357693 .1135999
------------------------------------------------------------------------------

Zur Interpretation des folgenden FE-Outputs muß man folgende von der Notation der Vorlesung
abweichende Namensgebung berücksichtigen:
ai u_i
σa sigma_u
σν sigma_e
. xtreg lwage educ union, fe

Fixed-effects (within) regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.0032 Obs per group: min = 8


between = 0.0454 avg = 8.0
overall = 0.0209 max = 8

F(1,3814) = 12.39
corr(u_i, Xb) = 0.1164 Prob > F = 0.0004

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | (dropped)
union | .0746846 .0212205 3.52 0.000 .0330801 .1162891
_cons | 1.630921 .0078171 208.64 0.000 1.615595 1.646248
-------------+----------------------------------------------------------------
sigma_u | .38625193
sigma_e | .3866551
rho | .49947837 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(544, 3814) = 6.90 Prob > F = 0.0000

. predict ahat, u

. predict yhat, xb

. corr ahat yhat


(obs=4360)

| ahat yhat
-------------+------------------
ahat | 1.0000
yhat | 0.1164 1.0000

4
. areg lwage educ union, absorb(nr)

Number of obs = 4360


F( 1, 3814) = 12.39
Prob > F = 0.0004
R-squared = 0.5389
Adj R-squared = 0.4730
Root MSE = .38666

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | (dropped)
union | .0746846 .0212205 3.52 0.000 .0330801 .1162891
_cons | 1.630921 .0078171 208.64 0.000 1.615595 1.646248
-------------+----------------------------------------------------------------
nr | F(544, 3814) = 6.902 0.000 (545 categories)

. * RE estimator and quasi-demeaned data


Zur Interpretation des folgenden RE-Outputs muß man folgende von der Notation der Vorlesung
abweichende Namensgebung berücksichtigen:
theta λ = 1 − σ v2 (σ v2 + Tσ a2 )
rho Corr(u it , u is ) = σ a2 ( σ a2 + σ v2 ), t ≠ s

. xtreg lwage educ union, re theta

Random-effects GLS regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.0032 Obs per group: min = 8


between = 0.1499 avg = 8.0
overall = 0.0816 max = 8

Random effects u_i ~ Gaussian Wald chi2(2) = 106.56


corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
theta = .61786677

------------------------------------------------------------------------------
lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .0770636 .0087883 8.77 0.000 .0598389 .0942883
union | .1058814 .019335 5.48 0.000 .0679856 .1437773
_cons | .7165027 .1046656 6.85 0.000 .511362 .9216435
-------------+----------------------------------------------------------------
sigma_u | .33058741
sigma_e | .3866551
rho | .42230361 (fraction of variance due to u_i)
------------------------------------------------------------------------------

. display .33058741^2 / (.33058741^2 + .3866551^2)


.42230361

. display e(rho)
.42230361

. display 1 - sqrt(.3866551^2/(.3866551^2 + 8*.33058741^2))


.61786676

. display e(theta)
.61786677

5
. gen rlwage = lwage - e(theta)*mlwage

. gen reduc = educ - e(theta)*meduc

. gen runion = union - e(theta)*munion

. gen rconst = 1 - e(theta)

. set linesize 100

. list lwage rlwage educ reduc union runion rconst in 1/32, separator(8) compress

+------------------------------------------------------------------------+
| lwage rlwage educ reduc union runion rconst |
|------------------------------------------------------------------------|
1. | 1.19754 .4217145 14 5.349865 0 -.0772333 .3821332 |
2. | 1.85306 1.077234 14 5.349865 1 .9227666 .3821332 |
3. | 1.344462 .568636 14 5.349865 0 -.0772333 .3821332 |
4. | 1.433213 .6573877 14 5.349865 0 -.0772333 .3821332 |
5. | 1.568125 .7922994 14 5.349865 0 -.0772333 .3821332 |
6. | 1.699891 .9240653 14 5.349865 0 -.0772333 .3821332 |
7. | -.7202626 -1.496088 14 5.349865 0 -.0772333 .3821332 |
8. | 1.669188 .8933622 14 5.349865 0 -.0772333 .3821332 |
|------------------------------------------------------------------------|
9. | 1.675962 .6640286 13 4.967732 0 0 .3821332 |
10. | 1.518398 .5064644 13 4.967732 0 0 .3821332 |
11. | 1.559191 .5472567 13 4.967732 0 0 .3821332 |
12. | 1.72541 .7134763 13 4.967732 0 0 .3821332 |
13. | 1.622022 .6100885 13 4.967732 0 0 .3821332 |
14. | 1.608588 .5966544 13 4.967732 0 0 .3821332 |
15. | 1.572385 .5604516 13 4.967732 0 0 .3821332 |
16. | 1.820334 .8084 13 4.967732 0 0 .3821332 |
|------------------------------------------------------------------------|
17. | 1.515963 .2589827 12 4.585599 0 0 .3821332 |
18. | 1.735379 .4783991 12 4.585599 0 0 .3821332 |
19. | 1.631744 .3747636 12 4.585599 0 0 .3821332 |
20. | 1.998229 .7412487 12 4.585599 0 0 .3821332 |
21. | 2.184014 .9270343 12 4.585599 0 0 .3821332 |
22. | 2.266662 1.009682 12 4.585599 0 0 .3821332 |
23. | 2.069944 .8129638 12 4.585599 0 0 .3821332 |
24. | 2.873161 1.616181 12 4.585599 0 0 .3821332 |
|------------------------------------------------------------------------|
25. | 1.894115 .7982271 12 4.585599 1 .8455333 .3821332 |
26. | 1.471159 .3752715 12 4.585599 1 .8455333 .3821332 |
27. | 1.473498 .3776097 12 4.585599 0 -.1544667 .3821332 |
28. | 1.740914 .6450264 12 4.585599 0 -.1544667 .3821332 |
29. | 1.823214 .7273259 12 4.585599 0 -.1544667 .3821332 |
30. | 1.908273 .812385 12 4.585599 0 -.1544667 .3821332 |
31. | 1.742447 .6465595 12 4.585599 0 -.1544667 .3821332 |
32. | 2.135689 1.039801 12 4.585599 0 -.1544667 .3821332 |
+------------------------------------------------------------------------+

. reg rlwage reduc runion rconst, noconstant

Source | SS df MS Number of obs = 4360


-------------+------------------------------ F( 3, 4357) = 3886.00
Model | 1747.52354 3 582.507846 Prob > F = 0.0000
Residual | 653.109921 4357 .149898995 R-squared = 0.7279
-------------+------------------------------ Adj R-squared = 0.7278
Total | 2400.63346 4360 .550604004 Root MSE = .38717

------------------------------------------------------------------------------
rlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
reduc | .0770636 .0087883 8.77 0.000 .0598341 .0942931
runion | .1058814 .019335 5.48 0.000 .0679751 .1437878
rconst | .7165026 .1046656 6.85 0.000 .5113048 .9217004
------------------------------------------------------------------------------

6
. * Regressionskonstante bei areg (und aehnlich FE)
. areg lwage educ union, absorb(nr)

Number of obs = 4360


F( 1, 3814) = 12.39
Prob > F = 0.0004
R-squared = 0.5389
Adj R-squared = 0.4730
Root MSE = .38666

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | (dropped)
union | .0746846 .0212205 3.52 0.000 .0330801 .1162891
_cons | 1.630921 .0078171 208.64 0.000 1.615595 1.646248
-------------+----------------------------------------------------------------
nr | F(544, 3814) = 6.902 0.000 (545 categories)

. predict d_i, d

. gen a_i = _b[_cons] + d_i

. * a_i = Personenkomponente (Auswertung daher nur fuer jeweils eine


. * der t=8 Panelwellen (z.B. fuer t=1980

. summ a_i if year==1980

Variable | Obs Mean Std. Dev. Min Max


-------------+--------------------------------------------------------
a_i | 545 1.630921 .3862519 .3333436 3.174173

. histogram a_i if year==1980, xline(1.630921)


(bin=23, start=.33334357, width=.12351433)
1
.8
Density
.6
.4
.2
0

0 1 2 3
a_i

7
. * Berechnung von "R-Quadrat"
. xtreg lwage educ union, fe

Fixed-effects (within) regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.0032 Obs per group: min = 8


between = 0.0454 avg = 8.0
overall = 0.0209 max = 8

F(1,3814) = 12.39
corr(u_i, Xb) = 0.1164 Prob > F = 0.0004

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | (dropped)
union | .0746846 .0212205 3.52 0.000 .0330801 .1162891
_cons | 1.630921 .0078171 208.64 0.000 1.615595 1.646248
-------------+----------------------------------------------------------------
sigma_u | .38625193
sigma_e | .3866551
rho | .49947837 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(544, 3814) = 6.90 Prob > F = 0.0000

.
. gen mu1 = _b[_cons] + _b[union]*union

. gen mu2 = _b[_cons] + _b[union]*munion

. gen mu3 = _b[union]*tunion

.
. quietly reg lwage mu1

. estimates store overall

. quietly reg mlwage mu2

. estimates store between

. quietly reg tlwage mu3

. estimates store within

.
. estimates table within between overall, stats(r2)

-----------------------------------------------------
Variable | within between overall
-------------+---------------------------------------
mu3 | 1
mu2 | 3.3845058
mu1 | 2.4002825
_cons | 1.560e-09 -3.932401 -2.3092719
-------------+---------------------------------------
r2 | .00323716 .04541849 .02090378
-----------------------------------------------------

. drop mu1-mu3

8
. xtreg lwage educ union, re

Random-effects GLS regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.0032 Obs per group: min = 8


between = 0.1499 avg = 8.0
overall = 0.0816 max = 8

Random effects u_i ~ Gaussian Wald chi2(2) = 106.56


corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

------------------------------------------------------------------------------
lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .0770636 .0087883 8.77 0.000 .0598389 .0942883
union | .1058814 .019335 5.48 0.000 .0679856 .1437773
_cons | .7165027 .1046656 6.85 0.000 .511362 .9216435
-------------+----------------------------------------------------------------
sigma_u | .33058741
sigma_e | .3866551
rho | .42230361 (fraction of variance due to u_i)
------------------------------------------------------------------------------

.
. gen mu1 = _b[_cons] + _b[educ]* educ + _b[union]* union

. gen mu2 = _b[_cons] + _b[educ]*meduc + _b[union]*munion

. gen mu3 = _b[union]*tunion

.
. quietly reg lwage mu1

. estimates store overall

. quietly reg mlwage mu2

. estimates store between

. quietly reg tlwage mu3

. estimates store within

.
. estimates table within between overall, stats(r2)

-----------------------------------------------------
Variable | within between overall
-------------+---------------------------------------
mu3 | .70536067
mu2 | 1.0895087
mu1 | 1.0731914
_cons | 1.580e-09 -.14761307 -.12070336
-------------+---------------------------------------
r2 | .00323716 .1498838 .08161566
-----------------------------------------------------

. drop mu1-mu3

9
. * Beispiel wagepan.dta: pooled OLS, fixed, random and
differenced effects
. use \hja\lehre\daten\wooldridge\stata\wagepan, clear

. tsset nr year, yearly


panel variable: nr, 13 to 12548
time variable: year, 1980 to 1987

.
. reg lwage d81 d82 d83 d84 d85 d86 d87 educ black hisp exper expersq married union

Source | SS df MS Number of obs = 4360


-------------+------------------------------ F( 14, 4345) = 72.46
Model | 234.048277 14 16.7177341 Prob > F = 0.0000
Residual | 1002.48136 4345 .230720682 R-squared = 0.1893
-------------+------------------------------ Adj R-squared = 0.1867
Total | 1236.52964 4359 .283672779 Root MSE = .48033

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
d81 | .05832 .0303536 1.92 0.055 -.0011886 .1178286
d82 | .0627744 .0332141 1.89 0.059 -.0023421 .1278909
d83 | .0620117 .0366601 1.69 0.091 -.0098608 .1338843
d84 | .0904672 .0400907 2.26 0.024 .011869 .1690654
d85 | .1092463 .0433525 2.52 0.012 .0242533 .1942393
d86 | .1419596 .046423 3.06 0.002 .0509469 .2329723
d87 | .1738334 .049433 3.52 0.000 .0769194 .2707474
educ | .0913498 .0052374 17.44 0.000 .0810819 .1016177
black | -.1392342 .0235796 -5.90 0.000 -.1854622 -.0930062
hisp | .0160195 .0207971 0.77 0.441 -.0247535 .0567925
exper | .0672345 .0136948 4.91 0.000 .0403856 .0940834
expersq | -.0024117 .00082 -2.94 0.003 -.0040192 -.0008042
married | .1082529 .0156894 6.90 0.000 .0774937 .1390122
union | .1824613 .0171568 10.63 0.000 .1488253 .2160973
_cons | .0920558 .0782701 1.18 0.240 -.0613935 .2455051
------------------------------------------------------------------------------

. estimates store pooled

. xtreg lwage d81 d82 d83 d84 d85 d86 d87 educ black hisp exper expersq married union, re
theta

Random-effects GLS regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.1799 Obs per group: min = 8


between = 0.1860 avg = 8.0
overall = 0.1830 max = 8

Random effects u_i ~ Gaussian Wald chi2(14) = 957.77


corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
theta = .64291089

------------------------------------------------------------------------------
lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
d81 | .040462 .0246946 1.64 0.101 -.0079385 .0888626
d82 | .0309212 .0323416 0.96 0.339 -.0324672 .0943096
d83 | .0202806 .041582 0.49 0.626 -.0612186 .1017798
d84 | .0431187 .0513163 0.84 0.401 -.0574595 .1436969
d85 | .0578155 .0612323 0.94 0.345 -.0621977 .1778286
d86 | .0919476 .0712293 1.29 0.197 -.0476592 .2315544
d87 | .1349289 .0813135 1.66 0.097 -.0244427 .2943005
educ | .0918763 .0106597 8.62 0.000 .0709836 .1127689
black | -.1393767 .0477228 -2.92 0.003 -.2329117 -.0458417

10
hisp | .0217317 .0426063 0.51 0.610 -.0617751 .1052385
exper | .1057545 .0153668 6.88 0.000 .0756361 .1358729
expersq | -.0047239 .0006895 -6.85 0.000 -.0060753 -.0033726
married | .063986 .0167742 3.81 0.000 .0311091 .0968629
union | .1061344 .0178539 5.94 0.000 .0711415 .1411273
_cons | .0235864 .1506683 0.16 0.876 -.271718 .3188907
-------------+----------------------------------------------------------------
sigma_u | .32460315
sigma_e | .35099001
rho | .46100216 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. estimates store random

. display e(sigma_u)^2/(e(sigma_u)^2 + e(sigma_e)^2)


.46100216
. display 1 - sqrt(e(sigma_e)^2/(e(Tbar)*e(sigma_u)^2 + e(sigma_e)^2))
.64291089

. xttest0

Breusch and Pagan Lagrangian multiplier test for random effects:

lwage[nr,t] = Xb + u[nr] + e[nr,t]

Estimated results:
| Var sd = sqrt(Var)
---------+-----------------------------
lwage | .2836728 .5326094
e | .123194 .35099
u | .1053672 .3246031

Test: Var(u) = 0
chi2(1) = 3203.64
Prob > chi2 = 0.0000

. xtreg lwage d81 d82 d83 d84 d85 d86 d87 educ black hisp expersq married union, fe

Fixed-effects (within) regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.1806 Obs per group: min = 8


between = 0.0286 avg = 8.0
overall = 0.0888 max = 8

F(10,3805) = 83.85
corr(u_i, Xb) = -0.1222 Prob > F = 0.0000

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
d81 | .1511912 .0219489 6.89 0.000 .1081584 .194224
d82 | .2529709 .0244185 10.36 0.000 .2050963 .3008454
d83 | .3544437 .0292419 12.12 0.000 .2971125 .4117749
d84 | .4901148 .0362266 13.53 0.000 .4190894 .5611402
d85 | .6174823 .0452435 13.65 0.000 .5287784 .7061861
d86 | .7654966 .0561277 13.64 0.000 .6554532 .8755399
d87 | .9250249 .0687731 13.45 0.000 .7901893 1.059861
educ | (dropped)
black | (dropped)
hisp | (dropped)
expersq | -.0051855 .0007044 -7.36 0.000 -.0065666 -.0038044
married | .0466804 .0183104 2.55 0.011 .0107811 .0825796
union | .0800019 .0193103 4.14 0.000 .0421423 .1178614
_cons | 1.426019 .0183415 77.75 0.000 1.390058 1.461979
-------------+----------------------------------------------------------------
sigma_u | .39176195
sigma_e | .35099001
rho | .55472817 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(544, 3805) = 8.05 Prob > F = 0.0000

11
. estimates store fixed

. hausman fixed random

---- Coefficients ----


| (b) (B) (b-B) sqrt(diag(V_b-V_B))
| fixed random Difference S.E.
-------------+----------------------------------------------------------------
d81 | .1511912 .040462 .1107292 .
d82 | .2529709 .0309212 .2220497 .
d83 | .3544437 .0202806 .3341631 .
d84 | .4901148 .0431187 .4469961 .
d85 | .6174823 .0578155 .5596668 .
d86 | .7654966 .0919476 .673549 .
d87 | .9250249 .1349289 .790096 .
expersq | -.0051855 -.0047239 -.0004616 .0001443
married | .0466804 .063986 -.0173057 .0073414
union | .0800019 .1061344 -.0261326 .0073572
------------------------------------------------------------------------------
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(10) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 26.36
Prob>chi2 = 0.0033
(V_b-V_B is not positive definite)

.
. xtreg lwage d81 d82 d83 d84 d85 d86 d87 educ black hisp exper expersq married union, fe

Fixed-effects (within) regression Number of obs = 4360


Group variable (i): nr Number of groups = 545

R-sq: within = 0.1806 Obs per group: min = 8


between = 0.0005 avg = 8.0
overall = 0.0635 max = 8

F(10,3805) = 83.85
corr(u_i, Xb) = -0.1212 Prob > F = 0.0000

------------------------------------------------------------------------------
lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
d81 | .0190448 .0203626 0.94 0.350 -.0208779 .0589674
d82 | -.011322 .0202275 -0.56 0.576 -.0509798 .0283359
d83 | -.0419955 .0203205 -2.07 0.039 -.0818357 -.0021553
d84 | -.0384709 .0203144 -1.89 0.058 -.0782991 .0013573
d85 | -.0432498 .0202458 -2.14 0.033 -.0829434 -.0035562
d86 | -.0273819 .0203863 -1.34 0.179 -.0673511 .0125872
d87 | (dropped)
educ | (dropped)
black | (dropped)
hisp | (dropped)
exper | .1321464 .0098247 13.45 0.000 .1128842 .1514087
expersq | -.0051855 .0007044 -7.36 0.000 -.0065666 -.0038044
married | .0466804 .0183104 2.55 0.011 .0107811 .0825796
union | .0800019 .0193103 4.14 0.000 .0421423 .1178614
_cons | 1.02764 .0299499 34.31 0.000 .9689201 1.086359
-------------+----------------------------------------------------------------
sigma_u | .4009279
sigma_e | .35099001
rho | .56612236 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(544, 3805) = 7.96 Prob > F = 0.0000

12
. gen dlwage = d.lwage
(545 missing values generated)

. gen dd81 = d.d81


(545 missing values generated)

. gen dd82 = d.d82


(545 missing values generated)

. gen dd83 = d.d83


(545 missing values generated)

. gen dd84 = d.d84


(545 missing values generated)

. gen dd85 = d.d85


(545 missing values generated)

. gen dd86 = d.d86


(545 missing values generated)

. gen dd87 = d.d87


(545 missing values generated)

. gen kexpersq = expersq

. gen kmarried = married

. gen kunion = union

. replace expersq = d.kexpersq


(4358 real changes made, 545 to missing)

. replace married = d.kmarried


(2124 real changes made, 545 to missing)

. replace union = d.kunion


(1466 real changes made, 545 to missing)

.
. reg dlwage dd81 dd82 dd83 dd84 dd85 dd86 dd87 exper expersq married union, noconstant

Source | SS df MS Number of obs = 3815


-------------+------------------------------ F( 10, 3805) = 11.34
Model | 22.2437688 10 2.22437688 Prob > F = 0.0000
Residual | 746.369232 3805 .196154857 R-squared = 0.0289
-------------+------------------------------ Adj R-squared = 0.0264
Total | 768.613001 3815 .201471298 Root MSE = .44289

------------------------------------------------------------------------------
dlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dd81 | .0158512 .0218647 0.72 0.469 -.0270165 .058719
dd82 | -.0164964 .0313778 -0.53 0.599 -.0780154 .0450226
dd83 | -.0485531 .0359882 -1.35 0.177 -.1191112 .022005
dd84 | -.0449451 .0359831 -1.25 0.212 -.1154932 .025603
dd85 | -.0498952 .0313926 -1.59 0.112 -.1114432 .0116527
dd86 | -.032537 .021889 -1.49 0.137 -.0754523 .0103784
dd87 | (dropped)
exper | .280293 .0585061 4.79 0.000 .1655867 .3949992
expersq | -.1459011 .031359 -4.65 0.000 -.2073831 -.0844191
married | .0381433 .0229385 1.66 0.096 -.0068297 .0831163
union | .0411497 .0196922 2.09 0.037 .0025414 .0797579
------------------------------------------------------------------------------

13
. reg dlwage dd81 dd82 dd83 dd84 dd85 dd86 dd87 expersq married union, noconstant

Source | SS df MS Number of obs = 3815


-------------+------------------------------ F( 10, 3805) = 11.34
Model | 22.2437688 10 2.22437688 Prob > F = 0.0000
Residual | 746.369232 3805 .196154857 R-squared = 0.0289
-------------+------------------------------ Adj R-squared = 0.0264
Total | 768.613001 3815 .201471298 Root MSE = .44289

------------------------------------------------------------------------------
dlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
dd81 | .1559977 .0245101 6.36 0.000 .1079435 .2040519
dd82 | .2637966 .0442716 5.96 0.000 .1769983 .3505948
dd83 | .3718864 .0677996 5.49 0.000 .2389593 .5048135
dd84 | .5156409 .0954807 5.40 0.000 .3284426 .7028391
dd85 | .6508372 .1275018 5.10 0.000 .4008587 .9008157
dd86 | .8083419 .1639219 4.93 0.000 .4869586 1.129725
dd87 | .9810254 .2047712 4.79 0.000 .5795535 1.382497
expersq | -.0057546 .0021701 -2.65 0.008 -.0100092 -.0015
married | .0381433 .0229385 1.66 0.096 -.0068297 .0831163
union | .0411497 .0196922 2.09 0.037 .0025414 .0797579
------------------------------------------------------------------------------

. reg dlwage d82 d83 d84 d85 d86 d87 expersq married union

Source | SS df MS Number of obs = 3815


-------------+------------------------------ F( 9, 3805) = 2.73
Model | 4.82469678 9 .53607742 Prob > F = 0.0035
Residual | 746.369232 3805 .196154857 R-squared = 0.0064
-------------+------------------------------ Adj R-squared = 0.0041
Total | 751.193929 3814 .196956982 Root MSE = .44289

------------------------------------------------------------------------------
dlwage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
d82 | -.0481988 .0271857 -1.77 0.076 -.1014988 .0051011
d83 | -.0479079 .028197 -1.70 0.089 -.1031906 .0073748
d84 | -.0122432 .0298272 -0.41 0.681 -.0707219 .0462356
d85 | -.0208014 .0319606 -0.65 0.515 -.0834629 .0418602
d86 | .001507 .0345057 0.04 0.965 -.0661445 .0691585
d87 | .0166858 .037406 0.45 0.656 -.056652 .0900236
expersq | -.0057546 .0021701 -2.65 0.008 -.0100092 -.0015
married | .0381433 .0229385 1.66 0.096 -.0068297 .0831163
union | .0411497 .0196922 2.09 0.037 .0025414 .0797579
_cons | .1559977 .0245101 6.36 0.000 .1079435 .2040519
------------------------------------------------------------------------------

. estimates store differenced

14
. estimates table pooled random fixed differenced, star(.1 .05 .01) newpanel stats(r2 r2_w
r2_b r2_o
> N_g N)

------------------------------------------------------------------------------
Variable | pooled random fixed differenced
-------------+----------------------------------------------------------------
d81 | .05831999* .040462 .15119121***
d82 | .06277442* .03092116 .25297086*** -.04819882*
d83 | .06201174* .02028064 .35444374*** -.04790792*
d84 | .09046719** .04311871 .49011479*** -.01224319
d85 | .1092463** .05781546 .61748227*** -.02080135
d86 | .14195959*** .09194758 .76549657*** .00150703
d87 | .17383343*** .13492892* .92502493*** .01668577
educ | .09134979*** .09187628*** 0
black | -.13923421*** -.13937673*** 0
hisp | .01601951 .02173173 0
exper | .0672345*** .10575452***
expersq | -.0024117*** -.00472394*** -.0051855*** -.00575462***
married | .10825295*** .06398602*** .04668036** .03814333*
union | .18246128*** .10613443*** .08000186*** .04114967**
_cons | .09205578 .02358638 1.4260185*** .1559977***
------------------------------------------------------------------------------

------------------------------------------------------------------------------
Statistics | pooled random fixed differenced
-------------+----------------------------------------------------------------
r2 | .18927834 .18057757 .0064227
r2_w | .17992598 .18057757
r2_b | .18602694 .02855781
r2_o | .18298401 .0888093
N_g | 545 545
N | 4360 4360 4360 3815
------------------------------------------------------------------------------
legend: * p<.1; ** p<.05; *** p<.01

15

Das könnte Ihnen auch gefallen