I have an unbalanced panel dataset. When I do the following regression, Stata produces output without any error:
But when I include a lagged version of extdebtGDP, Stata shows the following error:
In a previous related post, I saw Dr. Nick Cox mentioning that string variables/missing observations may cause this error.
Any help will be highly appreciated. Thanks.
Code:
xtreg rgdpgrowth sxp sxp2 extdebtGDP i.year, fe vce(robust) Fixed-effects (within) regression Number of obs = 315 Group variable: country Number of groups = 65 R-sq: within = 0.1066 Obs per group: min = 3 between = 0.1082 avg = 4.8 overall = 0.1036 max = 5 F(7,64) = 5.88 corr(u_i, Xb) = 0.0506 Prob > F = 0.0000 (Std. Err. adjusted for 65 clusters in country) ------------------------------------------------------------------------------ | Robust rgdpgrowth | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- sxp | -.043291 .097015 -0.45 0.657 -.2371007 .1505187 sxp2 | .0285514 .1760005 0.16 0.872 -.32305 .3801529 extdebtGDP | -.0000597 .0000177 -3.38 0.001 -.000095 -.0000245 | year | 1980 | -.0117597 .0054863 -2.14 0.036 -.0227198 -.0007996 1985 | -.0206939 .0057291 -3.61 0.001 -.0321392 -.0092487 1990 | -.0123391 .005445 -2.27 0.027 -.0232167 -.0014615 1995 | -.01004 .0051349 -1.96 0.055 -.0202981 .0002182 | _cons | .0297318 .010096 2.94 0.004 .0095628 .0499008 -------------+---------------------------------------------------------------- sigma_u | .0212606 sigma_e | .02712922 rho | .38047986 (fraction of variance due to u_i) ------------------------------------------------------------------------------
Code:
xtreg rgdpgrowth sxp sxp2 extdebtGDP L.extdebtGDP i.year, fe vce(robust) no observations r(2000);
Code:
count if !missing( rgdpgrowth, sxp, sxp2, extdebtGDP) 315 . count if !missing( rgdpgrowth, sxp, sxp2, extdebtGDP, L.extdebtGDP) 0 xtdes country: 1, 2, ..., 104 n = 65 year: 1975, 1980, ..., 1995 T = 5 Delta(year) = 1 unit Span(year) = 21 periods (country*year uniquely identifies each observation) Distribution of T_i: min 5% 25% 50% 75% 95% max 3 4 5 5 5 5 5 Freq. Percent Cum. | Pattern* ---------------------------+---------- 60 92.31 92.31 | 11111 3 4.62 96.92 | ..111 2 3.08 100.00 | .1111 ---------------------------+---------- 65 100.00 | XXXXX -------------------------------------- *Each column represents 5 periods.
Comment