-------------------------------------------------------------------------------- log: /Users/baum/Desktop/To do/EC327_S2008/327refe.smcl log type: smcl opened on: 30 Jan 2008, 14:59:03
. use http://fmwww.bc.edu/cfb/boyan/udcl_irrc_3, clear
. use http://fmwww.bc.edu/cfb/boyan/udcl_irrc_3, clear
. keep if yeara>2003 (19915 observations deleted)
. xtset panel variable: firmid (unbalanced) time variable: yeara, 2004 to 2006
. * make into a balanced panel for these three years with complete data . qui reg data18 data128 data6 data12
. keep if e(sample) (344 observations deleted)
. bysort firmid: g ok = _N==3
. keep if ok (889 observations deleted)
. tab yeara
fiscal year | Freq. Percent Cum. ------------+----------------------------------- 2004 | 1,319 33.33 33.33 2005 | 1,319 33.33 66.67 2006 | 1,319 33.33 100.00 ------------+----------------------------------- Total | 3,957 100.00
. * random effect estimation . xtreg data18 data128 data6 data12 if ok, re
Random-effects GLS regression Number of obs = 3957 Group variable (i): firmid Number of groups = 1319
R-sq: within = 0.3036 Obs per group: min = 3 between = 0.6312 avg = 3.0 overall = 0.6106 max = 3
Random effects u_i ~ Gaussian Wald chi2(3) = 3191.86 corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
------------------------------------------------------------------------------ data18 | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- data128 | .0425871 .0300561 1.42 0.157 -.0163218 .101496 data6 | .0042377 .0003997 10.60 0.000 .0034543 .0050211 data12 | .0647104 .002228 29.04 0.000 .0603435 .0690773 _cons | -28.19581 29.8356 -0.95 0.345 -86.6725 30.28088 -------------+---------------------------------------------------------------- sigma_u | 981.4475 sigma_e | 415.58627 rho | .84795829 (fraction of variance due to u_i) ------------------------------------------------------------------------------
. est store re
. * fixed effect estimation . xtreg data18 data128 data6 data12 if ok, fe
Fixed-effects (within) regression Number of obs = 3957 Group variable (i): firmid Number of groups = 1319
R-sq: within = 0.3223 Obs per group: min = 3 between = 0.5826 avg = 3.0 overall = 0.5650 max = 3
F(3,2635) = 417.72 corr(u_i, Xb) = -0.5965 Prob > F = 0.0000
------------------------------------------------------------------------------ data18 | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- data128 | .0983172 .0415973 2.36 0.018 .0167506 .1798838 data6 | -.0006023 .0007978 -0.76 0.450 -.0021666 .000962 data12 | .1050727 .0042303 24.84 0.000 .0967776 .1133678 _cons | -238.4987 21.01925 -11.35 0.000 -279.7146 -197.2828 -------------+---------------------------------------------------------------- sigma_u | 1355.899 sigma_e | 415.58627 rho | .91412382 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(1318, 2635) = 17.90 Prob > F = 0.0000
. est store fe
. hausman fe re
---- Coefficients ---- | (b) (B) (b-B) sqrt(diag(V_b-V_B)) | fe re Difference S.E. -------------+---------------------------------------------------------------- data128 | .0983172 .0425871 .0557301 .028757 data6 | -.0006023 .0042377 -.00484 .0006904 data12 | .1050727 .0647104 .0403623 .0035961 ------------------------------------------------------------------------------ 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) = 217.48 Prob>chi2 = 0.0000
. log close log: /Users/baum/Desktop/To do/EC327_S2008/327refe.smcl log type: smcl closed on: 30 Jan 2008, 14:59:05 --------------------------------------------------------------------------------