Meghna:
-xtset-ting data with -timevar- is mandatory if you plan to use, say, lags and leads. If time series commands are not part of your research strategy, you can safely skip -xtset-ting with -timevar-, as you can see from the following toy-example:
-xtset-ting data with -timevar- is mandatory if you plan to use, say, lags and leads. If time series commands are not part of your research strategy, you can safely skip -xtset-ting with -timevar-, as you can see from the following toy-example:
Code:
. use "http://www.stata-press.com/data/r15/nlswork.dta"
(National Longitudinal Survey. Young Women 14-26 years of age in 1968)
. xtset idcode
panel variable: idcode (unbalanced)
. xtreg ln_wage age i.year
Random-effects GLS regression Number of obs = 28,510
Group variable: idcode Number of groups = 4,710
R-sq: Obs per group:
within = 0.1060 min = 1
between = 0.0918 avg = 6.1
overall = 0.0807 max = 15
Wald chi2(15) = 3253.70
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
------------------------------------------------------------------------------
ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .0137208 .0018898 7.26 0.000 .0100169 .0174247
|
year |
69 | .0744312 .012506 5.95 0.000 .0499199 .0989425
70 | .0453659 .0120494 3.77 0.000 .0217496 .0689822
71 | .0819949 .0125373 6.54 0.000 .0574222 .1065676
72 | .0827461 .0136074 6.08 0.000 .056076 .1094162
73 | .0840751 .0143598 5.85 0.000 .0559304 .1122198
75 | .0707387 .0167492 4.22 0.000 .0379108 .1035665
77 | .1032639 .0197156 5.24 0.000 .064622 .1419059
78 | .1279039 .0214888 5.95 0.000 .0857866 .1700211
80 | .108871 .0247933 4.39 0.000 .060277 .157465
82 | .098831 .0280824 3.52 0.000 .0437906 .1538714
83 | .1127655 .0298539 3.78 0.000 .0542529 .1712781
85 | .1380611 .0333412 4.14 0.000 .0727135 .2034087
87 | .1264818 .0369222 3.43 0.001 .0541156 .198848
88 | .1640382 .0393563 4.17 0.000 .0869012 .2411752
|
_cons | 1.162473 .03784 30.72 0.000 1.088308 1.236638
-------------+----------------------------------------------------------------
sigma_u | .36664367
sigma_e | .30300411
rho | .59418375 (fraction of variance due to u_i)
------------------------------------------------------------------------------
. xtset idcode year
panel variable: idcode (unbalanced)
time variable: year, 68 to 88, but with gaps
delta: 1 unit
. xtreg ln_wage age i.year
Random-effects GLS regression Number of obs = 28,510
Group variable: idcode Number of groups = 4,710
R-sq: Obs per group:
within = 0.1060 min = 1
between = 0.0918 avg = 6.1
overall = 0.0807 max = 15
Wald chi2(15) = 3253.70
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
------------------------------------------------------------------------------
ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
age | .0137208 .0018898 7.26 0.000 .0100169 .0174247
|
year |
69 | .0744312 .012506 5.95 0.000 .0499199 .0989425
70 | .0453659 .0120494 3.77 0.000 .0217496 .0689822
71 | .0819949 .0125373 6.54 0.000 .0574222 .1065676
72 | .0827461 .0136074 6.08 0.000 .056076 .1094162
73 | .0840751 .0143598 5.85 0.000 .0559304 .1122198
75 | .0707387 .0167492 4.22 0.000 .0379108 .1035665
77 | .1032639 .0197156 5.24 0.000 .064622 .1419059
78 | .1279039 .0214888 5.95 0.000 .0857866 .1700211
80 | .108871 .0247933 4.39 0.000 .060277 .157465
82 | .098831 .0280824 3.52 0.000 .0437906 .1538714
83 | .1127655 .0298539 3.78 0.000 .0542529 .1712781
85 | .1380611 .0333412 4.14 0.000 .0727135 .2034087
87 | .1264818 .0369222 3.43 0.001 .0541156 .198848
88 | .1640382 .0393563 4.17 0.000 .0869012 .2411752
|
_cons | 1.162473 .03784 30.72 0.000 1.088308 1.236638
-------------+----------------------------------------------------------------
sigma_u | .36664367
sigma_e | .30300411
rho | .59418375 (fraction of variance due to u_i)
------------------------------------------------------------------------------
.

Comment