KEMBAR78
Stata Panel Data Analysis Summary | PDF | Bootstrapping (Statistics) | Data Analysis
0% found this document useful (0 votes)
295 views45 pages

Stata Panel Data Analysis Summary

This document contains output from Stata statistical software analyzing panel (longitudinal) data on wages from 1976-1982. It includes summary statistics on various variables, as well as model output from fixed effects and population-averaged regressions with robust standard errors to examine factors associated with wages over time.

Uploaded by

Chu Bundy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
295 views45 pages

Stata Panel Data Analysis Summary

This document contains output from Stata statistical software analyzing panel (longitudinal) data on wages from 1976-1982. It includes summary statistics on various variables, as well as model output from fixed effects and population-averaged regressions with robust standard errors to examine factors associated with wages over time.

Uploaded by

Chu Bundy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Notes:

1. (/v# option or -set maxvar-) 5000 maximum variables

Checking for updates...

(contacting http://www.stata.com)

bad serial number

unable to check for update; verify Internet settings are correct.

. use "C:\Users\BLADIMIR\Desktop\base de datos.dta"

(PSID wage data 1976-82 from Baltagi and Khanti-Akom (1990))

. xtset id t

panel variable: id (strongly balanced)

time variable: t, 1 to 7

delta: 1 unit

. xtsum occ

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

occ overall | .5111645 .4999354 0 1| N = 4165

between | .469327 0 1| n= 595

within | .1731615 -.3459784 1.368307 | T= 7

. xtsum smsa

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

smsa overall | .6537815 .475821 0 1| N = 4165


between | .4601658 0 1| n= 595

within | .1223035 -.2033613 1.510924 | T= 7

. xtsum ind

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

ind overall | .3954382 .4890033 0 1| N = 4165

between | .4648725 0 1| n= 595

within | .152739 -.4617047 1.252581 | T= 7

. xtsum ms

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

ms overall | .8144058 .3888256 0 1| N = 4165

between | .3686109 0 1| n= 595

within | .1245274 -.0427371 1.671549 | T= 7

. xtsum union

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

union overall | .3639856 .4812023 0 1| N = 4165

between | .4543848 0 1| n= 595

within | .1593351 -.4931573 1.221128 | T= 7

. xtsum fem
Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

fem overall | .112605 .3161473 0 1| N = 4165

between | .3163754 0 1| n= 595

within | 0 .112605 .112605 | T= 7

. xtsum blk

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

blk overall | .0722689 .2589637 0 1| N = 4165

between | .2591505 0 1| n= 595

within | 0 .0722689 .0722689 | T= 7

. *fem y black no presentan variaciones en el tiempo

. xttab occ

Overall Between Within

occ | Freq. Percent Freq. Percent Percent

----------+-----------------------------------------------------

0 | 2036 48.88 348 58.49 83.58

1 | 2129 51.12 352 59.16 86.40

----------+-----------------------------------------------------

Total | 4165 100.00 700 117.65 85.00

(n = 595)

. xttrans

varlist required
r(100);

. xttrans occ

occupation |

; occ==1 |

if in a | occupation; occ==1 if

blue-colla | in a blue-collar

r| occupation

occupation | 0 1| Total

-----------+----------------------+----------

0| 95.19 4.81 | 100.00

1| 4.99 95.01 | 100.00

-----------+----------------------+----------

Total | 49.10 50.90 | 100.00

. graph twoway (scatter lwage ed) (qfit lwage ed)

. graph twoway (scatter lwage ed)

. graph twoway (scatter lwage ed) (qfit lwage ed)

. xtsum lwage

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

lwage overall | 6.676346 .4615122 4.60517 8.537 | N = 4165

between | .3942387 5.3364 7.813596 | n= 595


within | .2404023 4.781808 8.621092 | T= 7

. xtsum lwage by id: egen meanwage=mean(lwage) y

variable by not found

r(111);

. xtsum by id: egen meanwage=mean(lwage) y

variable by not found

r(111);

. xtsum lwage by id: egen meanwage=mean(lwage) y

variable by not found

r(111);

. xtsum lwage id: egen meanwage=mean(lwage) y

: invalid name

r(198);

. xtsum lwage id egen meanwage=mean(lwage) y

variable egen not found

r(111);

. quietly xtreg lwage $xlist, re

. scalar theta = e (theta)

e ambiguous abbreviation

r(111);

. scalar theta = e(theta)


. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {

2. by id: egen mean·x· c mean(·x·)

3. generate md·x· = ·x· - mean·x·

4. generate red·x· = ·x· - theta•mean· x·

5. }

invalid syntax

r(198);

. egen meanwage=mean(lwage)

. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {


2.

. 2. by id: egen mean·x· c mean(·x·)

3.

. 3. generate md·x· = ·x· - mean·x·

4.

. 4. generate red·x· = ·x· - theta•mean· x·

5.

. 5. }

unrecognized command: 2. invalid command name

r(199);

. quietly regress redlwage redexp redexp2 redwks mdexp mdexp2 mdwks

variable redlwage not found

r(111);

. test mdexp mdexp2 mdwks

mdexp not found

r(111);

. quietly xtreg lwage $xlist, re

. scalar theta = e (theta)

e ambiguous abbreviation

r(111);

.
. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {

2. quietly xtreg lwage $xlist, re

3.

. scalar theta = e(theta)

4.

. global yandxforhausman lwage exp exp2 wks

5.

. sort id

6.

. foreach x of varlist $yandxforhausman {

7. }

8.

. quietly regress redlwage redexp redexp2 redwks mdexp mdexp2 mdwks

9.

. test mdexp mdexp2 mdwks

10. }

variable redlwage not found

r(111);

. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)


.

. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {

2. by id: egen mean·x· c mean(·x·)

3. generate md·x· = ·x· - mean·x·

4. generate red·x· = ·x· - theta•mean· x·

5. }

invalid syntax

r(198);

. quietly xtreg lwage $xlist, r

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {

2. by id: egen mean"x" c mean("x)

3. dfóbe

4. }

invalid syntax
r(198);

. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. sort id

. foreach x of varlist $yandxforhausman {

2. by id: egen mean·x· c mean(·x·)

3. generate md·x· = ·x· - mean·x·

4. generate red·x· = ·x· - theta•mean· x·

5. }

invalid syntax

r(198);

. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. sort id
. foreach x of varlist $yandxforhausman {

2. by id: egen mean·x· c mean(·x·)

3. generate md·x· = ·x· - mean·x·

4. generate red·x· = ·x· - theta*mean· x·

5. }

invalid syntax

r(198);

. scalar 2*2

2 invalid name

r(198);

. di 2*2

. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. foreach x of varlist $yandxforhausman {

2. by id: egen mean·x· =mean(·x·)

3. generate md·x· = ·x· - mean·x·

4. generate red·x· = ·x· - theta*mean· x·

5. }

·x· invalid name

r(198);
. quietly xtreg lwage $xlist, re

. scalar theta = e(theta)

. global yandxforhausman lwage exp exp2 wks

. foreach x of varlist $yandxforhausman {

2. by id: egen meanf =mean(f)

3. generate md·f· = ·f· - mean·f·

4. generate red·f· = ·x· - theta*mean· f·

5. }

·f· invalid name

r(198);

. xtreg lwage exp exp2 wks ed, pa corr(ar 2) vce(robust)

Iteration 1: tolerance = .02245275

Iteration 2: tolerance = .02001357

Iteration 3: tolerance = .00991542

Iteration 4: tolerance = .0055136

Iteration 5: tolerance = .00323279

Iteration 6: tolerance = .00194929

Iteration 7: tolerance = .00119421

Iteration 8: tolerance = .00073853

Iteration 9: tolerance = .00045933

Iteration 10: tolerance = .00028668

Iteration 11: tolerance = .00017931

Iteration 12: tolerance = .00011231


Iteration 13: tolerance = .0000704

Iteration 14: tolerance = .00004415

Iteration 15: tolerance = .0000277

Iteration 16: tolerance = .00001738

Iteration 17: tolerance = .00001091

Iteration 18: tolerance = 6.847e-06

Iteration 19: tolerance = 4.298e-06

Iteration 20: tolerance = 2.698e-06

Iteration 21: tolerance = 1.693e-06

Iteration 22: tolerance = 1.063e-06

Iteration 23: tolerance = 6.673e-07

GEE population-averaged model Number of obs = 4165

Group and time vars: id t Number of groups = 595

Link: identity Obs per group: min = 7

Family: Gaussian avg = 7.0

Correlation: AR(2) max = 7

Wald chi2(4) = 873.28

Scale parameter: .1966639 Prob > chi2 = 0.0000

(Std. Err. adjusted for clustering on id)

------------------------------------------------------------------------------

| Semirobust

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

-------------+----------------------------------------------------------------

exp | .0718915 .003999 17.98 0.000 .0640535 .0797294

exp2 | -.0008966 .0000933 -9.61 0.000 -.0010794 -.0007137

wks | .0002964 .0010553 0.28 0.779 -.001772 .0023647

ed | .0905069 .0060161 15.04 0.000 .0787156 .1022982


_cons | 4.526381 .1056897 42.83 0.000 4.319233 4.733529

------------------------------------------------------------------------------

. xtsum lwage exp exp2 wks ed, pa corr(ar 2) vce(robust)

option pa not allowed

r(198);

. xtreg lwage exp exp2 wks ed, be vce(bootstrap)

(running xtreg on estimation sample)

Bootstrap replications (50)

----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5

.................................................. 50

Between regression (regression on group means) Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.1357 Obs per group: min = 7

between = 0.3264 avg = 7.0

overall = 0.2723 max = 7

Wald chi(4) = 250.93

sd(u_i + avg(e_i.))= .324656 Prob > chi2 = 0.0000

(Replications based on 595 clusters in id)

------------------------------------------------------------------------------

| Observed Bootstrap Normal-based

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

-------------+----------------------------------------------------------------
exp | .038153 .0060873 6.27 0.000 .026222 .0500839

exp2 | -.0006313 .0001455 -4.34 0.000 -.0009164 -.0003461

wks | .0130903 .0047118 2.78 0.005 .0038553 .0223252

ed | .0737838 .005392 13.68 0.000 .0632157 .0843518

_cons | 4.683039 .2442383 19.17 0.000 4.204341 5.161737

------------------------------------------------------------------------------

. xtreg lwage exp exp2 wks ed, fe vce(cluster id)

note: ed omitted because of collinearity

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

Group variable: id Number of groups = 595

R-sq: within = 0.6566 Obs per group: min = 7

between = 0.0276 avg = 7.0

overall = 0.0476 max = 7

F(3,594) = 1059.72

corr(u_i, Xb) = -0.9107 Prob > F = 0.0000

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp | .1137879 .0040289 28.24 0.000 .1058753 .1217004

exp2 | -.0004244 .0000822 -5.16 0.000 -.0005858 -.0002629

wks | .0008359 .0008697 0.96 0.337 -.0008721 .0025439

ed | 0 (omitted)
_cons | 4.596396 .0600887 76.49 0.000 4.478384 4.714408

-------------+----------------------------------------------------------------

sigma_u | 1.0362039

sigma_e | .15220316

rho | .97888036 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. xtsum id t lYage ed exp exp2 Yks south tdum1

variable lYage not found

r(111);

. xtsum id t lwage ed exp exp2 wks south tdum1

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

id overall | 298 171.7821 1 595 | N = 4165

between | 171.906 1 595 | n= 595

within | 0 298 298 | T= 7

| |

t overall | 4 2.00024 1 7| N = 4165

between | 0 4 4| n= 595

within | 2.00024 1 7| T= 7

| |

lwage overall | 6.676346 .4615122 4.60517 8.537 | N = 4165

between | .3942387 5.3364 7.813596 | n= 595

within | .2404023 4.781808 8.621092 | T= 7

| |

ed overall | 12.84538 2.787995 4 17 | N = 4165

between | 2.790006 4 17 | n= 595


within | 0 12.84538 12.84538 | T= 7

| |

exp overall | 19.85378 10.96637 1 51 | N = 4165

between | 10.79018 4 48 | n= 595

within | 2.00024 16.85378 22.85378 | T= 7

| |

exp2 overall | 514.405 496.9962 1 2601 | N = 4165

between | 489.0495 20 2308 | n= 595

within | 90.44581 231.405 807.405 | T= 7

| |

wks overall | 46.81152 5.129098 5 52 | N = 4165

between | 3.284016 31.57143 51.57143 | n= 595

within | 3.941881 12.2401 63.66867 | T= 7

| |

south overall | .2902761 .4539442 0 1| N = 4165

between | .4489462 0 1| n= 595

within | .0693042 -.5668667 1.147419 | T= 7

| |

tdum1 overall | .1428571 .3499691 0 1| N = 4165

between | 0 .1428571 .1428571 | n= 595

within | .3499691 0 1| T= 7

. . xtreg lwage exp exp2 wks ed, be

Between regression (regression on group means) Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.1357 Obs per group: min = 7

between = 0.3264 avg = 7.0


overall = 0.2723 max = 7

F(4,590) = 71.48

sd(u_i + avg(e_i.))= .324656 Prob > F = 0.0000

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

exp | .038153 .0056967 6.70 0.000 .0269647 .0493412

exp2 | -.0006313 .0001257 -5.02 0.000 -.0008781 -.0003844

wks | .0130903 .0040659 3.22 0.001 .0051048 .0210757

ed | .0737838 .0048985 15.06 0.000 .0641632 .0834044

_cons | 4.683039 .2100989 22.29 0.000 4.270407 5.095672

------------------------------------------------------------------------------

. xtreg l11age exp exp2 wks ed, fe v ce( cluster id)

variable l11age not found

r(111);

. xtreg lwage exp exp2 wks ed, fe v ce( cluster id)

option v not allowed

r(198);

. xtreg lwage exp exp2 wks ed, fe vce( cluster id)

note: ed omitted because of collinearity

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

Group variable: id Number of groups = 595


R-sq: within = 0.6566 Obs per group: min = 7

between = 0.0276 avg = 7.0

overall = 0.0476 max = 7

F(3,594) = 1059.72

corr(u_i, Xb) = -0.9107 Prob > F = 0.0000

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp | .1137879 .0040289 28.24 0.000 .1058753 .1217004

exp2 | -.0004244 .0000822 -5.16 0.000 -.0005858 -.0002629

wks | .0008359 .0008697 0.96 0.337 -.0008721 .0025439

ed | 0 (omitted)

_cons | 4.596396 .0600887 76.49 0.000 4.478384 4.714408

-------------+----------------------------------------------------------------

sigma_u | 1.0362039

sigma_e | .15220316

rho | .97888036 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. global xlist exp exp2 wks ed

. quietly regress lwage $xlist, vce (cluster id)

. estimates store OLS_rob


. quietly xtreg lwage $xlist, be

. estimates store BE

. quietly xtreg lwage $x list, fe

variable list not found

r(111);

. quietly xtreg lwage $xlist, fe

. estimates store FE

. quietly xtreg lwage $x list, fe vce (robust)

variable list not found

r(111);

. quietly xtreg lwage $xlist, fe vce (robust)

. estimates store FE_rob

. quietly xtreg lwage $xlist, re

. estimates store RE

. quietly xtreg lwage $xlist, re vce (robust)

. estimates store RE_rob


. estimates table OLS_rob BE FE FE_rob RE RE_rob , b se stats(N r2 r2_o r2_b r2_w sigma_u
sigma_e rho) b(/.7.4f)

invalid display format /.7.4f

r(120);

. estimates table OLS_rob BE FE FE_rob RE RE_rob , b se stats(N r2 r2_o r2_b r2_w sigma_u
sigma_e rho) b(%7.4f)

--------------------------------------------------------------------------------------

Variable | OLS_rob BE FE FE_rob RE RE_rob

-------------+------------------------------------------------------------------------

exp | 0.0447 0.0382 0.1138 0.1138 0.0889 0.0889

| 0.0054 0.0057 0.0025 0.0040 0.0028 0.0040

exp2 | -0.0007 -0.0006 -0.0004 -0.0004 -0.0008 -0.0008

| 0.0001 0.0001 0.0001 0.0001 0.0001 0.0001

wks | 0.0058 0.0131 0.0008 0.0008 0.0010 0.0010

| 0.0019 0.0041 0.0006 0.0009 0.0007 0.0009

ed | 0.0760 0.0738 (omitted) (omitted) 0.1117 0.1117

| 0.0052 0.0049 0.0061 0.0084

_cons | 4.9080 4.6830 4.5964 4.5964 3.8294 3.8294

| 0.1400 0.2101 0.0389 0.0601 0.0936 0.1334

-------------+------------------------------------------------------------------------

N| 4165 4165 4165 4165 4165 4165

r2 | 0.2836 0.3264 0.6566 0.6566

r2_o | 0.2723 0.0476 0.0476 0.1830 0.1830

r2_b | 0.3264 0.0276 0.0276 0.1716 0.1716

r2_w | 0.1357 0.6566 0.6566 0.6340 0.6340

sigma_u | 1.0362 1.0362 0.3195 0.3195

sigma_e | 0.1522 0.1522 0.1522 0.1522

rho | 0.9789 0.9789 0.8151 0.8151


--------------------------------------------------------------------------------------

legend: b/se

. global xlist

. . quietly regress lwage $xlist, vce (cluster id)

. . estimates store OLS_rob

. . quietly xtreg lwage $xlist, be

. . estimates store BE

. quietly xtreg lwage $xlist, fe

.
.

. . estimates store FE

. . quietly xtreg lwage $xlist, fe vce (robust)

last test not found

r(302);

. . estimates store FE_rob

. . quietly xtreg lwage $xlist, re

. . estimates store RE

.
.

..

. . quietly xtreg lwage $xlist, re vce (robust)

. . estimates store RE_rob

. . estimates table OLS_rob BE FE FE_rob RE RE_rob , b se stats(N r2 r2_o r2_b r2_w sigma_u
sigma_e rho) b(%7.4f)

FE_rob estimation results do not have e(b) and e(V)

r(321);

. global xlist exp exp2 wks ed

. sum wage

variable wage not found

r(111);

. sum lwage

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------
lwage | 4165 6.676346 .4615122 4.60517 8.537

. gen mean wage

=exp required

r(100);

. gen meanwage= lwage-6.68

meanwage already defined

r(110);

. xtsum lage

variable lage not found

r(111);

. xtsum lwage

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

lwage overall | 6.676346 .4615122 4.60517 8.537 | N = 4165

between | .3942387 5.3364 7.813596 | n= 595

within | .2404023 4.781808 8.621092 | T= 7

. graph twoway (scatter lwage ed) (qfit lwage ed)

. gen meanwag= lwage-meanwage

. xtwum meanwag

unrecognized command: xtwum

r(199);
. xtsum meanwag

Variable | Mean Std. Dev. Min Max | Observations

-----------------+--------------------------------------------+----------------

meanwag overall | 9.97e-08 .4615122 -2.071177 1.860653 | N = 4165

between | .3942387 -1.339946 1.137249 | n= 595

within | .2404023 -1.894538 1.944746 | T= 7

. egen meanwage=mean(lwage)

meanwage already defined

r(110);

. xtsum grandmean

variable grandmean not found

r(111);

. by id: egen meanwage=mean(lwage)

meanwage already defined

r(110);

. by id: egen meanwage2=mean(lwage)

. global xlist exp exp2 wks ed

. reg lwage $xlist, vce(cluster id)

Linear regression Number of obs = 4165

F( 4, 594) = 72.58
Prob > F = 0.0000

R-squared = 0.2836

Root MSE = .39082

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp | .044675 .0054385 8.21 0.000 .0339941 .055356

exp2 | -.0007156 .0001285 -5.57 0.000 -.0009679 -.0004633

wks | .005827 .0019284 3.02 0.003 .0020396 .0096144

ed | .0760407 .0052122 14.59 0.000 .0658042 .0862772

_cons | 4.907961 .1399887 35.06 0.000 4.633028 5.182894

------------------------------------------------------------------------------

. estimates store OLS_rob

. xtreg lwage #list, be

# invalid name

r(198);

. xtreg lwage $list, be

Between regression (regression on group means) Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = . Obs per group: min = 7

between = 0.0000 avg = 7.0


overall = . max = 7

F(0,594) = 0.00

sd(u_i + avg(e_i.))= .3942387 Prob > F = .

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

_cons | 6.676346 .0161622 413.08 0.000 6.644604 6.708088

------------------------------------------------------------------------------

. estimates store BE

. xtreg lwage $xlist, fe

note: ed omitted because of collinearity

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

Group variable: id Number of groups = 595

R-sq: within = 0.6566 Obs per group: min = 7

between = 0.0276 avg = 7.0

overall = 0.0476 max = 7

F(3,3567) = 2273.74

corr(u_i, Xb) = -0.9107 Prob > F = 0.0000

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------
exp | .1137879 .0024689 46.09 0.000 .1089473 .1186284

exp2 | -.0004244 .0000546 -7.77 0.000 -.0005315 -.0003173

wks | .0008359 .0005997 1.39 0.163 -.0003399 .0020116

ed | 0 (omitted)

_cons | 4.596396 .0389061 118.14 0.000 4.520116 4.672677

-------------+----------------------------------------------------------------

sigma_u | 1.0362039

sigma_e | .15220316

rho | .97888036 (fraction of variance due to u_i)

------------------------------------------------------------------------------

F test that all u_i=0: F(594, 3567) = 56.52 Prob > F = 0.0000

. estimates store FE

. xtreg lwage $xlist, fe vce (robust)

note: ed omitted because of collinearity

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

Group variable: id Number of groups = 595

R-sq: within = 0.6566 Obs per group: min = 7

between = 0.0276 avg = 7.0

overall = 0.0476 max = 7

F(3,594) = 1059.72

corr(u_i, Xb) = -0.9107 Prob > F = 0.0000

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------
| Robust

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

-------------+----------------------------------------------------------------

exp | .1137879 .0040289 28.24 0.000 .1058753 .1217004

exp2 | -.0004244 .0000822 -5.16 0.000 -.0005858 -.0002629

wks | .0008359 .0008697 0.96 0.337 -.0008721 .0025439

ed | 0 (omitted)

_cons | 4.596396 .0600887 76.49 0.000 4.478384 4.714408

-------------+----------------------------------------------------------------

sigma_u | 1.0362039

sigma_e | .15220316

rho | .97888036 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store FE_rob

. xtreg lwage $lxist, re

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.0000 Obs per group: min = 7

between = 0.0000 avg = 7.0

overall = 0.0000 max = 7

Wald chi2(0) = .

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

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

-------------+----------------------------------------------------------------

_cons | 6.676346 .0161622 413.08 0.000 6.644669 6.708024

-------------+----------------------------------------------------------------

sigma_u | .38183016

sigma_e | .25963301

rho | .68382658 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store RE

. xtreg lwage $lxist, re vce (robust)

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.0000 Obs per group: min = 7

between = 0.0000 avg = 7.0

overall = 0.0000 max = 7

Wald chi2(0) = .

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

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

_cons | 6.676346 .0161622 413.08 0.000 6.644669 6.708024


-------------+----------------------------------------------------------------

sigma_u | .38183016

sigma_e | .25963301

rho | .68382658 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store RE_rob

. estimates table OLS_rob BE FE FE_rob RE RE_rob, b se stats (N r2 r2_o r2_b r2_w sigma_u
sigma_e rho)

--------------------------------------------------------------------------------------------

Variable | OLS_rob BE FE FE_rob RE RE_rob

-------------+------------------------------------------------------------------------------

exp | .04467505 .11378786 .11378786

| .00543845 .00246888 .00402887

exp2 | -.00071563 -.00042437 -.00042437

| .00012847 .00005463 .00008221

wks | .00582698 .00083588 .00083588

| .00192844 .00059967 .00086968

ed | .07604069 (omitted) (omitted)

| .00521218

_cons | 4.9079608 6.6763464 4.5963962 4.5963962 6.6763464 6.6763464

| .13998868 .01616221 .03890613 .06008865 .01616221 .01616221

-------------+------------------------------------------------------------------------------

N| 4165 4165 4165 4165 4165 4165

r2 | .28356078 0 .65662995 .65662995

r2_o | . .04760429 .04760429 0 0

r2_b | 0 .02762965 .02762965 0 0


r2_w | . .65662995 .65662995 0 0

sigma_u | 1.0362039 1.0362039 .38183016 .38183016

sigma_e | .15220316 .15220316 .25963301 .25963301

rho | .97888036 .97888036 .68382658 .68382658

--------------------------------------------------------------------------------------------

legend: b/se

. sum ed

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

ed | 4165 12.84538 2.787995 4 17

. xtreg lwage $xlist, be

Between regression (regression on group means) Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.1357 Obs per group: min = 7

between = 0.3264 avg = 7.0

overall = 0.2723 max = 7

F(4,590) = 71.48

sd(u_i + avg(e_i.))= .324656 Prob > F = 0.0000

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

exp | .038153 .0056967 6.70 0.000 .0269647 .0493412


exp2 | -.0006313 .0001257 -5.02 0.000 -.0008781 -.0003844

wks | .0130903 .0040659 3.22 0.001 .0051048 .0210757

ed | .0737838 .0048985 15.06 0.000 .0641632 .0834044

_cons | 4.683039 .2100989 22.29 0.000 4.270407 5.095672

------------------------------------------------------------------------------

. estimates store BE

. estimates table OLS_rob BE FE FE_rob RE RE_rob, b se stats (N r2 r2_o r2_b r2_w sigma_u
sigma_e rho)

--------------------------------------------------------------------------------------------

Variable | OLS_rob BE FE FE_rob RE RE_rob

-------------+------------------------------------------------------------------------------

exp | .04467505 .03815295 .11378786 .11378786

| .00543845 .00569666 .00246888 .00402887

exp2 | -.00071563 -.00063127 -.00042437 -.00042437

| .00012847 .00012568 .00005463 .00008221

wks | .00582698 .01309028 .00083588 .00083588

| .00192844 .00406592 .00059967 .00086968

ed | .07604069 .07378378 (omitted) (omitted)

| .00521218 .00489848

_cons | 4.9079608 4.6830393 4.5963962 4.5963962 6.6763464 6.6763464

| .13998868 .21009889 .03890613 .06008865 .01616221 .01616221

-------------+------------------------------------------------------------------------------

N| 4165 4165 4165 4165 4165 4165

r2 | .28356078 .32641265 .65662995 .65662995

r2_o | .27232983 .04760429 .04760429 0 0

r2_b | .32641265 .02762965 .02762965 0 0


r2_w | .13567111 .65662995 .65662995 0 0

sigma_u | 1.0362039 1.0362039 .38183016 .38183016

sigma_e | .15220316 .15220316 .25963301 .25963301

rho | .97888036 .97888036 .68382658 .68382658

--------------------------------------------------------------------------------------------

legend: b/se

. xtreg lwage $xlist, re

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.6340 Obs per group: min = 7

between = 0.1716 avg = 7.0

overall = 0.1830 max = 7

Wald chi2(4) = 3012.45

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

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

exp | .0888609 .0028178 31.54 0.000 .0833382 .0943837

exp2 | -.0007726 .0000623 -12.41 0.000 -.0008946 -.0006505

wks | .0009658 .0007433 1.30 0.194 -.000491 .0024226

ed | .1117099 .0060572 18.44 0.000 .0998381 .1235818

_cons | 3.829366 .0936336 40.90 0.000 3.645848 4.012885

-------------+----------------------------------------------------------------

sigma_u | .31951859
sigma_e | .15220316

rho | .81505521 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store RE

. xtreg lwage $xlist, re vce (robust)

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.6340 Obs per group: min = 7

between = 0.1716 avg = 7.0

overall = 0.1830 max = 7

Wald chi2(4) = 1598.50

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

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp | .0888609 .0039992 22.22 0.000 .0810227 .0966992

exp2 | -.0007726 .0000896 -8.62 0.000 -.0009481 -.000597

wks | .0009658 .0009259 1.04 0.297 -.000849 .0027806

ed | .1117099 .0083954 13.31 0.000 .0952552 .1281647

_cons | 3.829366 .1333931 28.71 0.000 3.567921 4.090812

-------------+----------------------------------------------------------------
sigma_u | .31951859

sigma_e | .15220316

rho | .81505521 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store RE_rob

. estimates table OLS_rob BE FE FE_rob RE RE_rob, b se stats (N r2 r2_o r2_b r2_w sigma_u
sigma_e rho)

--------------------------------------------------------------------------------------------

Variable | OLS_rob BE FE FE_rob RE RE_rob

-------------+------------------------------------------------------------------------------

exp | .04467505 .03815295 .11378786 .11378786 .08886094 .08886094

| .00543845 .00569666 .00246888 .00402887 .00281776 .00399919

exp2 | -.00071563 -.00063127 -.00042437 -.00042437 -.00077256 -.00077256

| .00012847 .00012568 .00005463 .00008221 .00006226 .00008957

wks | .00582698 .01309028 .00083588 .00083588 .00096577 .00096577

| .00192844 .00406592 .00059967 .00086968 .00074329 .00092593

ed | .07604069 .07378378 (omitted) (omitted) .11170995 .11170995

| .00521218 .00489848 .00605716 .00839543

_cons | 4.9079608 4.6830393 4.5963962 4.5963962 3.8293663 3.8293663

| .13998868 .21009889 .03890613 .06008865 .09363358 .1333931

-------------+------------------------------------------------------------------------------

N| 4165 4165 4165 4165 4165 4165

r2 | .28356078 .32641265 .65662995 .65662995

r2_o | .27232983 .04760429 .04760429 .18304568 .18304568

r2_b | .32641265 .02762965 .02762965 .17162628 .17162628

r2_w | .13567111 .65662995 .65662995 .63401042 .63401042


sigma_u | 1.0362039 1.0362039 .31951859 .31951859

sigma_e | .15220316 .15220316 .15220316 .15220316

rho | .97888036 .97888036 .81505521 .81505521

--------------------------------------------------------------------------------------------

legend: b/se

. hausman FE RE, sigmamore

---- Coefficients ----

| (b) (B) (b-B) sqrt(diag(V_b-V_B))

| FE RE Difference S.E.

-------------+----------------------------------------------------------------

exp | .1137879 .0888609 .0249269 .0012778

exp2 | -.0004244 -.0007726 .0003482 .0000285

wks | .0008359 .0009658 -.0001299 .0001108

------------------------------------------------------------------------------

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)

= 1513.02

Prob>chi2 = 0.0000

. di .0249269 / .0012778

19.507669

. di .0003482 / .0000285
12.217544

. sort id

. by id: egen meanexp = mean(exp)

. by id: egen meanexp2 = mean(exp2)

. by id: egen meanwks= mean(wks)

. by id: egen meanlwage = mean(lwage)

. gen mdexp= exp-meanexp

. gen mdexp2= exp2-meanexp2

. gen mdwks= wks-meanwks

. xtreg lwage exp exp2 wks ed, re

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.6340 Obs per group: min = 7

between = 0.1716 avg = 7.0

overall = 0.1830 max = 7

Wald chi2(4) = 3012.45

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


------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

exp | .0888609 .0028178 31.54 0.000 .0833382 .0943837

exp2 | -.0007726 .0000623 -12.41 0.000 -.0008946 -.0006505

wks | .0009658 .0007433 1.30 0.194 -.000491 .0024226

ed | .1117099 .0060572 18.44 0.000 .0998381 .1235818

_cons | 3.829366 .0936336 40.90 0.000 3.645848 4.012885

-------------+----------------------------------------------------------------

sigma_u | .31951859

sigma_e | .15220316

rho | .81505521 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. scalar theta= e(theta)

. display theta

.82280511

. gen redexp= exp-(theta*meanexp)

. gen redexp2= exp2-(theta*meanexp2)

. gen redwks= wks-(theta*meanwks)

. gen redlwage= lwage- (theta*meanlwage)

. reg redexp redexp2 redwks redlwage mdexp mdexp2 mdwks, vce (cluster id)
Linear regression Number of obs = 4165

F( 6, 594) = .

Prob > F = 0.0000

R-squared = 0.9778

Root MSE = .41278

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

redexp2 | .0215215 .000305 70.57 0.000 .0209225 .0221204

redwks | .0147968 .0304425 0.49 0.627 -.0449911 .0745848

redlwage | .2458555 .0572145 4.30 0.000 .1334882 .3582227

mdexp | .9720246 .0065122 149.26 0.000 .9592348 .9848145

mdexp2 | -.0214171 .0003137 -68.27 0.000 -.0220332 -.0208011

mdwks | -.0150024 .0304476 -0.49 0.622 -.0748004 .0447957

_cons | 1.14272 .2694614 4.24 0.000 .6135072 1.671933

------------------------------------------------------------------------------

. test mdexp mdexp2 mdwks

( 1) mdexp = 0

( 2) mdexp2 = 0

( 3) mdwks = 0

F( 3, 594) = 7510.14

Prob > F = 0.0000


. reg lwage exp exp2 wks ed, vce (cluster id)

Linear regression Number of obs = 4165

F( 4, 594) = 72.58

Prob > F = 0.0000

R-squared = 0.2836

Root MSE = .39082

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp | .044675 .0054385 8.21 0.000 .0339941 .055356

exp2 | -.0007156 .0001285 -5.57 0.000 -.0009679 -.0004633

wks | .005827 .0019284 3.02 0.003 .0020396 .0096144

ed | .0760407 .0052122 14.59 0.000 .0658042 .0862772

_cons | 4.907961 .1399887 35.06 0.000 4.633028 5.182894

------------------------------------------------------------------------------

. predict xbols, xb

. xtreg lwage exp exp2 wks ed, re

Random-effects GLS regression Number of obs = 4165

Group variable: id Number of groups = 595

R-sq: within = 0.6340 Obs per group: min = 7


between = 0.1716 avg = 7.0

overall = 0.1830 max = 7

Wald chi2(4) = 3012.45

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

------------------------------------------------------------------------------

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

-------------+----------------------------------------------------------------

exp | .0888609 .0028178 31.54 0.000 .0833382 .0943837

exp2 | -.0007726 .0000623 -12.41 0.000 -.0008946 -.0006505

wks | .0009658 .0007433 1.30 0.194 -.000491 .0024226

ed | .1117099 .0060572 18.44 0.000 .0998381 .1235818

_cons | 3.829366 .0936336 40.90 0.000 3.645848 4.012885

-------------+----------------------------------------------------------------

sigma_u | .31951859

sigma_e | .15220316

rho | .81505521 (fraction of variance due to u_i)

------------------------------------------------------------------------------

. predict xbre, xb

. predict xburre, xbu

. sum lwage xbols xbre xbure

variable xbure not found

r(111);

. correlate lwage xbols xbre xbure


variable xbure not found

r(111);

. sum lwage xbols xbre xburre

Variable | Obs Mean Std. Dev. Min Max

-------------+--------------------------------------------------------

lwage | 4165 6.676346 .4615122 4.60517 8.537

xbols | 4165 6.676346 .2457572 5.850037 7.200861

xbre | 4165 6.676346 .6205324 5.028067 8.22958

xburre | 4165 6.676346 .4082951 5.29993 7.968179

. correlate lwage xbols xbre xburre

(obs=4165)

| lwage xbols xbre xburre

-------------+------------------------------------

lwage | 1.0000

xbols | 0.5325 1.0000

xbre | 0.4278 0.8034 1.0000

xburre | 0.9375 0.6019 0.4836 1.0000

. sort id t

. reg D.(lwage exp exp2 wks ed), vce(cluster id) noconstant

note: _delete omitted because of collinearity

Linear regression Number of obs = 3570


F( 3, 594) = 1035.19

Prob > F = 0.0000

R-squared = 0.2209

Root MSE = .18156

(Std. Err. adjusted for 595 clusters in id)

------------------------------------------------------------------------------

| Robust

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

-------------+----------------------------------------------------------------

exp |

D1. | .1170654 .0040974 28.57 0.000 .1090182 .1251126

exp2 |

D1. | -.0005321 .0000808 -6.58 0.000 -.0006908 -.0003734

wks |

D1. | -.0002683 .0011783 -0.23 0.820 -.0025824 .0020459

ed |

D1. | 0 (omitted)

------------------------------------------------------------------------------

You might also like