Thank you so much Carlo, I will use that command.
Best,
Shiwani
Best,
Shiwani
. use "https://www.stata-press.com/data/r16/nlswork.dta"
(National Longitudinal Survey. Young Women 14-26 years of age in 1968)
. regress ln_wage age i.year i.idcode if idcode<=4
Source | SS df MS Number of obs = 50
-------------+---------------------------------- F(18, 31) = 1.19
Model | 2.96881764 18 .164934314 Prob > F = 0.3290
Residual | 4.31127709 31 .139073454 R-squared = 0.4078
-------------+---------------------------------- Adj R-squared = 0.0639
Total | 7.28009473 49 .148573362 Root MSE = .37293
------------------------------------------------------------------------------
ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .2626399 .4488774 0.59 0.563 -.6528517 1.178131
|
year |
69 | -.0536729 .6925589 -0.08 0.939 -1.466156 1.35881
70 | -.5622491 .9779883 -0.57 0.570 -2.556869 1.432371
71 | -.9270145 1.387092 -0.67 0.509 -3.756008 1.901979
72 | -1.063298 1.819443 -0.58 0.563 -4.774076 2.64748
73 | -1.228195 2.258252 -0.54 0.590 -5.83393 3.37754
75 | -1.704501 3.144409 -0.54 0.592 -8.117565 4.708562
77 | -2.312608 4.040225 -0.57 0.571 -10.5527 5.927484
78 | -2.367822 4.486708 -0.53 0.601 -11.51852 6.78288
80 | -3.040105 5.376662 -0.57 0.576 -14.00588 7.92567
82 | -3.763953 6.275703 -0.60 0.553 -16.56333 9.035427
83 | -3.803244 6.719895 -0.57 0.575 -17.50856 9.902073
85 | -4.165837 7.616051 -0.55 0.588 -19.69888 11.3672
87 | -4.750318 8.512544 -0.56 0.581 -22.11177 12.61113
88 | -5.133582 9.297175 -0.55 0.585 -24.0953 13.82813
|
idcode |
2 | -.34821 .1544058 -2.26 0.031 -.6631228 -.0332973
3 | -1.996997 2.662102 -0.75 0.459 -7.42639 3.432395
4 | -1.597003 2.699068 -0.59 0.558 -7.101788 3.907781
|
_cons | -2.287519 7.228638 -0.32 0.754 -17.03042 12.45539
------------------------------------------------------------------------------
. xtreg ln_wage age i.year if idcode<=4, fe
Fixed-effects (within) regression Number of obs = 50
Group variable: idcode Number of groups = 4
R-sq: Obs per group:
within = 0.1909 min = 11
between = 0.0349 avg = 12.5
overall = 0.0044 max = 15
F(15,31) = 0.49
corr(u_i, Xb) = -0.9582 Prob > F = 0.9290
------------------------------------------------------------------------------
ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .2626399 .4488774 0.59 0.563 -.6528517 1.178131
|
year |
69 | -.0536729 .6925589 -0.08 0.939 -1.466156 1.35881
70 | -.5622491 .9779883 -0.57 0.570 -2.556869 1.432371
71 | -.9270145 1.387092 -0.67 0.509 -3.756008 1.901979
72 | -1.063298 1.819443 -0.58 0.563 -4.774076 2.64748
73 | -1.228195 2.258252 -0.54 0.590 -5.83393 3.37754
75 | -1.704501 3.144409 -0.54 0.592 -8.117565 4.708562
77 | -2.312608 4.040225 -0.57 0.571 -10.5527 5.927484
78 | -2.367822 4.486708 -0.53 0.601 -11.51852 6.78288
80 | -3.040105 5.376662 -0.57 0.576 -14.00588 7.92567
82 | -3.763953 6.275703 -0.60 0.553 -16.56333 9.035427
83 | -3.803244 6.719895 -0.57 0.575 -17.50856 9.902073
85 | -4.165837 7.616051 -0.55 0.588 -19.69888 11.3672
87 | -4.750318 8.512544 -0.56 0.581 -22.11177 12.61113
88 | -5.133582 9.297175 -0.55 0.585 -24.0953 13.82813
|
_cons | -3.321529 8.616061 -0.39 0.702 -20.8941 14.25104
-------------+----------------------------------------------------------------
sigma_u | .96166721
sigma_e | .37292553
rho | .86927679 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(3, 31) = 4.30 Prob > F = 0.0120
.
Comment