Hello everybody
What is exactly the difference between those two commands?
Thank you in advance
What is exactly the difference between those two commands?
Thank you in advance
xtset firmcode Year xtreg dep_var indep_vars covariates i.Year, fe
. . use "https://www.stata-press.com/data/r17/nlswork.dta"
(National Longitudinal Survey of Young Women, 14-24 years old in 1968)
. regress ln_wage age i.idcode i.year if idcode<=3
Source | SS df MS Number of obs = 39
-------------+---------------------------------- F(17, 21) = 2.68
Model | 3.54194923 17 .208349955 Prob > F = 0.0171
Residual | 1.63378973 21 .077799511 R-squared = 0.6843
-------------+---------------------------------- Adj R-squared = 0.4288
Total | 5.17573896 38 .136203657 Root MSE = .27893
------------------------------------------------------------------------------
ln_wage | Coefficient Std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
age | .3010572 .3561559 0.85 0.407 -.4396095 1.041724
|
idcode |
2 | -.3898423 .11632 -3.35 0.003 -.631743 -.1479415
3 | -2.247118 2.111457 -1.06 0.299 -6.638133 2.143897
|
year |
69 | -.0920902 .5314565 -0.17 0.864 -1.197315 1.013134
70 | -.8648493 .779214 -1.11 0.280 -2.485314 .7556149
71 | -1.248506 1.09967 -1.14 0.269 -3.535396 1.038383
72 | -1.39387 1.443494 -0.97 0.345 -4.395779 1.60804
73 | -1.520276 1.79214 -0.85 0.406 -5.247236 2.206684
75 | -2.049717 2.495803 -0.82 0.421 -7.240024 3.14059
77 | -2.657565 3.203292 -0.83 0.416 -9.319175 4.004045
78 | -2.751196 3.557758 -0.77 0.448 -10.14996 4.647567
80 | -3.324016 4.267534 -0.78 0.445 -12.19884 5.550808
82 | -4.027975 4.983977 -0.81 0.428 -14.39272 6.336774
83 | -4.207353 5.333467 -0.79 0.439 -15.2989 6.884199
85 | -4.730657 6.044586 -0.78 0.443 -17.30106 7.839747
87 | -5.407995 6.755956 -0.80 0.432 -19.45777 8.641785
88 | -5.901929 7.348904 -0.80 0.431 -21.18481 9.380954
|
_cons | -2.882579 5.734884 -0.50 0.620 -14.80892 9.043766
------------------------------------------------------------------------------
. xtreg ln_wage age i.year if idcode<=3, fe
Fixed-effects (within) regression Number of obs = 39
Group variable: idcode Number of groups = 3
R-squared: Obs per group:
Within = 0.5596 min = 12
Between = 0.4744 avg = 13.0
Overall = 0.0413 max = 15
F(15,21) = 1.78
corr(u_i, Xb) = -0.9573 Prob > F = 0.1102
------------------------------------------------------------------------------
ln_wage | Coefficient Std. err. t P>|t| [95% conf. interval]
-------------+----------------------------------------------------------------
age | .3010572 .3561559 0.85 0.407 -.4396095 1.041724
|
year |
69 | -.0920902 .5314565 -0.17 0.864 -1.197315 1.013134
70 | -.8648493 .779214 -1.11 0.280 -2.485314 .7556149
71 | -1.248506 1.09967 -1.14 0.269 -3.535396 1.038383
72 | -1.39387 1.443494 -0.97 0.345 -4.395779 1.60804
73 | -1.520276 1.79214 -0.85 0.406 -5.247236 2.206684
75 | -2.049717 2.495803 -0.82 0.421 -7.240024 3.14059
77 | -2.657565 3.203292 -0.83 0.416 -9.319175 4.004045
78 | -2.751196 3.557758 -0.77 0.448 -10.14996 4.647567
80 | -3.324016 4.267534 -0.78 0.445 -12.19884 5.550808
82 | -4.027975 4.983977 -0.81 0.428 -14.39272 6.336774
83 | -4.207353 5.333467 -0.79 0.439 -15.2989 6.884199
85 | -4.730657 6.044586 -0.78 0.443 -17.30106 7.839747
87 | -5.407995 6.755956 -0.80 0.432 -19.45777 8.641785
88 | -5.901929 7.348904 -0.80 0.431 -21.18481 9.380954
|
_cons | -3.866807 6.544144 -0.59 0.561 -17.4761 9.742485
-------------+----------------------------------------------------------------
sigma_u | 1.2007631
sigma_e | .27892564
rho | .9488037 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(2, 21) = 6.09 Prob > F = 0.0082
.
.
Comment