-------------------------------------------------------------------------------------------------------- log: C:\UpCD1\WORK\Stata\panel_2.log log type: text opened on: 17 Sep 2003, 01:37:10 . . set more off . set matsize 800 . . ********************************* . * xtdata * . ********************************* . . use xtdatasmpl.dta,clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . * use http://www.stata-press.com/data/r8/xtdatasmpl, clear . . ** 1. use "xtdata" to convert the data into a form suitable for between estimation . . xtdata ln_w grade age* ttl_exp* tenure* black not_smsa south, be clear . regress ln_w grade age* ttl_exp* tenure* black not_smsa south Source | SS df MS Number of obs = 4697 -------------+------------------------------ F( 10, 4686) = 450.23 Model | 415.021613 10 41.5021613 Prob > F = 0.0000 Residual | 431.954995 4686 .092179896 R-squared = 0.4900 -------------+------------------------------ Adj R-squared = 0.4889 Total | 846.976608 4696 .180361288 Root MSE = .30361 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0607602 .0020006 30.37 0.000 .0568382 .0646822 age | .0323158 .0087251 3.70 0.000 .0152105 .0494211 age2 | -.0005997 .0001429 -4.20 0.000 -.0008799 -.0003194 ttl_exp | .0138853 .0056749 2.45 0.014 .0027598 .0250108 ttl_exp2 | .0007342 .0003267 2.25 0.025 .0000936 .0013747 tenure | .0698419 .0060729 11.50 0.000 .0579361 .0817476 tenure2 | -.0028756 .0004098 -7.02 0.000 -.0036789 -.0020722 black | -.0564167 .0105131 -5.37 0.000 -.0770272 -.0358061 not_smsa | -.1860406 .0112495 -16.54 0.000 -.2080949 -.1639862 south | -.0993378 .010136 -9.80 0.000 -.1192091 -.0794665 _cons | .3339113 .1210434 2.76 0.006 .0966093 .5712133 ------------------------------------------------------------------------------ . . * compare the above results to those from using "xtreg, be" . xtreg ln_w grade age* ttl_exp* tenure* black not_smsa south, be Between regression (regression on group means) Number of obs = 4697 Group variable (i): idcode Number of groups = 4697 R-sq: within = . Obs per group: min = 1 between = 0.4900 avg = 1.0 overall = 0.4900 max = 1 F(10,4686) = 450.23 sd(u_i + avg(e_i.))= .3036114 Prob > F = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0607602 .0020006 30.37 0.000 .0568382 .0646822 age | .0323158 .0087251 3.70 0.000 .0152105 .0494211 age2 | -.0005997 .0001429 -4.20 0.000 -.0008799 -.0003194 ttl_exp | .0138853 .0056749 2.45 0.014 .0027598 .0250108 ttl_exp2 | .0007342 .0003267 2.25 0.025 .0000936 .0013747 tenure | .0698419 .0060729 11.50 0.000 .0579361 .0817476 tenure2 | -.0028756 .0004098 -7.02 0.000 -.0036789 -.0020722 black | -.0564167 .0105131 -5.37 0.000 -.0770272 -.0358061 not_smsa | -.1860406 .0112495 -16.54 0.000 -.2080949 -.1639862 south | -.0993378 .010136 -9.80 0.000 -.1192091 -.0794665 _cons | .3339113 .1210434 2.76 0.006 .0966093 .5712133 ------------------------------------------------------------------------------ . . ** use "xtdata" to convert the data into a form suitable for fixed-effects(within) estimation . use xtdatasmpl.dta,clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . xtdata ln_w grade age* ttl_exp* tenure* black not_smsa south, fe i(idcode) clear . regress ln_w grade age* ttl_exp* tenure* black not_smsa south Source | SS df MS Number of obs = 28091 -------------+------------------------------ F( 9, 28081) = 651.21 Model | 412.443881 9 45.8270979 Prob > F = 0.0000 Residual | 1976.12232 28081 .07037222 R-squared = 0.1727 -------------+------------------------------ Adj R-squared = 0.1724 Total | 2388.5662 28090 .085032617 Root MSE = .26528 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | -.0147384 4.97e+08 -0.00 1.000 -9.75e+08 9.75e+08 age | .0359987 .0030904 11.65 0.000 .0299414 .0420559 age2 | -.000723 .0000486 -14.88 0.000 -.0008183 -.0006277 ttl_exp | .0334668 .0027061 12.37 0.000 .0281626 .0387709 ttl_exp2 | .0002163 .0001166 1.86 0.064 -.0000122 .0004448 tenure | .0357539 .0016871 21.19 0.000 .0324471 .0390607 tenure2 | -.0019701 .0001141 -17.27 0.000 -.0021937 -.0017465 black | (dropped) not_smsa | -.0890108 .0086984 -10.23 0.000 -.10606 -.0719616 south | -.0606309 .0099763 -6.08 0.000 -.0801849 -.0410769 _cons | 1.222086 6.23e+09 0.00 1.000 -1.22e+10 1.22e+10 ------------------------------------------------------------------------------ . . * compare the above results to those from using "xtreg, fe" . xtreg ln_w grade age* ttl_exp* tenure* black not_smsa south, fe i(idcode) Fixed-effects (within) regression Number of obs = 28091 Group variable (i): idcode Number of groups = 4697 R-sq: within = 0.1727 Obs per group: min = 1 between = 1.0000 avg = 6.0 overall = 0.1727 max = 15 F(9,23385) = 542.31 corr(u_i, Xb) = -0.0000 Prob > F = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | -.0147045 5.45e+08 -0.00 1.000 -1.07e+09 1.07e+09 age | .0359987 .0033865 10.63 0.000 .029361 .0426364 age2 | -.000723 .0000533 -13.57 0.000 -.0008274 -.0006186 ttl_exp | .0334668 .0029654 11.29 0.000 .0276544 .0392792 ttl_exp2 | .0002163 .0001277 1.69 0.090 -.0000341 .0004666 tenure | .0357539 .0018487 19.34 0.000 .0321303 .0393775 tenure2 | -.0019701 .000125 -15.76 0.000 -.0022151 -.0017251 black | (dropped) not_smsa | -.0890108 .0095318 -9.34 0.000 -.1076937 -.0703278 south | -.0606309 .0109322 -5.55 0.000 -.0820587 -.0392031 _cons | 1.221661 6.83e+09 0.00 1.000 -1.34e+10 1.34e+10 -------------+---------------------------------------------------------------- sigma_u | 2.515e-16 sigma_e | .29069544 rho | 7.486e-31 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(4696, 23385) = 0.00 Prob > F = 1.0000 . . ** use "xtdata" to convert the data into a form suitable for random-effects estimation . use xtdatasmpl.dta,clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . . ** ratio is specified to be 1; this is for specification-search purposes only . xtdata ln_w grade age* ttl_exp* tenure* black not_smsa south, re ratio(1) clear ------------------- theta -------------------- min 5% median 95% max 0.2929 0.2929 0.5918 0.7327 0.7500 . regress ln_w grade age* ttl_exp* tenure* black not_smsa south constant, nocons Source | SS df MS Number of obs = 28091 -------------+------------------------------ F( 11, 28080) =12199.10 Model | 11013.4159 11 1001.21963 Prob > F = 0.0000 Residual | 2304.61575 28080 .08207321 R-squared = 0.8270 -------------+------------------------------ Adj R-squared = 0.8269 Total | 13318.0317 28091 .474103154 Root MSE = .28648 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0647654 .0019226 33.69 0.000 .0609969 .0685339 age | .0366761 .0031105 11.79 0.000 .0305793 .0427728 age2 | -.0007139 .0000498 -14.35 0.000 -.0008114 -.0006163 ttl_exp | .0295892 .0024477 12.09 0.000 .0247917 .0343867 ttl_exp2 | .0002932 .0001161 2.53 0.012 .0000657 .0005208 tenure | .0387401 .0017448 22.20 0.000 .0353201 .04216 tenure2 | -.0019988 .0001185 -16.87 0.000 -.0022311 -.0017665 black | -.0522963 .0108232 -4.83 0.000 -.0735103 -.0310824 not_smsa | -.1263693 .0073596 -17.17 0.000 -.1407945 -.1119441 south | -.0848345 .0075739 -11.20 0.000 -.0996797 -.0699893 constant | .2375476 .0504018 4.71 0.000 .1387576 .3363375 ------------------------------------------------------------------------------ . . * compare the above results to those from using "xtreg, re" . xtreg ln_w grade age* ttl_exp* tenure* black not_smsa south, re Random-effects GLS regression Number of obs = 28091 Group variable (i): idcode Number of groups = 4697 R-sq: within = 0.1715 Obs per group: min = 1 between = 0.7084 avg = 6.0 overall = 0.3584 max = 15 Random effects u_i ~ Gaussian Wald chi2(10) = 15683.24 corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0687164 .0016906 40.65 0.000 .0654028 .07203 age | .0444851 .0019447 22.87 0.000 .0406735 .0482967 age2 | -.0008245 .0000344 -23.94 0.000 -.000892 -.000757 ttl_exp | .0249103 .0021784 11.44 0.000 .0206407 .0291799 ttl_exp2 | .0004746 .0001057 4.49 0.000 .0002675 .0006817 tenure | .0390086 .0017419 22.39 0.000 .0355945 .0424227 tenure2 | -.0020208 .0001183 -17.09 0.000 -.0022526 -.001789 black | -.0479652 .010765 -4.46 0.000 -.0690643 -.0268662 not_smsa | -.1253905 .0073494 -17.06 0.000 -.139795 -.110986 south | -.0843037 .0075698 -11.14 0.000 -.0991402 -.0694672 _cons | .0275956 .0062967 4.38 0.000 .0152543 .0399369 -------------+---------------------------------------------------------------- sigma_u | 0 sigma_e | .29068923 rho | 0 (fraction of variance due to u_i) ------------------------------------------------------------------------------ . . ** note: every time before using "xtdata", you have to use the original data. . . ********************************* . * xtcloglog * . ********************************* . . ** 2. try the command 'xtcloglog' . *webuse union.dta,clear . *save union.dta . . use union.dta, clear (NLS Women 14-24 in 1968) . * use http://www.stata-press.com/data/r8/union, clear . . iis idcode . tis year . . * There is no FE version of this model; a conditional likelihood function cannot be defined. . . ** random-effects model . xtcloglog union age grade not_smsa south southXt, re Fitting comparison model: Iteration 0: log likelihood = -13609.987 Iteration 1: log likelihood = -13544.321 Iteration 2: log likelihood = -13544.202 Iteration 3: log likelihood = -13544.202 Fitting full model: tau = 0.0 log likelihood = -13544.202 tau = 0.1 log likelihood = -12730.868 tau = 0.2 log likelihood = -12107.703 tau = 0.3 log likelihood = -11655.228 tau = 0.4 log likelihood = -11330.798 tau = 0.5 log likelihood = -11105.474 tau = 0.6 log likelihood = -10960.035 tau = 0.7 log likelihood = -10896.357 tau = 0.8 log likelihood = -10981.243 Iteration 0: log likelihood = -10896.357 Iteration 1: log likelihood = -10595.718 Iteration 2: log likelihood = -10562.157 Iteration 3: log likelihood = -10559.726 Iteration 4: log likelihood = -10559.721 Random-effects complementary log-log model Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 221.84 Log likelihood = -10559.721 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .011177 .0032236 3.47 0.001 .0048588 .0174952 grade | .0577535 .012636 4.57 0.000 .0329875 .0825195 not_smsa | -.2122413 .0613769 -3.46 0.001 -.3325379 -.0919447 south | -.8724097 .0851594 -10.24 0.000 -1.039319 -.7055004 southXt | .0173595 .0059679 2.91 0.004 .0056626 .0290564 _cons | -3.066854 .1816358 -16.88 0.000 -3.422853 -2.710854 -------------+---------------------------------------------------------------- /lnsig2u | 1.158696 .0392705 1.081727 1.235665 -------------+---------------------------------------------------------------- sigma_u | 1.784874 .0350464 1.717489 1.854903 rho | .659484 .0088188 .6419935 .6765506 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5968.96 Prob >= chibar2 = 0.000 . xtcloglog union age grade not_smsa south southXt, re quad(20) Fitting comparison model: Iteration 0: log likelihood = -13609.987 Iteration 1: log likelihood = -13544.321 Iteration 2: log likelihood = -13544.202 Iteration 3: log likelihood = -13544.202 Fitting full model: tau = 0.0 log likelihood = -13544.202 tau = 0.1 log likelihood = -12730.868 tau = 0.2 log likelihood = -12107.704 tau = 0.3 log likelihood = -11655.197 tau = 0.4 log likelihood = -11331.137 tau = 0.5 log likelihood = -11104.296 tau = 0.6 log likelihood = -10958.18 tau = 0.7 log likelihood = -10894.335 tau = 0.8 log likelihood = -10934.355 Iteration 0: log likelihood = -10894.335 Iteration 1: log likelihood = -10667.786 Iteration 2: log likelihood = -10543.99 Iteration 3: log likelihood = -10539.013 Iteration 4: log likelihood = -10538.933 Iteration 5: log likelihood = -10538.933 Random-effects complementary log-log model Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 259.91 Log likelihood = -10538.933 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0124529 .0032559 3.82 0.000 .0060714 .0188345 grade | .0715657 .013594 5.26 0.000 .0449219 .0982095 not_smsa | -.2011741 .066667 -3.02 0.003 -.331839 -.0705092 south | -.8978872 .0851752 -10.54 0.000 -1.064828 -.7309469 southXt | .0158295 .0059511 2.66 0.008 .0041656 .0274935 _cons | -3.32428 .1980964 -16.78 0.000 -3.712542 -2.936018 -------------+---------------------------------------------------------------- /lnsig2u | 1.185223 .0411645 1.104542 1.265904 -------------+---------------------------------------------------------------- sigma_u | 1.808706 .0372273 1.737194 1.883162 rho | .6654157 .0091648 .6472201 .6831323 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 6010.54 Prob >= chibar2 = 0.000 . . ** population-averaged model (xtgee) . xtcloglog union age grade not_smsa south southXt, pa Iteration 1: tolerance = .06580809 Iteration 2: tolerance = .00606963 Iteration 3: tolerance = .00032265 Iteration 4: tolerance = .00001658 Iteration 5: tolerance = 8.864e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: cloglog Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 232.44 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0045777 .0021754 2.10 0.035 .0003139 .0088415 grade | .0544267 .0095097 5.72 0.000 .035788 .0730654 not_smsa | -.1051731 .0430512 -2.44 0.015 -.189552 -.0207943 south | -.6578891 .061857 -10.64 0.000 -.7791266 -.5366515 southXt | .0142329 .004133 3.44 0.001 .0061325 .0223334 _cons | -2.074687 .1358008 -15.28 0.000 -2.340851 -1.808522 ------------------------------------------------------------------------------ . . ** population-averaged model with robust variance, clustering on 'i' . xtcloglog union age grade not_smsa south southXt, pa i(idcode) robust Iteration 1: tolerance = .06580809 Iteration 2: tolerance = .00606963 Iteration 3: tolerance = .00032265 Iteration 4: tolerance = .00001658 Iteration 5: tolerance = 8.864e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: cloglog Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 153.64 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0045777 .003261 1.40 0.160 -.0018138 .0109692 grade | .0544267 .0117512 4.63 0.000 .0313948 .0774585 not_smsa | -.1051731 .0548342 -1.92 0.055 -.2126462 .0022999 south | -.6578891 .0793619 -8.29 0.000 -.8134355 -.5023427 southXt | .0142329 .005975 2.38 0.017 .0025221 .0259438 _cons | -2.074687 .1770236 -11.72 0.000 -2.421647 -1.727727 ------------------------------------------------------------------------------ . . ** population-averaged model with 'xtgee' options . xtcloglog union age grade not_smsa south southXt, pa corr(exchangeable) Iteration 1: tolerance = .06580809 Iteration 2: tolerance = .00606963 Iteration 3: tolerance = .00032265 Iteration 4: tolerance = .00001658 Iteration 5: tolerance = 8.864e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: cloglog Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 232.44 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0045777 .0021754 2.10 0.035 .0003139 .0088415 grade | .0544267 .0095097 5.72 0.000 .035788 .0730654 not_smsa | -.1051731 .0430512 -2.44 0.015 -.189552 -.0207943 south | -.6578891 .061857 -10.64 0.000 -.7791266 -.5366515 southXt | .0142329 .004133 3.44 0.001 .0061325 .0223334 _cons | -2.074687 .1358008 -15.28 0.000 -2.340851 -1.808522 ------------------------------------------------------------------------------ . . ********************************* . * xtgee * . ********************************* . . * Population Averaged model (generalized linear model or Generalized Estimating Equations (GEEs)) . . * g[E(y(it)] = X(it)*b with y ~ specific dist. . * . * e.g., If logit[E(y(it)] = X(it)*b with y ~ Bernoulli, it's a logit model. . * Then, use link(logit), family(binomial) . * . * There is no convenient likelihood function. (Need to read more references.) . * . * This procedure allows to specify the within-group correlation structure for the panels. . * default: equal-correlation, corr(exchangeable) . * corr(ar1) can be estimated. No option for psar1. . * "xtcorr" gives the within=group correlations. . . * Note : xtgls can allow for cross-sectional correlation across panels, but this option is not . * available in xtgee. Instead, xtgls does not allow for the within-group correlation (except . * for autocorrelation with ar1 or psar1), but xtgee can allow for it. . . * Special cases (with balanced panels): Try these.. I have not compared them yet. . * . * xtgee, corr(independent) link(cloglog) => cloglog or xtcloglog . * xtgee, corr(independent) link(probit) => probit (but std errors are different) . * If the binomial denominator is not 1, it's bprobit. . * Further Note: blogit and bprobit produce maximum-likelihood logit and probit estimates on grouped > ("blocked") data; . * glogit and gprobit produce weighted least-squares estimates. . * xtgee with negative binomial (nbinomial) produces estimates conditional on alpha (correlation). . * nbreg gives unconditional estimates. . * xtgee with corr(independent) fits exponential regression (as in survival models) but . * not with censored data. . * . * xtgee, fam(gauss) link(iden) corr(exch) => xtreg, re or xtreg, mle . . use union.dta,clear (NLS Women 14-24 in 1968) . * use http://www.stata-press.com/data/r8/union, clear . . iis idcode . tis year . . xtgee union age grade not_smsa south southXt, family(gamma) link(log) corr(exchangeable) robust Iteration 1: tolerance = .05859218 Iteration 2: tolerance = .0085639 Iteration 3: tolerance = .001618 Iteration 4: tolerance = .00017937 Iteration 5: tolerance = .00004995 Iteration 6: tolerance = 7.447e-06 Iteration 7: tolerance = 1.672e-06 Iteration 8: tolerance = 2.854e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: log Obs per group: min = 1 Family: gamma avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 143.57 Scale parameter: 4.391803 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0036823 .0028376 1.30 0.194 -.0018794 .0092439 grade | .0345104 .0110255 3.13 0.002 .0129009 .05612 not_smsa | -.1289769 .0510485 -2.53 0.012 -.2290301 -.0289238 south | -.6392831 .0729972 -8.76 0.000 -.782355 -.4962111 southXt | .0154578 .0055608 2.78 0.005 .0045588 .0263569 _cons | -1.918936 .1601831 -11.98 0.000 -2.232889 -1.604983 ------------------------------------------------------------------------------ . xtgee union age grade not_smsa south southXt, family(poisson) link(log) corr(unstructured) Iteration 1: tolerance = .04205184 Iteration 2: tolerance = .00443338 Iteration 3: tolerance = .00030434 Iteration 4: tolerance = .0000217 Iteration 5: tolerance = 1.518e-06 Iteration 6: tolerance = 9.854e-08 GEE population-averaged model Number of obs = 26200 Group and time vars: idcode year Number of groups = 4434 Link: log Obs per group: min = 1 Family: Poisson avg = 5.9 Correlation: unstructured max = 12 Wald chi2(5) = 157.40 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0025773 .0029473 0.87 0.382 -.0031993 .0083538 grade | .0500646 .010061 4.98 0.000 .0303454 .0697838 not_smsa | -.1327027 .0461896 -2.87 0.004 -.2232327 -.0421727 south | -.5762813 .0724749 -7.95 0.000 -.7183296 -.4342331 southXt | .0129147 .0055435 2.33 0.020 .0020497 .0237798 _cons | -2.122967 .1525609 -13.92 0.000 -2.42198 -1.823953 ------------------------------------------------------------------------------ . xtgee union age grade not_smsa south southXt, family(poisson) link(identity) corr(unstructured) Iteration 1: tolerance = .01561732 Iteration 2: tolerance = .00418425 Iteration 3: tolerance = .00178011 Iteration 4: tolerance = .00054616 Iteration 5: tolerance = .00018262 Iteration 6: tolerance = .00005984 Iteration 7: tolerance = .00001968 Iteration 8: tolerance = 6.471e-06 Iteration 9: tolerance = 2.127e-06 Iteration 10: tolerance = 6.994e-07 GEE population-averaged model Number of obs = 26200 Group and time vars: idcode year Number of groups = 4434 Link: identity Obs per group: min = 1 Family: Poisson avg = 5.9 Correlation: unstructured max = 12 Wald chi2(5) = 175.04 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0006261 .000684 0.92 0.360 -.0007146 .0019667 grade | .0066404 .0019004 3.49 0.000 .0029156 .0103652 not_smsa | -.0284461 .0082645 -3.44 0.001 -.0446442 -.0122479 south | -.1025036 .0118844 -8.63 0.000 -.1257966 -.0792106 southXt | .0018116 .0009636 1.88 0.060 -.000077 .0037002 _cons | .1435138 .0310441 4.62 0.000 .0826684 .2043591 ------------------------------------------------------------------------------ . . . use nlswork2.dta, clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . * use http://www.stata-press.com/data/r8/nlswork2, clear . *webuse nlswork2.dta,clear . *save nlswork2.dta . . iis idcode . tis year . . gen age2 = age*age (9 missing values generated) . gen ttl_exp2 = ttl_exp*ttl_exp . gen tenure2 = tenure^2 (288 missing values generated) . . ** compare the results from 'regress' and 'xtgee' (using OLS) . regress ln_w grade age* ttl_exp* tenure* Source | SS df MS Number of obs = 15806 -------------+------------------------------ F( 7, 15798) = 873.90 Model | 784.617434 7 112.088205 Prob > F = 0.0000 Residual | 2026.28194 15798 .128261928 R-squared = 0.2791 -------------+------------------------------ Adj R-squared = 0.2788 Total | 2810.89937 15805 .177848742 Root MSE = .35814 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0669322 .0013817 48.44 0.000 .0642239 .0696404 age | .0624068 .0084539 7.38 0.000 .0458363 .0789773 age2 | -.00114 .0001662 -6.86 0.000 -.0014657 -.0008143 ttl_exp | .0335191 .0044229 7.58 0.000 .0248497 .0421885 ttl_exp2 | -.0012275 .0004328 -2.84 0.005 -.0020759 -.0003791 tenure | .0727969 .004216 17.27 0.000 .0645331 .0810607 tenure2 | -.0042758 .0004988 -8.57 0.000 -.0052535 -.0032981 _cons | -.2580366 .1032522 -2.50 0.012 -.4604227 -.0556504 ------------------------------------------------------------------------------ . xtgee ln_w grade age* ttl_exp* tenure*, corr(indep) nmp Iteration 1: tolerance = 1.583e-11 GEE population-averaged model Number of obs = 15806 Group variable: idcode Number of groups = 3898 Link: identity Obs per group: min = 1 Family: Gaussian avg = 4.1 Correlation: independent max = 9 Wald chi2(7) = 6117.31 Scale parameter: .1282619 Prob > chi2 = 0.0000 Pearson chi2(15798): 2026.28 Deviance = 2026.28 Dispersion (Pearson): .1282619 Dispersion = .1282619 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0669322 .0013817 48.44 0.000 .0642241 .0696402 age | .0624068 .0084539 7.38 0.000 .0458375 .0789761 age2 | -.00114 .0001662 -6.86 0.000 -.0014656 -.0008143 ttl_exp | .0335191 .0044229 7.58 0.000 .0248504 .0421878 ttl_exp2 | -.0012275 .0004328 -2.84 0.005 -.0020759 -.0003791 tenure | .0727969 .004216 17.27 0.000 .0645337 .08106 tenure2 | -.0042758 .0004988 -8.57 0.000 -.0052534 -.0032982 _cons | -.2580366 .1032522 -2.50 0.012 -.4604072 -.0556659 ------------------------------------------------------------------------------ . . xtgee ln_w grade age* ttl_exp* tenure*, corr(ar1) nmp note: observations not equally spaced modal spacing is delta year = 1 2621 groups omitted from estimation note: some groups have fewer than 2 observations not possible to estimate correlations for those groups 644 groups omitted from estimation Iteration 1: tolerance = .02235659 Iteration 2: tolerance = .00103114 Iteration 3: tolerance = .00002314 Iteration 4: tolerance = 5.114e-07 GEE population-averaged model Number of obs = 1825 Group and time vars: idcode year Number of groups = 633 Link: identity Obs per group: min = 2 Family: Gaussian avg = 2.9 Correlation: AR(1) max = 6 Wald chi2(7) = 505.82 Scale parameter: .1187094 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0648595 .0050737 12.78 0.000 .0549153 .0748037 age | .0724245 .0315999 2.29 0.022 .0104899 .134359 age2 | -.0013208 .0006273 -2.11 0.035 -.0025503 -.0000912 ttl_exp | .0410621 .01778 2.31 0.021 .0062139 .0759104 ttl_exp2 | -.0016911 .0020781 -0.81 0.416 -.0057641 .0023819 tenure | .0626719 .0157636 3.98 0.000 .0317759 .0935679 tenure2 | -.0049825 .0025073 -1.99 0.047 -.0098968 -.0000683 _cons | -.3282417 .3743031 -0.88 0.381 -1.061862 .4053789 ------------------------------------------------------------------------------ . xtgee ln_w grade age* ttl_exp* tenure*, fam(gamm) corr(indep) nmp Iteration 1: tolerance = 1.366e-11 GEE population-averaged model Number of obs = 15806 Group variable: idcode Number of groups = 3898 Link: reciprocal Obs per group: min = 1 Family: gamma avg = 4.1 Correlation: independent max = 9 Wald chi2(7) = 5827.82 Scale parameter: .054809 Prob > chi2 = 0.0000 Pearson chi2(15798): 865.87 Deviance = 1292.41 Dispersion (Pearson): .054809 Dispersion = .0818082 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | -.0259546 .0005543 -46.82 0.000 -.0270411 -.0248682 age | -.0318187 .0036587 -8.70 0.000 -.0389896 -.0246477 age2 | .0005974 .0000709 8.42 0.000 .0004584 .0007365 ttl_exp | -.0166006 .0018614 -8.92 0.000 -.0202488 -.0129524 ttl_exp2 | .0007156 .0001763 4.06 0.000 .00037 .0010612 tenure | -.0265776 .0016824 -15.80 0.000 -.0298749 -.0232802 tenure2 | .001669 .0001949 8.56 0.000 .0012869 .0020511 _cons | 1.453979 .0451509 32.20 0.000 1.365485 1.542473 ------------------------------------------------------------------------------ . xtgee ln_w grade age* ttl_exp* tenure*, fam(gamm) corr(ar2) note: observations not equally spaced modal spacing is delta year = 1 2621 groups omitted from estimation note: some groups have fewer than 3 observations not possible to estimate correlations for those groups 996 groups omitted from estimation Iteration 1: tolerance = .01298658 Iteration 2: tolerance = .00313937 Iteration 3: tolerance = .00003057 Iteration 4: tolerance = 5.570e-07 GEE population-averaged model Number of obs = 1121 Group and time vars: idcode year Number of groups = 281 Link: reciprocal Obs per group: min = 3 Family: gamma avg = 4.0 Correlation: AR(2) max = 6 Wald chi2(7) = 244.24 Scale parameter: .0347904 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | -.0225644 .0027904 -8.09 0.000 -.0280335 -.0170953 age | -.0582234 .022449 -2.59 0.009 -.1022226 -.0142242 age2 | .0011403 .0004803 2.37 0.018 .0001989 .0020817 ttl_exp | -.0112335 .0099362 -1.13 0.258 -.0307081 .0082412 ttl_exp2 | -.0000544 .0014825 -0.04 0.971 -.00296 .0028513 tenure | -.0316725 .0080456 -3.94 0.000 -.0474415 -.0159034 tenure2 | .0045429 .0016178 2.81 0.005 .0013721 .0077137 _cons | 1.6785 .2542094 6.60 0.000 1.180259 2.176741 ------------------------------------------------------------------------------ . xtgee ln_w grade age* ttl_exp* tenure*, fam(poisson) link(log) corr(unstructured) Iteration 1: tolerance = .01308632 Iteration 2: tolerance = .00042616 Iteration 3: tolerance = .00003787 Iteration 4: tolerance = 3.234e-06 Iteration 5: tolerance = 2.382e-07 GEE population-averaged model Number of obs = 15806 Group and time vars: idcode year Number of groups = 3898 Link: log Obs per group: min = 1 Family: Poisson avg = 4.1 Correlation: unstructured max = 9 Wald chi2(7) = 283.95 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0428987 .0044722 9.59 0.000 .0341332 .0516641 age | .0454121 .0204042 2.23 0.026 .0054207 .0854035 age2 | -.0008356 .0003954 -2.11 0.035 -.0016106 -.0000606 ttl_exp | .0269182 .0111836 2.41 0.016 .0049988 .0488376 ttl_exp2 | -.0008456 .001065 -0.79 0.427 -.002933 .0012419 tenure | .0301514 .0087457 3.45 0.001 .0130101 .0472927 tenure2 | -.0020345 .0010532 -1.93 0.053 -.0040988 .0000298 _cons | -.801206 .2544527 -3.15 0.002 -1.299924 -.3024879 ------------------------------------------------------------------------------ . xtgee ln_w grade age* ttl_exp* tenure*, fam(poisson) link(log) corr(stationary 2) note: observations not equally spaced modal spacing is delta year = 1 2621 groups omitted from estimation note: some groups have fewer than 3 observations not possible to estimate correlations for those groups 996 groups omitted from estimation Iteration 1: tolerance = .08705287 Iteration 2: tolerance = .0130549 Iteration 3: tolerance = .00046752 Iteration 4: tolerance = .00001952 Iteration 5: tolerance = 7.417e-07 GEE population-averaged model Number of obs = 1121 Group and time vars: idcode year Number of groups = 281 Link: log Obs per group: min = 3 Family: Poisson avg = 4.0 Correlation: stationary(2) max = 6 Wald chi2(7) = 14.16 Scale parameter: 1 Prob > chi2 = 0.0485 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- grade | .0379818 .0184497 2.06 0.040 .001821 .0741426 age | .08673 .1567687 0.55 0.580 -.220531 .393991 age2 | -.0016417 .0033716 -0.49 0.626 -.0082499 .0049665 ttl_exp | .0317206 .0691567 0.46 0.646 -.103824 .1672652 ttl_exp2 | -.002504 .010726 -0.23 0.815 -.0235265 .0185186 tenure | .0377867 .0510599 0.74 0.459 -.0622888 .1378623 tenure2 | -.004525 .0108386 -0.42 0.676 -.0257684 .0167183 _cons | -1.18801 1.762408 -0.67 0.500 -4.642265 2.266246 ------------------------------------------------------------------------------ . . use airacc.dta, clear . * use http://www.stata-press.com/data/r8/airacc, clear . . *webuse airacc.dta,clear . *save airacc.dta . . iis(airline) . tis(time) . . gen lnpm = ln(pmiles) . . xtgee i_cnt inprog, family(poisson) eform offset(lnpm) Iteration 1: tolerance = .02298383 Iteration 2: tolerance = .00011925 Iteration 3: tolerance = 5.292e-08 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: log Obs per group: min = 4 Family: Poisson avg = 4.0 Correlation: exchangeable max = 4 Wald chi2(1) = 5.27 Scale parameter: 1 Prob > chi2 = 0.0217 ------------------------------------------------------------------------------ i_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .9059936 .0389528 -2.30 0.022 .8327758 .9856487 lnpm | (offset) ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(gauss) corr(exchangeable) eform offset(lnpm) Iteration 1: tolerance = .12314952 Iteration 2: tolerance = .00027853 Iteration 3: tolerance = 6.663e-07 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: identity Obs per group: min = 4 Family: Gaussian avg = 4.0 Correlation: exchangeable max = 4 Wald chi2(1) = 0.47 Scale parameter: 62.1256 Prob > chi2 = 0.4928 ------------------------------------------------------------------------------ i_cnt | e^coef Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .2731176 .5167996 -0.69 0.493 .006694 11.14328 lnpm | (offset) ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(binomial) link(identity) corr(independent) eform offset(lnpm) Iteration 1: tolerance = 9.771e-15 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: identity Obs per group: min = 4 Family: binomial avg = 4.0 Correlation: independent max = 4 Wald chi2(0) = . Scale parameter: 1 Prob > chi2 = . Pearson chi2(80): 0.00 Deviance = -10.64 Dispersion (Pearson): 0 Dispersion = -.1329503 ------------------------------------------------------------------------------ i_cnt | e^coef Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .3515758 8.93e-14 . 0.000 .3515758 .3515758 lnpm | (offset) ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(igaussian) link(log) corr(unstructured) Iteration 1: tolerance = .03274706 Iteration 2: tolerance = .01098542 Iteration 3: tolerance = .00263043 Iteration 4: tolerance = .0005887 Iteration 5: tolerance = .00013062 Iteration 6: tolerance = .00002894 Iteration 7: tolerance = 6.413e-06 Iteration 8: tolerance = 1.421e-06 Iteration 9: tolerance = 3.149e-07 GEE population-averaged model Number of obs = 80 Group and time vars: airline time Number of groups = 20 Link: log Obs per group: min = 4 Family: inverse Gaussian avg = 4.0 Correlation: unstructured max = 4 Wald chi2(1) = 0.01 Scale parameter: .0044231 Prob > chi2 = 0.9273 ------------------------------------------------------------------------------ i_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .0058733 .0643313 0.09 0.927 -.1202137 .1319603 _cons | 3.190255 .0467536 68.24 0.000 3.098619 3.28189 ------------------------------------------------------------------------------ . ** xtgee i_cnt inprog, family(binomial) link(logit) corr(exchangeable) /* this line does not work, > error message: estimates diverging (missing predictions)*/ . . xtgee i_cnt inprog, family(gamma) link(reciprocal) corr(independent) Iteration 1: tolerance = 1.930e-14 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: reciprocal Obs per group: min = 4 Family: gamma avg = 4.0 Correlation: independent max = 4 Wald chi2(1) = 0.25 Scale parameter: .1098412 Prob > chi2 = 0.6154 Pearson chi2(80): 8.79 Deviance = 10.23 Dispersion (Pearson): .1098412 Dispersion = .1278837 ------------------------------------------------------------------------------ i_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .0018046 .0035922 0.50 0.615 -.005236 .0088452 _cons | .0413165 .0017827 23.18 0.000 .0378225 .0448106 ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(gauss) link(identity) corr(independent) rgf trace robust score(newscore1) beta: beta: inprog _cons -1.0129136 24.20339 Iteration 1: tolerance = 1.103e-15 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: identity Obs per group: min = 4 Family: Gaussian avg = 4.0 Correlation: independent max = 4 Wald chi2(1) = 0.32 Scale parameter: 63.23497 Prob > chi2 = 0.5696 Pearson chi2(80): 5058.80 Deviance = 5058.80 Dispersion (Pearson): 63.23497 Dispersion = 63.23497 (standard errors adjusted for clustering on airline) ------------------------------------------------------------------------------ | Semi-robust i_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | -1.012914 1.781382 -0.57 0.570 -4.504359 2.478532 _cons | 24.20339 1.315692 18.40 0.000 21.62468 26.7821 ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(gauss) link(power) robust Iteration 1: tolerance = .11532642 Iteration 2: tolerance = .00024372 Iteration 3: tolerance = 5.438e-07 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: power(1) Obs per group: min = 4 Family: Gaussian avg = 4.0 Correlation: exchangeable max = 4 Wald chi2(1) = 0.53 Scale parameter: 63.24545 Prob > chi2 = 0.4655 (standard errors adjusted for clustering on airline) ------------------------------------------------------------------------------ | Semi-robust i_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | -1.245604 1.706864 -0.73 0.466 -4.590996 2.099788 _cons | 24.26447 1.315631 18.44 0.000 21.68588 26.84306 ------------------------------------------------------------------------------ . xtgee i_cnt inprog, family(gauss) link(power) t(time) corr(stationary 2) robust Iteration 1: tolerance = .06474674 Iteration 2: tolerance = .00016788 Iteration 3: tolerance = 3.682e-07 GEE population-averaged model Number of obs = 80 Group and time vars: airline time Number of groups = 20 Link: power(1) Obs per group: min = 4 Family: Gaussian avg = 4.0 Correlation: stationary(2) max = 4 Wald chi2(1) = 0.37 Scale parameter: 63.24551 Prob > chi2 = 0.5441 (standard errors adjusted for clustering on airline) ------------------------------------------------------------------------------ | Semi-robust i_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | -.8822673 1.454238 -0.61 0.544 -3.732521 1.967986 _cons | 24.25419 1.236445 19.62 0.000 21.8308 26.67758 ------------------------------------------------------------------------------ . . ********************************* . * xtlogit * . ********************************* . . use union.dta, clear (NLS Women 14-24 in 1968) . * use http://www.stata-press.com/data/r8/union, clear . . iis idcode . tis year . . ** random-effects model . xtlogit union age grade not_smsa south southXt, re Fitting comparison model: Iteration 0: log likelihood = -13864.23 Iteration 1: log likelihood = -13550.511 Iteration 2: log likelihood = -13545.74 Iteration 3: log likelihood = -13545.736 Fitting full model: tau = 0.0 log likelihood = -13545.736 tau = 0.1 log likelihood = -12926.225 tau = 0.2 log likelihood = -12419.526 tau = 0.3 log likelihood = -12003.162 tau = 0.4 log likelihood = -11656.844 tau = 0.5 log likelihood = -11367.53 tau = 0.6 log likelihood = -11129.716 tau = 0.7 log likelihood = -10947.266 tau = 0.8 log likelihood = -10845.532 Iteration 0: log likelihood = -10947.266 Iteration 1: log likelihood = -10604.628 Iteration 2: log likelihood = -10557.905 Iteration 3: log likelihood = -10556.297 Iteration 4: log likelihood = -10556.294 Random-effects logistic regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 221.95 Log likelihood = -10556.294 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0092401 .0044368 2.08 0.037 .0005441 .0179361 grade | .0840066 .0181622 4.63 0.000 .0484094 .1196038 not_smsa | -.2574574 .0844771 -3.05 0.002 -.4230294 -.0918854 south | -1.152854 .1108294 -10.40 0.000 -1.370075 -.9356323 southXt | .0237933 .0078548 3.03 0.002 .0083982 .0391884 _cons | -3.25016 .2622898 -12.39 0.000 -3.764238 -2.736081 -------------+---------------------------------------------------------------- /lnsig2u | 1.669888 .0430016 1.585607 1.75417 -------------+---------------------------------------------------------------- sigma_u | 2.304685 .0495526 2.209582 2.403882 rho | .6175213 .0101565 .5974278 .6372209 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5978.89 Prob >= chibar2 = 0.000 . . quadchk Refitting model quad() = 8 Iteration 0: log likelihood = -10575.225 Iteration 1: log likelihood = -10572.654 Iteration 2: log likelihood = -10572.636 Iteration 3: log likelihood = -10572.636 Random-effects logistic regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 238.20 Log likelihood = -10572.636 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0098812 .004394 2.25 0.025 .001269 .0184933 grade | .106588 .0177167 6.02 0.000 .0718639 .141312 not_smsa | -.2396422 .0787869 -3.04 0.002 -.3940616 -.0852227 south | -1.114874 .1070427 -10.42 0.000 -1.324674 -.9050744 southXt | .0220438 .0077966 2.83 0.005 .0067626 .0373249 _cons | -3.49539 .2581937 -13.54 0.000 -4.001441 -2.98934 -------------+---------------------------------------------------------------- /lnsig2u | 1.615656 .042297 1.532756 1.698557 -------------+---------------------------------------------------------------- sigma_u | 2.243031 .0474367 2.151957 2.337959 rho | .6046333 .0101112 .5846539 .6242693 ------------------------------------------------------------------------------ Refitting model quad() = 16 Iteration 0: log likelihood = -10548.541 Iteration 1: log likelihood = -10547.917 Iteration 2: log likelihood = -10547.917 Random-effects logistic regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 221.46 Log likelihood = -10547.917 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .009164 .0044567 2.06 0.040 .000429 .0178991 grade | .0755541 .0174202 4.34 0.000 .041411 .1096971 not_smsa | -.2664507 .0822027 -3.24 0.001 -.427565 -.1053363 south | -1.177212 .1120548 -10.51 0.000 -1.396836 -.9575889 southXt | .023661 .007855 3.01 0.003 .0082655 .0390564 _cons | -3.176926 .2538795 -12.51 0.000 -3.674521 -2.679332 -------------+---------------------------------------------------------------- /lnsig2u | 1.702013 .0440343 1.615707 1.788318 -------------+---------------------------------------------------------------- sigma_u | 2.342002 .0515642 2.243088 2.445279 rho | .6250796 .0103197 .6046455 .6450774 ------------------------------------------------------------------------------ Quadrature check Fitted Comparison Comparison quadrature quadrature quadrature 12 points 8 points 16 points ----------------------------------------------------- Log -10556.294 -10572.636 -10547.917 likelihood -16.342507 8.3767469 Difference .00154813 -.00079353 Relative difference ----------------------------------------------------- union: .00924011 .00988115 .00916404 age .00064104 -.00007607 Difference .0693755 -.00823256 Relative difference ----------------------------------------------------- union: .08400659 .10658796 .07555405 grade .02258136 -.00845254 Difference .26880465 -.10061763 Relative difference ----------------------------------------------------- union: -.25745741 -.23964215 -.26645066 not_smsa .01781526 -.00899325 Difference -.06919693 .03493101 Relative difference ----------------------------------------------------- union: -1.1528539 -1.1148743 -1.1772123 south .03797957 -.02435849 Difference -.03294396 .02112887 Relative difference ----------------------------------------------------- union: .02379331 .02204377 .02366098 southXt -.00174955 -.00013233 Difference -.07353102 -.00556171 Relative difference ----------------------------------------------------- union: -3.2501596 -3.4953905 -3.1769265 _cons -.24523084 .07323315 Difference .07545194 -.02253217 Relative difference ----------------------------------------------------- lnsig2u: 1.6698883 1.6156561 1.7020126 _cons -.05423212 .03212434 Difference -.0324765 .01923742 Relative difference ----------------------------------------------------- . * # of points to use in the quadrature approximation of the integral (this checkup is important.) . . xtlogit union age grade not_smsa south southXt, re offset(age) Fitting comparison model: Iteration 0: log likelihood = -63634.697 Iteration 1: log likelihood = -16912.216 Iteration 2: log likelihood = -13574.166 Iteration 3: log likelihood = -13545.837 Iteration 4: log likelihood = -13545.736 Iteration 5: log likelihood = -13545.736 Fitting full model: tau = 0.0 log likelihood = -13545.736 tau = 0.1 log likelihood = -12926.225 tau = 0.2 log likelihood = -12419.526 tau = 0.3 log likelihood = -12003.162 tau = 0.4 log likelihood = -11656.844 tau = 0.5 log likelihood = -11367.53 tau = 0.6 log likelihood = -11129.716 tau = 0.7 log likelihood = -10947.266 tau = 0.8 log likelihood = -10845.532 Iteration 0: log likelihood = -10947.266 Iteration 1: log likelihood = -10604.628 Iteration 2: log likelihood = -10557.905 Iteration 3: log likelihood = -10556.297 Iteration 4: log likelihood = -10556.294 Random-effects logistic regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 74466.29 Log likelihood = -10556.294 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.9907599 .0044368 -223.30 0.000 -.9994559 -.9820639 grade | .0840066 .0181622 4.63 0.000 .0484094 .1196038 not_smsa | -.2574574 .0844771 -3.05 0.002 -.4230294 -.0918854 south | -1.152854 .1108294 -10.40 0.000 -1.370075 -.9356323 southXt | .0237933 .0078548 3.03 0.002 .0083982 .0391884 _cons | -3.25016 .2622898 -12.39 0.000 -3.764238 -2.736081 age | (offset) -------------+---------------------------------------------------------------- /lnsig2u | 1.669888 .0430016 1.585607 1.75417 -------------+---------------------------------------------------------------- sigma_u | 2.304685 .0495526 2.209582 2.403882 rho | .6175213 .0101565 .5974278 .6372209 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5978.89 Prob >= chibar2 = 0.000 . * the coeff of age = 1 (restricted) . . ** conditional fixed-effects model . xtlogit union age grade not_smsa south southXt, fe nolog note: multiple positive outcomes within groups encountered. note: 2744 groups (14165 obs) dropped due to all positive or all negative outcomes. Conditional fixed-effects logistic regression Number of obs = 12035 Group variable (i): idcode Number of groups = 1690 Obs per group: min = 2 avg = 7.1 max = 12 LR chi2(5) = 78.16 Log likelihood = -4511.1042 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0079706 .0050283 1.59 0.113 -.0018848 .0178259 grade | .0811808 .0419137 1.94 0.053 -.0009686 .1633302 not_smsa | .0210368 .113154 0.19 0.853 -.2007411 .2428146 south | -1.007318 .1500491 -6.71 0.000 -1.301409 -.7132271 southXt | .0263495 .0083244 3.17 0.002 .010034 .0426649 ------------------------------------------------------------------------------ . xtlogit union age grade not_smsa south southXt, fe noskip note: multiple positive outcomes within groups encountered. note: 2744 groups (14165 obs) dropped due to all positive or all negative outcomes. Iteration 0: log likelihood = -4541.9044 Iteration 1: log likelihood = -4511.1353 Iteration 2: log likelihood = -4511.1042 Conditional fixed-effects logistic regression Number of obs = 12035 Group variable (i): idcode Number of groups = 1690 Obs per group: min = 2 avg = 7.1 max = 12 LR chi2(5) = 78.16 Log likelihood = -4511.1042 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0079706 .0050283 1.59 0.113 -.0018848 .0178259 grade | .0811808 .0419137 1.94 0.053 -.0009686 .1633302 not_smsa | .0210368 .113154 0.19 0.853 -.2007411 .2428146 south | -1.007318 .1500491 -6.71 0.000 -1.301409 -.7132271 southXt | .0263495 .0083244 3.17 0.002 .010034 .0426649 ------------------------------------------------------------------------------ . xtlogit union age grade not_smsa south southXt, fe offset(grade) nolog note: multiple positive outcomes within groups encountered. note: 2744 groups (14165 obs) dropped due to all positive or all negative outcomes. Conditional fixed-effects logistic regression Number of obs = 12035 Group variable (i): idcode Number of groups = 1690 Obs per group: min = 2 avg = 7.1 max = 12 LR chi2(5) = 452.49 Log likelihood = -4511.1042 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0079706 .0050283 1.59 0.113 -.0018848 .0178259 grade | -.9188192 .0419138 -21.92 0.000 -1.000969 -.8366697 not_smsa | .0210368 .1131542 0.19 0.853 -.2007414 .242815 south | -1.007318 .1500498 -6.71 0.000 -1.30141 -.7132256 southXt | .0263495 .0083244 3.17 0.002 .010034 .042665 grade | (offset) ------------------------------------------------------------------------------ . . ** population-averaged model . xtlogit union age grade not_smsa south southXt, pa eform Iteration 1: tolerance = .07495101 Iteration 2: tolerance = .00626455 Iteration 3: tolerance = .00030986 Iteration 4: tolerance = .00001432 Iteration 5: tolerance = 6.699e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 233.60 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.005338 .0025121 2.13 0.033 1.000427 1.010274 grade | 1.061314 .0114952 5.49 0.000 1.039021 1.084085 not_smsa | .8847099 .0427436 -2.54 0.011 .8047781 .9725806 south | .4833152 .032649 -10.76 0.000 .4233796 .5517355 southXt | 1.015314 .0046284 3.33 0.001 1.006283 1.024427 ------------------------------------------------------------------------------ . xtlogit union age grade not_smsa south southXt, pa robust Iteration 1: tolerance = .07495101 Iteration 2: tolerance = .00626455 Iteration 3: tolerance = .00030986 Iteration 4: tolerance = .00001432 Iteration 5: tolerance = 6.699e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 152.01 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0053241 .0037494 1.42 0.156 -.0020246 .0126727 grade | .0595076 .0133482 4.46 0.000 .0333455 .0856697 not_smsa | -.1224955 .0613646 -2.00 0.046 -.2427678 -.0022232 south | -.7270863 .0870278 -8.35 0.000 -.8976577 -.5565149 southXt | .0151984 .006613 2.30 0.022 .0022371 .0281596 _cons | -2.01111 .2016405 -9.97 0.000 -2.406319 -1.615902 ------------------------------------------------------------------------------ . * Huber & White sandwich estimator of variance . . xtlogit union age grade not_smsa south southXt, pa offset(grade) eform Iteration 1: tolerance = .07495101 Iteration 2: tolerance = .00626455 Iteration 3: tolerance = .00030986 Iteration 4: tolerance = .00001432 Iteration 5: tolerance = 6.699e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 7745.30 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.005338 .0025121 2.13 0.033 1.000427 1.010274 grade | .3904355 .0042288 -86.83 0.000 .3822345 .3988125 not_smsa | .8847099 .0427436 -2.54 0.011 .8047781 .9725806 south | .4833152 .032649 -10.76 0.000 .4233796 .5517355 southXt | 1.015314 .0046284 3.33 0.001 1.006283 1.024427 grade | (offset) ------------------------------------------------------------------------------ . xtlogit union age grade not_smsa south southXt, pa offset(grade) robust Iteration 1: tolerance = .07495101 Iteration 2: tolerance = .00626455 Iteration 3: tolerance = .00030986 Iteration 4: tolerance = .00001432 Iteration 5: tolerance = 6.699e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 5026.30 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0053241 .0037494 1.42 0.156 -.0020246 .0126727 grade | -.9404924 .0133482 -70.46 0.000 -.9666545 -.9143303 not_smsa | -.1224955 .0613646 -2.00 0.046 -.2427678 -.0022232 south | -.7270863 .0870278 -8.35 0.000 -.8976577 -.5565149 southXt | .0151984 .006613 2.30 0.022 .0022371 .0281596 _cons | -2.01111 .2016405 -9.97 0.000 -2.406319 -1.615902 grade | (offset) ------------------------------------------------------------------------------ . . xtlogit union age grade not_smsa south southXt, pa nolog or robust GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 152.01 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.005338 .0037694 1.42 0.156 .9979774 1.012753 grade | 1.061314 .0141667 4.46 0.000 1.033908 1.089446 not_smsa | .8847099 .0542898 -2.00 0.046 .7844536 .9977793 south | .4833152 .0420619 -8.35 0.000 .4075231 .5732033 southXt | 1.015314 .0067143 2.30 0.022 1.00224 1.02856 ------------------------------------------------------------------------------ . /* "or" the estimated coefficients are transformed to odds ratios: i.e., exp(b) is reported. */ . . xtlogit union age grade not_smsa south southXt, pa nolog robust GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 152.01 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0053241 .0037494 1.42 0.156 -.0020246 .0126727 grade | .0595076 .0133482 4.46 0.000 .0333455 .0856697 not_smsa | -.1224955 .0613646 -2.00 0.046 -.2427678 -.0022232 south | -.7270863 .0870278 -8.35 0.000 -.8976577 -.5565149 southXt | .0151984 .006613 2.30 0.022 .0022371 .0281596 _cons | -2.01111 .2016405 -9.97 0.000 -2.406319 -1.615902 ------------------------------------------------------------------------------ . . ** compare the results to 'xtgee' . xtgee union age grade not_smsa south southXt, nolog robust family(binomial) link(logit) corr(exchangea > ble) GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: logit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 152.01 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0053241 .0037494 1.42 0.156 -.0020246 .0126727 grade | .0595076 .0133482 4.46 0.000 .0333455 .0856697 not_smsa | -.1224955 .0613646 -2.00 0.046 -.2427678 -.0022232 south | -.7270863 .0870278 -8.35 0.000 -.8976577 -.5565149 southXt | .0151984 .006613 2.30 0.022 .0022371 .0281596 _cons | -2.01111 .2016405 -9.97 0.000 -2.406319 -1.615902 ------------------------------------------------------------------------------ . . . ********************************* . * xtprobit * . ********************************* . . * There is no FE model for this. One may ne tempted to use probit using dummy variables, . * but the resulting estimator is biased. . . use union.dta,clear (NLS Women 14-24 in 1968) . * use http://www.stata-press.com/data/r8/union, clear . . iis idcode . tis year . . ** random-effects model . xtprobit union age grade not_smsa south southXt, re nolog Random-effects probit regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 218.90 Log likelihood = -10561.065 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0044483 .0025027 1.78 0.076 -.000457 .0093535 grade | .0482482 .0100413 4.80 0.000 .0285677 .0679287 not_smsa | -.1370699 .0462961 -2.96 0.003 -.2278087 -.0463312 south | -.6305824 .0614827 -10.26 0.000 -.7510863 -.5100785 southXt | .0131853 .0043819 3.01 0.003 .004597 .0217737 _cons | -1.846838 .1458222 -12.67 0.000 -2.132644 -1.561032 -------------+---------------------------------------------------------------- /lnsig2u | .5612193 .0431875 .4765733 .6458653 -------------+---------------------------------------------------------------- sigma_u | 1.323937 .0285888 1.269073 1.381172 rho | .6367346 .0099894 .6169384 .6560781 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5972.49 Prob >= chibar2 = 0.000 . . quadchk Refitting model quad() = 8 Iteration 0: log likelihood = -10576.986 Iteration 1: log likelihood = -10574.784 Iteration 2: log likelihood = -10574.78 Random-effects probit regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 243.69 Log likelihood = -10574.78 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0047894 .0024844 1.93 0.054 -.0000798 .0096587 grade | .0562953 .0097119 5.80 0.000 .0372603 .0753302 not_smsa | -.1314541 .0442808 -2.97 0.003 -.2182428 -.0446654 south | -.6230965 .0592539 -10.52 0.000 -.739232 -.5069611 southXt | .0119443 .0043294 2.76 0.006 .0034589 .0204298 _cons | -1.930642 .1418695 -13.61 0.000 -2.208701 -1.652583 -------------+---------------------------------------------------------------- /lnsig2u | .4907899 .0397062 .4129672 .5686126 -------------+---------------------------------------------------------------- sigma_u | 1.278126 .0253748 1.229348 1.32884 rho | .6202925 .009352 .6017991 .638443 ------------------------------------------------------------------------------ Refitting model quad() = 16 Iteration 0: log likelihood = -10556.147 Iteration 1: log likelihood = -10555.853 Iteration 2: log likelihood = -10555.853 Random-effects probit regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 216.83 Log likelihood = -10555.853 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0045112 .0025082 1.80 0.072 -.0004047 .0094271 grade | .0441108 .0099037 4.45 0.000 .0247 .0635216 not_smsa | -.141098 .046045 -3.06 0.002 -.2313444 -.0508515 south | -.6454697 .0621128 -10.39 0.000 -.7672086 -.5237308 southXt | .0134172 .0043892 3.06 0.002 .0048146 .0220199 _cons | -1.806685 .1443166 -12.52 0.000 -2.089541 -1.52383 -------------+---------------------------------------------------------------- /lnsig2u | .5808096 .0438762 .4948138 .6668055 -------------+---------------------------------------------------------------- sigma_u | 1.336969 .0293306 1.2807 1.395709 rho | .6412537 .0100936 .6212398 .6607875 ------------------------------------------------------------------------------ Quadrature check Fitted Comparison Comparison quadrature quadrature quadrature 12 points 8 points 16 points ----------------------------------------------------- Log -10561.065 -10574.78 -10555.853 likelihood -13.714764 5.2126898 Difference .00129862 -.00049358 Relative difference ----------------------------------------------------- union: .00444829 .00478943 .00451117 age .00034115 .00006288 Difference .07669143 .01413662 Relative difference ----------------------------------------------------- union: .04824822 .05629525 .04411081 grade .00804704 -.00413741 Difference .16678412 -.0857525 Relative difference ----------------------------------------------------- union: -.13706993 -.1314541 -.14109796 not_smsa .00561584 -.00402803 Difference -.04097061 .02938665 Relative difference ----------------------------------------------------- union: -.63058241 -.62309654 -.64546968 south .00748587 -.01488727 Difference -.01187136 .02360876 Relative difference ----------------------------------------------------- union: .01318534 .01194434 .01341723 southXt -.001241 .00023189 Difference -.09411977 .01758658 Relative difference ----------------------------------------------------- union: -1.8468379 -1.9306422 -1.8066853 _cons -.08380426 .0401526 Difference .04537716 -.02174127 Relative difference ----------------------------------------------------- lnsig2u: .56121927 .49078989 .58080961 _cons -.07042938 .01959034 Difference -.12549352 .03490674 Relative difference ----------------------------------------------------- . * # of points to use in the quadrature approximation of the integral (this checkup is important.) . . xtprobit union age grade not_smsa south southXt in 1/25000, re offset(age) Fitting comparison model: Iteration 0: log likelihood = -151670.9 Iteration 1: log likelihood = -32756.207 Iteration 2: log likelihood = -14018.239 Iteration 3: log likelihood = -13038.04 Iteration 4: log likelihood = -13032.082 Iteration 5: log likelihood = -13032.081 Fitting full model: rho = 0.0 log likelihood = -13032.081 rho = 0.1 log likelihood = -11768.628 rho = 0.2 log likelihood = -11142.803 rho = 0.3 log likelihood = -10775.632 rho = 0.4 log likelihood = -10552.216 rho = 0.5 log likelihood = -10426.186 rho = 0.6 log likelihood = -10380.728 rho = 0.7 log likelihood = -10431.627 Iteration 0: log likelihood = -10380.728 Iteration 1: log likelihood = -10176.075 Iteration 2: log likelihood = -10148.722 Iteration 3: log likelihood = -10148.702 Random-effects probit regression Number of obs = 25000 Group variable (i): idcode Number of groups = 4232 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 232328.19 Log likelihood = -10148.702 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.9957372 .0025261 -394.18 0.000 -1.000688 -.9907862 grade | .0513804 .0104408 4.92 0.000 .0309168 .071844 not_smsa | -.1328317 .0480076 -2.77 0.006 -.2269249 -.0387386 south | -.590216 .0633889 -9.31 0.000 -.7144558 -.4659761 southXt | .011284 .0045232 2.49 0.013 .0024187 .0201492 _cons | -1.886637 .1503078 -12.55 0.000 -2.181235 -1.592039 age | (offset) -------------+---------------------------------------------------------------- /lnsig2u | .5619459 .0442328 .4752512 .6486407 -------------+---------------------------------------------------------------- sigma_u | 1.324418 .0292914 1.268234 1.38309 rho | .6369027 .0102292 .6166259 .6567041 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5766.76 Prob >= chibar2 = 0.000 . xtprobit union age grade not_smsa south southXt, re offset(grade) nolog Random-effects probit regression Number of obs = 26200 Group variable (i): idcode Number of groups = 4434 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 5.9 max = 12 Wald chi2(5) = 9158.89 Log likelihood = -10561.065 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0044483 .0025027 1.78 0.076 -.000457 .0093535 grade | -.9517518 .0100413 -94.78 0.000 -.9714323 -.9320713 not_smsa | -.1370699 .0462961 -2.96 0.003 -.2278087 -.0463312 south | -.6305824 .0614827 -10.26 0.000 -.7510863 -.5100785 southXt | .0131853 .0043819 3.01 0.003 .004597 .0217737 _cons | -1.846838 .1458222 -12.67 0.000 -2.132644 -1.561032 grade | (offset) -------------+---------------------------------------------------------------- /lnsig2u | .5612193 .0431875 .4765733 .6458653 -------------+---------------------------------------------------------------- sigma_u | 1.323937 .0285888 1.269073 1.381172 rho | .6367346 .0099894 .6169384 .6560781 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 5972.49 Prob >= chibar2 = 0.000 . . ** population-averaged model . xtprobit union age grade not_smsa south southXt, pa Iteration 1: tolerance = .04796083 Iteration 2: tolerance = .00352657 Iteration 3: tolerance = .00017886 Iteration 4: tolerance = 8.654e-06 Iteration 5: tolerance = 4.150e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: probit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 241.66 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0031597 .0014678 2.15 0.031 .0002829 .0060366 grade | .0329992 .0062334 5.29 0.000 .020782 .0452163 not_smsa | -.0721799 .0275189 -2.62 0.009 -.1261159 -.0182439 south | -.409029 .0372213 -10.99 0.000 -.4819815 -.3360765 southXt | .0081828 .002545 3.22 0.001 .0031946 .0131709 _cons | -1.184799 .0890117 -13.31 0.000 -1.359259 -1.01034 ------------------------------------------------------------------------------ . xtprobit union age grade not_smsa south southXt, pa eform Iteration 1: tolerance = .04796083 Iteration 2: tolerance = .00352657 Iteration 3: tolerance = .00017886 Iteration 4: tolerance = 8.654e-06 Iteration 5: tolerance = 4.150e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: probit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 241.66 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ union | ExpB Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.003165 .0014724 2.15 0.031 1.000283 1.006055 grade | 1.03355 .0064425 5.29 0.000 1.020999 1.046254 not_smsa | .9303635 .0256026 -2.62 0.009 .8815127 .9819215 south | .664295 .024726 -10.99 0.000 .6175585 .7145684 southXt | 1.008216 .0025659 3.22 0.001 1.0032 1.013258 ------------------------------------------------------------------------------ . xtprobit union age grade not_smsa south southXt, pa robust Iteration 1: tolerance = .04796083 Iteration 2: tolerance = .00352657 Iteration 3: tolerance = .00017886 Iteration 4: tolerance = 8.654e-06 Iteration 5: tolerance = 4.150e-07 GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: probit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 154.00 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0031597 .0022027 1.43 0.151 -.0011575 .007477 grade | .0329992 .0076631 4.31 0.000 .0179797 .0480186 not_smsa | -.0721799 .0348772 -2.07 0.038 -.140538 -.0038218 south | -.409029 .0482545 -8.48 0.000 -.5036061 -.3144519 southXt | .0081828 .0037108 2.21 0.027 .0009097 .0154558 _cons | -1.184799 .116457 -10.17 0.000 -1.413051 -.9565479 ------------------------------------------------------------------------------ . . xtprobit union age grade not_smsa south southXt, pa robust nolog /* first use 'xtprobit' */ GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: probit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 154.00 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0031597 .0022027 1.43 0.151 -.0011575 .007477 grade | .0329992 .0076631 4.31 0.000 .0179797 .0480186 not_smsa | -.0721799 .0348772 -2.07 0.038 -.140538 -.0038218 south | -.409029 .0482545 -8.48 0.000 -.5036061 -.3144519 southXt | .0081828 .0037108 2.21 0.027 .0009097 .0154558 _cons | -1.184799 .116457 -10.17 0.000 -1.413051 -.9565479 ------------------------------------------------------------------------------ . ** compare the results to 'xtgee' . xtgee union age grade not_smsa south southXt, family(binomial) link(probit) corr(exchangeable) robust > nolog GEE population-averaged model Number of obs = 26200 Group variable: idcode Number of groups = 4434 Link: probit Obs per group: min = 1 Family: binomial avg = 5.9 Correlation: exchangeable max = 12 Wald chi2(5) = 154.00 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on idcode) ------------------------------------------------------------------------------ | Semi-robust union | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .0031597 .0022027 1.43 0.151 -.0011575 .007477 grade | .0329992 .0076631 4.31 0.000 .0179797 .0480186 not_smsa | -.0721799 .0348772 -2.07 0.038 -.140538 -.0038218 south | -.409029 .0482545 -8.48 0.000 -.5036061 -.3144519 southXt | .0081828 .0037108 2.21 0.027 .0009097 .0154558 _cons | -1.184799 .116457 -10.17 0.000 -1.413051 -.9565479 ------------------------------------------------------------------------------ . . *webuse chicken.dta,clear . *save chicken.dta . . use chicken.dta,clear . * use http://www.stata-press.com/data/r8/chicken, clear . . iis(person) . . ** random-effects model . xtprobit complain age grade south tenure gender race income genderm burger chicken, re nolog Random-effects probit regression Number of obs = 5952 Group variable (i): person Number of groups = 1076 Random effects u_i ~ Gaussian Obs per group: min = 3 avg = 5.5 max = 8 Wald chi2(10) = 65.03 Log likelihood = -2574.115 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ complain | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.0003157 .0762518 -0.00 0.997 -.1497664 .1491351 grade | -.0411126 .0647727 -0.63 0.526 -.1680648 .0858396 south | -.0346366 .0723753 -0.48 0.632 -.1764895 .1072163 tenure | -.3836063 .0550447 -6.97 0.000 -.4914919 -.2757206 gender | .0667994 .0734595 0.91 0.363 -.0771786 .2107775 race | .0834963 .055773 1.50 0.134 -.0258168 .1928094 income | -.2111629 .0730126 -2.89 0.004 -.354265 -.0680607 genderm | .1306497 .0557133 2.35 0.019 .0214535 .2398458 burger | -.0616544 .0729739 -0.84 0.398 -.2046806 .0813718 chicken | .0635842 .0557645 1.14 0.254 -.0457122 .1728806 _cons | -1.123845 .0330159 -34.04 0.000 -1.188555 -1.059136 -------------+---------------------------------------------------------------- /lnsig2u | -1.030313 .1292422 -1.283623 -.7770027 -------------+---------------------------------------------------------------- sigma_u | .5974072 .0386051 .5263382 .6780723 rho | .2630235 .0250526 .2169342 .3149662 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 166.88 Prob >= chibar2 = 0.000 . xtprobit complain age grade south tenure gender race income genderm burger chicken, re Fitting comparison model: Iteration 0: log likelihood = -2689.7724 Iteration 1: log likelihood = -2657.6675 Iteration 2: log likelihood = -2657.557 Iteration 3: log likelihood = -2657.557 Fitting full model: rho = 0.0 log likelihood = -2657.557 rho = 0.1 log likelihood = -2603.595 rho = 0.2 log likelihood = -2587.7943 rho = 0.3 log likelihood = -2593.3452 Iteration 0: log likelihood = -2587.7943 Iteration 1: log likelihood = -2574.4935 Iteration 2: log likelihood = -2574.1156 Iteration 3: log likelihood = -2574.115 Random-effects probit regression Number of obs = 5952 Group variable (i): person Number of groups = 1076 Random effects u_i ~ Gaussian Obs per group: min = 3 avg = 5.5 max = 8 Wald chi2(10) = 65.03 Log likelihood = -2574.115 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ complain | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.0003157 .0762518 -0.00 0.997 -.1497664 .1491351 grade | -.0411126 .0647727 -0.63 0.526 -.1680648 .0858396 south | -.0346366 .0723753 -0.48 0.632 -.1764895 .1072163 tenure | -.3836063 .0550447 -6.97 0.000 -.4914919 -.2757206 gender | .0667994 .0734595 0.91 0.363 -.0771786 .2107775 race | .0834963 .055773 1.50 0.134 -.0258168 .1928094 income | -.2111629 .0730126 -2.89 0.004 -.354265 -.0680607 genderm | .1306497 .0557133 2.35 0.019 .0214535 .2398458 burger | -.0616544 .0729739 -0.84 0.398 -.2046806 .0813718 chicken | .0635842 .0557645 1.14 0.254 -.0457122 .1728806 _cons | -1.123845 .0330159 -34.04 0.000 -1.188555 -1.059136 -------------+---------------------------------------------------------------- /lnsig2u | -1.030313 .1292422 -1.283623 -.7770027 -------------+---------------------------------------------------------------- sigma_u | .5974072 .0386051 .5263382 .6780723 rho | .2630235 .0250526 .2169342 .3149662 ------------------------------------------------------------------------------ Likelihood-ratio test of rho=0: chibar2(01) = 166.88 Prob >= chibar2 = 0.000 . . ** population-averaged model . xtprobit complain age grade south tenure gender race income genderm burger chicken, pa Iteration 1: tolerance = .01957154 Iteration 2: tolerance = .00031208 Iteration 3: tolerance = 7.494e-06 Iteration 4: tolerance = 2.400e-07 GEE population-averaged model Number of obs = 5952 Group variable: person Number of groups = 1076 Link: probit Obs per group: min = 3 Family: binomial avg = 5.5 Correlation: exchangeable max = 8 Wald chi2(10) = 64.97 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ complain | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.0054771 .0655843 -0.08 0.933 -.1340199 .1230657 grade | -.0396946 .0558603 -0.71 0.477 -.1491788 .0697896 south | -.0302538 .0622504 -0.49 0.627 -.1522624 .0917548 tenure | -.3311456 .0475877 -6.96 0.000 -.4244157 -.2378755 gender | .0579957 .0632521 0.92 0.359 -.0659761 .1819675 race | .0723669 .0478558 1.51 0.130 -.0214288 .1661625 income | -.1824172 .0626775 -2.91 0.004 -.3052629 -.0595715 genderm | .1139425 .0481046 2.37 0.018 .0196592 .2082259 burger | -.0447319 .0631112 -0.71 0.478 -.1684276 .0789638 chicken | .057453 .0474856 1.21 0.226 -.035617 .150523 _cons | -.9651128 .025094 -38.46 0.000 -1.014296 -.9159294 ------------------------------------------------------------------------------ . xtprobit complain age grade south tenure gender race income genderm burger chicken, pa eform Iteration 1: tolerance = .01957154 Iteration 2: tolerance = .00031208 Iteration 3: tolerance = 7.494e-06 Iteration 4: tolerance = 2.400e-07 GEE population-averaged model Number of obs = 5952 Group variable: person Number of groups = 1076 Link: probit Obs per group: min = 3 Family: binomial avg = 5.5 Correlation: exchangeable max = 8 Wald chi2(10) = 64.97 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ complain | ExpB Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | .9945379 .065226 -0.08 0.933 .8745727 1.130959 grade | .9610829 .0536864 -0.71 0.477 .8614151 1.072283 south | .9701993 .0603953 -0.49 0.627 .8587629 1.096096 tenure | .7181006 .0341727 -6.96 0.000 .6541519 .7883008 gender | 1.05971 .0670289 0.92 0.359 .9361532 1.199575 race | 1.07505 .0514474 1.51 0.130 .9787992 1.180765 income | .8332536 .0522263 -2.91 0.004 .7369296 .9421681 genderm | 1.120688 .0539103 2.37 0.018 1.019854 1.231491 burger | .9562538 .0603503 -0.71 0.478 .8449924 1.082165 chicken | 1.059135 .0502937 1.21 0.226 .9650098 1.162442 ------------------------------------------------------------------------------ . xtprobit complain age grade south tenure gender race income genderm burger chicken, pa robust Iteration 1: tolerance = .01957154 Iteration 2: tolerance = .00031208 Iteration 3: tolerance = 7.494e-06 Iteration 4: tolerance = 2.400e-07 GEE population-averaged model Number of obs = 5952 Group variable: person Number of groups = 1076 Link: probit Obs per group: min = 3 Family: binomial avg = 5.5 Correlation: exchangeable max = 8 Wald chi2(10) = 62.71 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on person) ------------------------------------------------------------------------------ | Semi-robust complain | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | -.0054771 .0650062 -0.08 0.933 -.1328869 .1219328 grade | -.0396946 .0557624 -0.71 0.477 -.1489869 .0695976 south | -.0302538 .0605732 -0.50 0.617 -.148975 .0884674 tenure | -.3311456 .049896 -6.64 0.000 -.42894 -.2333511 gender | .0579957 .0648667 0.89 0.371 -.0691408 .1851321 race | .0723669 .0464189 1.56 0.119 -.0186125 .1633462 income | -.1824172 .0604638 -3.02 0.003 -.300924 -.0639104 genderm | .1139425 .0510136 2.23 0.026 .0139577 .2139273 burger | -.0447319 .064165 -0.70 0.486 -.1704931 .0810293 chicken | .057453 .0466957 1.23 0.219 -.0340689 .1489749 _cons | -.9651128 .025096 -38.46 0.000 -1.0143 -.9159255 ------------------------------------------------------------------------------ . . **************************** . * xtsum & xttab * . **************************** . . use nlswork.dta, clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . iis idcode . tis year . . xtsum age grade ttl_exp hours ln_wage Variable | Mean Std. Dev. Min Max | Observations -----------------+--------------------------------------------+---------------- age overall | 29.04511 6.700584 14 46 | N = 28510 between | 5.485756 14 45 | n = 4710 within | 5.16945 14.79511 43.79511 | T-bar = 6.05308 | | grade overall | 12.53259 2.323905 0 18 | N = 28532 between | 2.566536 0 18 | n = 4709 within | 0 12.53259 12.53259 | T-bar = 6.05904 | | ttl_exp overall | 6.215316 4.652117 0 28.88461 | N = 28534 between | 3.724221 0 24.7062 | n = 4711 within | 3.484133 -9.642671 20.38091 | T-bar = 6.05689 | | hours overall | 36.55956 9.869623 1 168 | N = 28467 between | 7.846585 1 83.5 | n = 4710 within | 7.520712 -2.154726 130.0596 | T-bar = 6.04395 | | ln_wage overall | 1.674907 .4780935 0 5.263916 | N = 28534 between | .424569 0 3.912023 | n = 4711 within | .29266 -.4077221 4.78367 | T-bar = 6.05689 . . xttab union Overall Between Within union | Freq. Percent Freq. Percent Percent ----------+----------------------------------------------------- 0 | 14728 76.56 3765 90.72 83.03 1 | 4510 23.44 1641 39.54 49.13 ----------+----------------------------------------------------- Total | 19238 100.00 5406 130.27 72.74 (n = 4150) . xttrans union | 1 if union 1 if union | 0 1 | Total -----------+----------------------+---------- 0 | 90.76 9.24 | 100.00 1 | 27.13 72.87 | 100.00 -----------+----------------------+---------- Total | 74.88 25.12 | 100.00 . . **************************** . * xttobit * . **************************** . . * Again, no FE version in stata, as there is no conditional likelihood function. . * Honore(1992)'s semi-parametric FE Tobit version can be considered, but . * unconditional tobit FE with dummies is biased. . . * ll (lower limit) and ul (upper limit) . . * option "tobit" reports the LR stat. versus pooling tobit. . . *webuse nlswork.dta,clear . *save nlswork.dta . use nlswork.dta, clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . * use http://www.stata-press.com/data/r8/chicken, clear . . iis idcode . tis year . . ** random-effects model (censoring point is ln_wage no greater than 1.9) . xttobit ln_wage union age grade not_smsa south occ_code, ul(1.9) tobit Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -15167.445 Iteration 1: log likelihood = -13167.317 Iteration 2: log likelihood = -13118.152 Iteration 3: log likelihood = -13118.07 Iteration 4: log likelihood = -13118.07 Fitting full model: Iteration 0: log likelihood = -12025.807 Iteration 1: log likelihood = -9665.581 Iteration 2: log likelihood = -9633.1104 Iteration 3: log likelihood = -9633.0884 Iteration 4: log likelihood = -9633.0884 Obtaining starting values for full model: Iteration 0: log likelihood = -5400.405 Iteration 1: log likelihood = -5218.9374 Iteration 2: log likelihood = -5216.7559 Iteration 3: log likelihood = -5216.7541 Fitting full model: Iteration 0: log likelihood = -6731.9661 Iteration 1: log likelihood = -6674.4406 Iteration 2: log likelihood = -6672.7597 Iteration 3: log likelihood = -6672.7585 Random-effects tobit regression Number of obs = 19151 Group variable (i): idcode Number of groups = 4140 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Wald chi2(6) = 3303.29 Log likelihood = -6672.7585 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1545505 .0069135 22.35 0.000 .1410002 .1681008 age | .0099367 .000414 24.00 0.000 .0091252 .0107482 grade | .0788248 .0022308 35.33 0.000 .0744525 .0831972 not_smsa | -.1276947 .0088914 -14.36 0.000 -.1451215 -.1102679 south | -.0868263 .0086892 -9.99 0.000 -.1038569 -.0697957 occ_code | -.0190243 .0010974 -17.34 0.000 -.0211751 -.0168735 _cons | .521857 .0320114 16.30 0.000 .4591158 .5845982 -------------+---------------------------------------------------------------- /sigma_u | .2847095 .0044262 64.32 0.000 .2760343 .2933848 /sigma_e | .2497528 .0018149 137.61 0.000 .2461956 .25331 -------------+---------------------------------------------------------------- rho | .5651268 .0082516 .5489039 .5812407 ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 5920.66 Prob>=chibar2 = 0.000 Observation summary: 12288 uncensored observations 0 left-censored observations 6863 right-censored observations . quadchk, nooutput Refitting model quad() = 8 Refitting model quad() = 16 Quadrature check Fitted Comparison Comparison quadrature quadrature quadrature 12 points 8 points 16 points ----------------------------------------------------- Log -6672.7585 -6704.1057 -6663.2926 likelihood -31.347262 9.4658607 Difference .0046978 -.00141858 Relative difference ----------------------------------------------------- ln_wage: .15455053 .15772401 .1552046 union .00317348 .00065408 Difference .02053361 .00423212 Relative difference ----------------------------------------------------- ln_wage: .00993666 .00996939 .00994252 age .00003273 5.859e-06 Difference .00329407 .00058965 Relative difference ----------------------------------------------------- ln_wage: .07882485 .07704554 .0794342 grade -.00177931 .00060935 Difference -.02257291 .00773047 Relative difference ----------------------------------------------------- ln_wage: -.12769469 -.12976763 -.12741324 not_smsa -.00207294 .00028145 Difference .01623356 -.00220406 Relative difference ----------------------------------------------------- ln_wage: -.08682628 -.08722795 -.08772561 south -.00040167 -.00089933 Difference .00462616 .01035786 Relative difference ----------------------------------------------------- ln_wage: -.0190243 -.01924788 -.01854782 occ_code -.00022358 .00047648 Difference .01175248 -.02504577 Relative difference ----------------------------------------------------- ln_wage: .52185703 .55070998 .50861885 _cons .02885295 -.01323818 Difference .055289 -.02536744 Relative difference ----------------------------------------------------- sigma_u: .28470952 .27445836 .28922281 _cons -.01025116 .00451329 Difference -.03600569 .01585226 Relative difference ----------------------------------------------------- sigma_e: .2497528 .25217635 .24880201 _cons .00242354 -.00095079 Difference .00970377 -.00380694 Relative difference ----------------------------------------------------- . . ** random-effects model (censoring point is ln_wage lies between 0.9 and 1.9) . xttobit ln_wage union age grade not_smsa south occ_code, ll(0.9) ul(1.9) tobit Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -15392.003 Iteration 1: log likelihood = -13130.198 Iteration 2: log likelihood = -13052.3 Iteration 3: log likelihood = -13052.066 Iteration 4: log likelihood = -13052.066 Fitting full model: Iteration 0: log likelihood = -12152.448 Iteration 1: log likelihood = -9524.0756 Iteration 2: log likelihood = -9473.1958 Iteration 3: log likelihood = -9473.127 Iteration 4: log likelihood = -9473.127 Obtaining starting values for full model: Iteration 0: log likelihood = -5400.405 Iteration 1: log likelihood = -5218.9374 Iteration 2: log likelihood = -5216.7559 Iteration 3: log likelihood = -5216.7541 Fitting full model: Iteration 0: log likelihood = -6534.5972 Iteration 1: log likelihood = -6396.172 Iteration 2: log likelihood = -6354.5163 Iteration 3: log likelihood = -6353.8081 Iteration 4: log likelihood = -6353.8079 Random-effects tobit regression Number of obs = 19151 Group variable (i): idcode Number of groups = 4140 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Wald chi2(6) = 3266.59 Log likelihood = -6353.8079 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1441742 .0064368 22.40 0.000 .1315583 .15679 age | .0092639 .0003868 23.95 0.000 .0085059 .010022 grade | .076301 .0021633 35.27 0.000 .072061 .0805411 not_smsa | -.1220306 .0084878 -14.38 0.000 -.1386664 -.1053948 south | -.0834701 .0082591 -10.11 0.000 -.0996576 -.0672827 occ_code | -.0176484 .0010304 -17.13 0.000 -.019668 -.0156288 _cons | .5638993 .0309246 18.23 0.000 .5032883 .6245103 -------------+---------------------------------------------------------------- /sigma_u | .268964 .0041773 64.39 0.000 .2607767 .2771513 /sigma_e | .231259 .0017299 133.69 0.000 .2278685 .2346494 -------------+---------------------------------------------------------------- rho | .5749506 .0081593 .5589013 .5908767 ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 6238.64 Prob>=chibar2 = 0.000 Observation summary: 11827 uncensored observations 461 left-censored observations 6863 right-censored observations . quadchk, nooutput Refitting model quad() = 8 Refitting model quad() = 16 Quadrature check Fitted Comparison Comparison quadrature quadrature quadrature 12 points 8 points 16 points ----------------------------------------------------- Log -6353.8079 -6389.0664 -6341.8933 likelihood -35.258577 11.914527 Difference .0055492 -.00187518 Relative difference ----------------------------------------------------- ln_wage: .14417415 .146989 .1447817 union .00281485 .00060755 Difference .01952398 .004214 Relative difference ----------------------------------------------------- ln_wage: .00926393 .00930916 .00927615 age .00004523 .00001222 Difference .00488236 .00131931 Relative difference ----------------------------------------------------- ln_wage: .07630102 .07460223 .07650597 grade -.00169879 .00020495 Difference -.02226431 .00268607 Relative difference ----------------------------------------------------- ln_wage: -.12203056 -.12497642 -.12265568 not_smsa -.00294586 -.00062511 Difference .02414031 .00512261 Relative difference ----------------------------------------------------- ln_wage: -.08347014 -.08358477 -.08596435 south -.00011462 -.00249421 Difference .00137321 .02988147 Relative difference ----------------------------------------------------- ln_wage: -.01764839 -.01802138 -.01709526 occ_code -.00037299 .00055313 Difference .02113437 -.03134147 Relative difference ----------------------------------------------------- ln_wage: .56389928 .5919087 .55738702 _cons .02800942 -.00651226 Difference .04967096 -.01154863 Relative difference ----------------------------------------------------- sigma_u: .26896402 .2592945 .27243035 _cons -.00966951 .00346633 Difference -.03595096 .01288772 Relative difference ----------------------------------------------------- sigma_e: .23125896 .23372355 .23023754 _cons .00246459 -.00102143 Difference .01065726 -.00441681 Relative difference ----------------------------------------------------- . . ** random-effects model (quadrature approx. of the integral is at its max, i.e. 30) . xttobit ln_wage union age grade not_smsa south occ_code, ll(0.9) ul(1.9) quad(30) tobit Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -15392.003 Iteration 1: log likelihood = -13130.198 Iteration 2: log likelihood = -13052.3 Iteration 3: log likelihood = -13052.066 Iteration 4: log likelihood = -13052.066 Fitting full model: Iteration 0: log likelihood = -12152.448 Iteration 1: log likelihood = -9524.0756 Iteration 2: log likelihood = -9473.1958 Iteration 3: log likelihood = -9473.127 Iteration 4: log likelihood = -9473.127 Obtaining starting values for full model: Iteration 0: log likelihood = -5400.405 Iteration 1: log likelihood = -5218.9374 Iteration 2: log likelihood = -5216.7559 Iteration 3: log likelihood = -5216.7541 Fitting full model: Iteration 0: log likelihood = -6524.8537 Iteration 1: log likelihood = -6388.3915 Iteration 2: log likelihood = -6338.4554 Iteration 3: log likelihood = -6337.427 Iteration 4: log likelihood = -6337.4264 Random-effects tobit regression Number of obs = 19151 Group variable (i): idcode Number of groups = 4140 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Wald chi2(6) = 3378.68 Log likelihood = -6337.4264 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1443261 .0064912 22.23 0.000 .1316036 .1570487 age | .0093664 .0003836 24.42 0.000 .0086146 .0101182 grade | .0750409 .0020702 36.25 0.000 .0709834 .0790984 not_smsa | -.1210126 .0084346 -14.35 0.000 -.1375441 -.104481 south | -.0847496 .0082938 -10.22 0.000 -.1010052 -.068494 occ_code | -.0169179 .0010327 -16.38 0.000 -.018942 -.0148937 _cons | .5756123 .0296338 19.42 0.000 .5175311 .6336934 -------------+---------------------------------------------------------------- /sigma_u | .2760293 .0044649 61.82 0.000 .2672783 .2847804 /sigma_e | .2297529 .0017401 132.03 0.000 .2263424 .2331635 -------------+---------------------------------------------------------------- rho | .5907351 .0086047 .5737914 .6075111 ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 6271.40 Prob>=chibar2 = 0.000 Observation summary: 11827 uncensored observations 461 left-censored observations 6863 right-censored observations . . ** random-effects model (the coefficient of tenure constrained to be 1) . xttobit ln_wage union age grade tenure ttl_exp race not_smsa south occ_code, ll(0.4) offset(tenure) to > bit (433 missing values generated) Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -52847.57 Iteration 1: log likelihood = -52847.253 Iteration 2: log likelihood = -52847.253 Fitting full model: Iteration 0: log likelihood = -7504.0222 Iteration 1: log likelihood = -7503.503 Iteration 2: log likelihood = -7503.503 Obtaining starting values for full model: Iteration 0: log likelihood = -4374.3176 Iteration 1: log likelihood = -4262.9837 Iteration 2: log likelihood = -4262.2296 Iteration 3: log likelihood = -4262.2294 Fitting full model: Iteration 0: log likelihood = -1071529.3 Iteration 1: log likelihood = -893719.46 Iteration 2: log likelihood = -519411.83 Iteration 3: log likelihood = -301487.3 Iteration 4: log likelihood = -176976.48 Iteration 5: log likelihood = -111098.62 Iteration 6: log likelihood = -76274.583 Iteration 7: log likelihood = -58362.125 Iteration 8: log likelihood = -49589.183 Iteration 9: log likelihood = -33083.933 Iteration 10: log likelihood = -26191.314 Iteration 11: log likelihood = -25984.62 Iteration 12: log likelihood = -25952.756 Iteration 13: log likelihood = -25952.711 Iteration 14: log likelihood = -25952.711 Random-effects tobit regression Number of obs = 18932 Group variable (i): idcode Number of groups = 4124 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Wald chi2(9) = 127058.34 Log likelihood = -25952.711 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1806699 .0276189 6.54 0.000 .1265378 .2348019 age | -.0069162 .0024978 -2.77 0.006 -.0118119 -.0020205 grade | .0684675 .0049047 13.96 0.000 .0588545 .0780804 tenure | -.9832218 .0035738 -275.12 0.000 -.9902264 -.9762172 ttl_exp | .0269457 .0041332 6.52 0.000 .0188448 .0350466 race | -.064567 .0243564 -2.65 0.008 -.1123047 -.0168294 not_smsa | -.1688055 .0256159 -6.59 0.000 -.2190118 -.1185991 south | -.0750667 .0242019 -3.10 0.002 -.1225015 -.0276318 occ_code | -.0245168 .0036509 -6.72 0.000 -.0316725 -.0173612 _cons | 1.055404 .0960997 10.98 0.000 .8670523 1.243756 tenure | (offset) -------------+---------------------------------------------------------------- /sigma_u | 9.38e-18 .0124696 0.00 1.000 -.02444 .02444 /sigma_e | 1.531288 . . . . . -------------+---------------------------------------------------------------- rho | 3.75e-35 . . . ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 0.00 Prob>=chibar2 = 1.000 Observation summary: 18827 uncensored observations 105 left-censored observations 0 right-censored observations . . ** random-effects model (the coefficient of ttl_exp constrained to be 1) . xttobit ln_wage union age grade tenure ttl_exp race not_smsa south occ_code, ul(1.6) offset(ttl_exp) t > obit Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -30296.942 Iteration 1: log likelihood = -24997.166 Iteration 2: log likelihood = -24980.515 Iteration 3: log likelihood = -24980.51 Iteration 4: log likelihood = -24980.51 Fitting full model: Iteration 0: log likelihood = -14824.7 Iteration 1: log likelihood = -7749.3794 Iteration 2: log likelihood = -7325.9931 Iteration 3: log likelihood = -7325.5389 Iteration 4: log likelihood = -7325.5389 Obtaining starting values for full model: Iteration 0: log likelihood = -4374.3176 Iteration 1: log likelihood = -4262.9837 Iteration 2: log likelihood = -4262.2296 Iteration 3: log likelihood = -4262.2294 Fitting full model: Iteration 0: log likelihood = -907875.5 Iteration 1: log likelihood = -755396.15 Iteration 2: log likelihood = -160336.1 Iteration 3: log likelihood = -119945.78 Iteration 4: log likelihood = -116133.61 Iteration 5: log likelihood = -77161.303 Iteration 6: log likelihood = -59140.892 Iteration 7: log likelihood = -54636.99 Iteration 8: log likelihood = -50872.029 Iteration 9: log likelihood = -42849.279 Iteration 10: log likelihood = -39335.494 Iteration 11: log likelihood = -36405.481 Iteration 12: log likelihood = -31749.087 Iteration 13: log likelihood = -29215.622 Iteration 14: log likelihood = -22646.972 Iteration 15: log likelihood = -22277.843 Iteration 16: log likelihood = -22183.825 Iteration 17: log likelihood = -22181.015 Iteration 18: log likelihood = -22180.917 Iteration 19: log likelihood = -22180.917 Random-effects tobit regression Number of obs = 18932 Group variable (i): idcode Number of groups = 4124 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Wald chi2(9) = 5429.82 Log likelihood = -22180.917 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | 1.577088 .1312489 12.02 0.000 1.319845 1.834331 age | -.0852665 .010432 -8.17 0.000 -.1057128 -.0648202 grade | .5421566 .0237042 22.87 0.000 .4956971 .588616 tenure | .2566029 .0184835 13.88 0.000 .220376 .2928299 ttl_exp | -.7788972 .0182854 -42.60 0.000 -.8147358 -.7430586 race | -.6339191 .1110267 -5.71 0.000 -.8515274 -.4163109 not_smsa | -1.439153 .1101333 -13.07 0.000 -1.65501 -1.223295 south | -.8011846 .1090602 -7.35 0.000 -1.014939 -.5874306 occ_code | -.1884413 .0175183 -10.76 0.000 -.2227765 -.1541062 _cons | .8996527 .4400266 2.04 0.041 .0372164 1.762089 ttl_exp | (offset) -------------+---------------------------------------------------------------- /sigma_u | .9521047 .1014206 9.39 0.000 .753324 1.150885 /sigma_e | 5.044401 . . . . . -------------+---------------------------------------------------------------- rho | .0343992 . . . ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 3.0e+04 Prob>=chibar2 = 0.000 Observation summary: 7227 uncensored observations 0 left-censored observations 11705 right-censored observations . . **************************** . * xtpcse * . **************************** . . * Alternative to xlgls . * Panel-corrected std error (PCSE) when OLS or Prais-Winsten regression was used. . * The disturbances are assumed to be heteroskedastic and contemporaneously correlated across panels. . * Also, options include corr(indep), corr(ar1), and corr(psar1), which has panel specific ar(1) errors > . . * Consistent as T goes infinity. . . * Again, this does not include within-group correlations; for this, use xtgee (Consistent as N goes in > finity). . . use grunfeld.dta,clear . * use http://www.stata-press.com/data/r8/grunfeld, clear . . tsset company year, yearly panel variable: company, 1 to 10 time variable: year, 1935 to 1954 . . xtpcse invest mvalue kstock Linear regression, correlated panels corrected standard errors (PCSEs) Group variable: company Number of obs = 200 Time variable: year Number of groups = 10 Panels: correlated (balanced) Obs per group: min = 20 Autocorrelation: no autocorrelation avg = 20 max = 20 Estimated covariances = 55 R-squared = 0.8124 Estimated autocorrelations = 0 Wald chi2(2) = 637.41 Estimated coefficients = 3 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Panel-corrected | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1155622 .0072124 16.02 0.000 .101426 .1296983 kstock | .2306785 .0278862 8.27 0.000 .1760225 .2853345 _cons | -42.71437 6.780965 -6.30 0.000 -56.00482 -29.42392 ------------------------------------------------------------------------------ . xtpcse invest mvalue kstock, correlation(ar1) (note: estimates of rho outside [-1,1] bounded to be in the range [-1,1]) Prais-Winsten regression, correlated panels corrected standard errors (PCSEs) Group variable: company Number of obs = 200 Time variable: year Number of groups = 10 Panels: correlated (balanced) Obs per group: min = 20 Autocorrelation: common AR(1) avg = 20 max = 20 Estimated covariances = 55 R-squared = 0.5468 Estimated autocorrelations = 1 Wald chi2(2) = 93.71 Estimated coefficients = 3 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Panel-corrected | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0950157 .0129934 7.31 0.000 .0695492 .1204822 kstock | .306005 .0603718 5.07 0.000 .1876784 .4243317 _cons | -39.12569 30.50355 -1.28 0.200 -98.91154 20.66016 -------------+---------------------------------------------------------------- rho | .9059774 ------------------------------------------------------------------------------ . xtpcse invest mvalue kstock, correlation(psar1) rhotype(tscorr) detail Prais-Winsten regression, correlated panels corrected standard errors (PCSEs) Group variable: company Number of obs = 200 Time variable: year Number of groups = 10 Panels: correlated (balanced) Obs per group: min = 20 Autocorrelation: panel-specific AR(1) avg = 20 max = 20 Estimated covariances = 55 R-squared = 0.8670 Estimated autocorrelations = 10 Wald chi2(2) = 444.53 Estimated coefficients = 3 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Panel-corrected | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .1052613 .0086018 12.24 0.000 .0884021 .1221205 kstock | .3386743 .0367568 9.21 0.000 .2666322 .4107163 _cons | -58.18714 12.63687 -4.60 0.000 -82.95496 -33.41933 ------------------------------------------------------------------------------ rhos = .5135627 .87017 .9023497 .63368 .8571502 ... .8752707 ------------------------------------------------------------------------------ . . **************************** . * xtregar * . **************************** . . * FE and RE models with AR(1) error (common rho only). tsset is needed due to T asymptotics. . * Can accomodate unbalanced panerls. . . * "lbi" option reports the LBI statistic for rho = 0. . . use grunfeld.dta,clear . * use http://www.stata-press.com/data/r8/grunfeld, clear . . tsset company year, yearly panel variable: company, 1 to 10 time variable: year, 1935 to 1954 . . ** fixed-effects with an AR(1) disturbance . xtregar invest mvalue kstock, fe rhotype(tscorr) FE (within) regression with AR(1) disturbances Number of obs = 190 Group variable (i): company Number of groups = 10 R-sq: within = 0.6583 Obs per group: min = 19 between = 0.8024 avg = 19.0 overall = 0.7933 max = 19 F(2,178) = 171.47 corr(u_i, Xb) = -0.0709 Prob > F = 0.0000 ------------------------------------------------------------------------------ invest | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0978364 .0096786 10.11 0.000 .0787369 .1169359 kstock | .346097 .0242248 14.29 0.000 .2982922 .3939018 _cons | -61.84403 6.621354 -9.34 0.000 -74.91049 -48.77758 -------------+---------------------------------------------------------------- rho_ar | .54131231 sigma_u | 90.893572 sigma_e | 41.592151 rho_fov | .82686297 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(9,178) = 19.73 Prob > F = 0.0000 . xtregar invest mvalue kstock, fe rhotype(tscorr) twostep FE (within) regression with AR(1) disturbances Number of obs = 190 Group variable (i): company Number of groups = 10 R-sq: within = 0.6662 Obs per group: min = 19 between = 0.8030 avg = 19.0 overall = 0.7938 max = 19 F(2,178) = 177.65 corr(u_i, Xb) = -0.0750 Prob > F = 0.0000 ------------------------------------------------------------------------------ invest | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0983386 .0097717 10.06 0.000 .0790554 .1176219 kstock | .345165 .023667 14.58 0.000 .2984609 .391869 _cons | -61.78204 6.792769 -9.10 0.000 -75.18676 -48.37732 -------------+---------------------------------------------------------------- rho_ar | .52182188 sigma_u | 90.781914 sigma_e | 41.763262 rho_fov | .82533018 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(9,178) = 21.02 Prob > F = 0.0000 . xtregar invest mvalue kstock if year != 1943 & year != 1944, fe lbi FE (within) regression with AR(1) disturbances Number of obs = 170 Group variable (i): company Number of groups = 10 R-sq: within = 0.5907 Obs per group: min = 17 between = 0.7938 avg = 17.0 overall = 0.7879 max = 17 F(2,158) = 114.00 corr(u_i, Xb) = -0.0339 Prob > F = 0.0000 ------------------------------------------------------------------------------ invest | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0922066 .0090362 10.20 0.000 .0743593 .1100539 kstock | .3509339 .0320278 10.96 0.000 .287676 .4141919 _cons | -61.69045 6.192364 -9.96 0.000 -73.92094 -49.45996 -------------+---------------------------------------------------------------- rho_ar | .67483913 sigma_u | 94.568243 sigma_e | 42.600124 rho_fov | .83130847 (fraction of variance due to u_i) ------------------------------------------------------------------------------ F test that all u_i=0: F(9,158) = 10.66 Prob > F = 0.0000 modified Bhargava et al. Durbin-Watson = .70578896 Baltagi-Wu LBI = 1.0218978 . . ** random-effects with an AR(1) disturbance . xtregar invest mvalue kstock, re rhotype(tscorr) RE GLS regression with AR(1) disturbances Number of obs = 200 Group variable (i): company Number of groups = 10 R-sq: within = 0.7652 Obs per group: min = 20 between = 0.8081 avg = 20.0 overall = 0.7978 max = 20 Wald chi2(3) = 440.00 corr(u_i, Xb) = 0 (assumed) Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ invest | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .096749 .0086003 11.25 0.000 .0798926 .1136053 kstock | .3200938 .0224726 14.24 0.000 .2760482 .3641393 _cons | -46.69488 26.26394 -1.78 0.075 -98.17126 4.781505 -------------+---------------------------------------------------------------- rho_ar | .54131231 (estimated autocorrelation coefficient) sigma_u | 75.225307 sigma_e | 42.760966 rho_fov | .75578797 (fraction of variance due to u_i) theta | .74648521 ------------------------------------------------------------------------------ . xtregar invest mvalue kstock if year != 1943 & year != 1944, re lbi RE GLS regression with AR(1) disturbances Number of obs = 180 Group variable (i): company Number of groups = 10 R-sq: within = 0.7718 Obs per group: min = 18 between = 0.8036 avg = 18.0 overall = 0.7956 max = 18 Wald chi2(3) = 335.41 corr(u_i, Xb) = 0 (assumed) Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ invest | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- mvalue | .0948541 .0085443 11.10 0.000 .0781075 .1116007 kstock | .322599 .0271626 11.88 0.000 .2693613 .3758368 _cons | -44.82233 27.24889 -1.64 0.100 -98.22918 8.584515 -------------+---------------------------------------------------------------- rho_ar | .67483913 (estimated autocorrelation coefficient) sigma_u | 74.332091 sigma_e | 43.199999 rho_fov | .74751539 (fraction of variance due to u_i) theta | .65649837 ------------------------------------------------------------------------------ modified Bhargava et al. Durbin-Watson = .70578896 Baltagi-Wu LBI = 1.0218978 . . **************************** . * xtintreg * . **************************** . . * RE models for interval data panels (no FE version) . * needs Dep(lower) and Dep(upper), and RE version requires a quadchk checkup. . . * Prediction can be given over intervals. . * pr0(a,b) computes P(20 < y < 30). . . * intreg computes the LR test for the OLS . . *webuse nlswork3.dta,clear . *save nlswork3.dta . . use nlswork3.dta, clear (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . * use http://www.stata-press.com/data/r8/grunfeld, clear . . iis idcode . tis year . . ** random-effects interval data regression model . xtintreg ln_wage1 ln_wage2 union age grade not_smsa south southXt occ_code, noskip intreg Fitting comparison model: Fitting constant-only model: Iteration 0: log likelihood = -21749.783 Iteration 1: log likelihood = -21739.501 Iteration 2: log likelihood = -21739.5 Fitting full model: Iteration 0: log likelihood = -18181.947 Iteration 1: log likelihood = -18171.883 Iteration 2: log likelihood = -18171.883 Obtaining starting values for full model: Iteration 0: log likelihood = -5422.7749 Iteration 1: log likelihood = -5245.859 Iteration 2: log likelihood = -5243.7778 Iteration 3: log likelihood = -5243.776 Obtaining starting values for constant-only model: Iteration 0: log likelihood = -7036.0574 Iteration 1: log likelihood = -7017.6258 Iteration 2: log likelihood = -7017.4849 Fitting constant-only model: Iteration 0: log likelihood = -16673.525 Iteration 1: log likelihood = -16632.045 Iteration 2: log likelihood = -16631.654 Fitting full model: Iteration 0: log likelihood = -14876.617 Iteration 1: log likelihood = -14857.02 Iteration 2: log likelihood = -14856.934 Random-effects interval regression Number of obs = 19095 Group variable (i): idcode Number of groups = 4139 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 LR chi2(7) = 3549.46 Log likelihood = -14856.934 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1409746 .0068364 20.62 0.000 .1275755 .1543737 age | .012631 .0005148 24.53 0.000 .0116219 .01364 grade | .0783789 .0020912 37.48 0.000 .0742802 .0824777 not_smsa | -.1333091 .0089209 -14.94 0.000 -.1507938 -.1158243 south | -.1218994 .0121087 -10.07 0.000 -.145632 -.0981669 southXt | .0021033 .0008314 2.53 0.011 .0004738 .0037328 occ_code | -.0185603 .001033 -17.97 0.000 -.020585 -.0165355 _cons | .4567546 .032493 14.06 0.000 .3930695 .5204398 -------------+---------------------------------------------------------------- /sigma_u | .282881 .0038227 74.00 0.000 .2753886 .2903734 /sigma_e | .2696119 .0015957 168.96 0.000 .2664843 .2727394 -------------+---------------------------------------------------------------- rho | .524003 .0075625 .5091676 .5388052 ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01)= 6629.90 Prob>=chibar2 = 0.000 Observation summary: 14372 uncensored observations 157 left-censored observations 718 right-censored observations 3848 interval observations . predict new_var, pr0(1,3) (9383 missing values generated) . predict new_var1, pr0(0,3) (9383 missing values generated) . . ** the coefficient of age constrained to be 1 . *xtintreg ln_wage1 ln_wage2 union age grade not_smsa south southXt occ_code, quad(25) offset(age) intr > eg . *xtintreg ln_wage1 ln_wage2 union age grade tenure ttl_exp not_smsa south, offset(tenure) intreg . *xtintreg ln_wage1 ln_wage2 union age grade not_smsa south southXt occ_code, offset(grade) quad(20) in > treg . . **************************** . * xtpoisson * . **************************** . . * Three models: FE, RE and GEE . . * Note that there is no prediction for the FE model: conditional likelihood function. . . * "irr" reports exp(b), which implies incidence-rate ratios . . *webuse ships.dta,clear . *save ships.dta . use ships.dta,clear . * use http://www.stata-press.com/data/r8/ships, clear . . ** random-effects model . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, re i(ship) Fitting comparison Poisson model: Iteration 0: log likelihood = -341.15613 Iteration 1: log likelihood = -341.15612 Fitting full model: Iteration 0: log likelihood = -131.26904 Iteration 1: log likelihood = -131.12162 Iteration 2: log likelihood = -131.12157 Iteration 3: log likelihood = -131.12157 Random-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Random effects u_i ~ Gamma Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 30.46 Log likelihood = -131.12157 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | .293144 .1127476 2.60 0.009 .0721626 .5141253 co_65_69 | .5815873 .1480564 3.93 0.000 .2914021 .8717725 co_70_74 | .4619228 .1512497 3.05 0.002 .1654788 .7583668 co_75_79 | -.1961351 .2135839 -0.92 0.358 -.614752 .2224817 _cons | 1.848901 .4866157 3.80 0.000 .8951521 2.802651 -------------+---------------------------------------------------------------- /lnalpha | .0891896 .5614828 -1.011296 1.189676 -------------+---------------------------------------------------------------- alpha | 1.093288 .6138623 .3637471 3.286015 ------------------------------------------------------------------------------ Likelihood-ratio test of alpha=0: chibar2(01) = 420.07 Prob>=chibar2 = 0.000 . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, re i(ship) irr Fitting comparison Poisson model: Iteration 0: log likelihood = -341.15613 Iteration 1: log likelihood = -341.15612 Fitting full model: Iteration 0: log likelihood = -131.26904 Iteration 1: log likelihood = -131.12162 Iteration 2: log likelihood = -131.12157 Iteration 3: log likelihood = -131.12157 Random-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Random effects u_i ~ Gamma Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 30.46 Log likelihood = -131.12157 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.340636 .1511535 2.60 0.009 1.07483 1.672175 co_65_69 | 1.788876 .2648545 3.93 0.000 1.338303 2.391145 co_70_74 | 1.587123 .2400519 3.05 0.002 1.179958 2.134787 co_75_79 | .8219011 .1755449 -0.92 0.358 .540775 1.249173 -------------+---------------------------------------------------------------- /lnalpha | .0891896 .5614828 -1.011296 1.189676 -------------+---------------------------------------------------------------- alpha | 1.093288 .6138623 .3637471 3.286015 ------------------------------------------------------------------------------ Likelihood-ratio test of alpha=0: chibar2(01) = 420.07 Prob>=chibar2 = 0.000 . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, re i(ship) exposure(service) irr Fitting comparison Poisson model: Iteration 0: log likelihood = -147.37993 Iteration 1: log likelihood = -80.372714 Iteration 2: log likelihood = -80.116093 Iteration 3: log likelihood = -80.115916 Iteration 4: log likelihood = -80.115916 Fitting full model: Iteration 0: log likelihood = -79.653186 Iteration 1: log likelihood = -76.990836 (not concave) Iteration 2: log likelihood = -74.824942 Iteration 3: log likelihood = -74.811243 Iteration 4: log likelihood = -74.811217 Iteration 5: log likelihood = -74.811217 Random-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Random effects u_i ~ Gamma Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 50.90 Log likelihood = -74.811217 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.466305 .1734005 3.24 0.001 1.162957 1.848777 co_65_69 | 2.032543 .304083 4.74 0.000 1.515982 2.72512 co_70_74 | 2.356853 .3999259 5.05 0.000 1.690033 3.286774 co_75_79 | 1.641913 .3811398 2.14 0.033 1.04174 2.58786 service | (exposure) -------------+---------------------------------------------------------------- /lnalpha | -2.368406 .8474597 -4.029397 -.7074155 -------------+---------------------------------------------------------------- alpha | .0936298 .0793475 .0177851 .4929165 ------------------------------------------------------------------------------ Likelihood-ratio test of alpha=0: chibar2(01) = 10.61 Prob>=chibar2 = 0.001 . . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, re i(ship) ex(service) irr normal nolog Random-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Random effects u_i ~ Gaussian Obs per group: min = 6 avg = 6.8 max = 7 LR chi2(4) = 55.93 Log likelihood = -74.225924 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.470182 .1737941 3.26 0.001 1.166134 1.853505 co_65_69 | 2.025867 .3030042 4.72 0.000 1.511119 2.715958 co_70_74 | 2.336483 .3960786 5.01 0.000 1.675975 3.257299 co_75_79 | 1.640625 .3777041 2.15 0.032 1.044831 2.576159 service | (exposure) -------------+---------------------------------------------------------------- /lnsig2u | -1.42662 .5613872 -2.54 0.011 -2.526919 -.3263217 -------------+---------------------------------------------------------------- sigma_u | .4900195 .1375453 .2826744 .8494545 ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01) = 11.78 Pr>=chibar2 = 0.000 . * RE has a normal distribution, rather than a gamma dist. . . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, re i(ship) ex(service) irr normal quad(25) Fitting comparison Poisson model: Iteration 0: log likelihood = -147.37993 Iteration 1: log likelihood = -80.372714 Iteration 2: log likelihood = -80.116093 Iteration 3: log likelihood = -80.115916 Iteration 4: log likelihood = -80.115916 Fitting constant-only model: tau = 0.0 log likelihood = -122.09741 tau = 0.1 log likelihood = -105.0801 tau = 0.2 log likelihood = -105.17125 Iteration 0: log likelihood = -105.0801 Iteration 1: log likelihood = -102.14885 Iteration 2: log likelihood = -102.0026 Iteration 3: log likelihood = -101.9962 Fitting full model: tau = 0.0 log likelihood = -80.115916 tau = 0.1 log likelihood = -76.779907 tau = 0.2 log likelihood = -77.46495 Iteration 0: log likelihood = -76.779907 Iteration 1: log likelihood = -76.473429 Iteration 2: log likelihood = -75.858367 Iteration 3: log likelihood = -75.639848 Iteration 4: log likelihood = -75.637123 Iteration 5: log likelihood = -75.637123 Random-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Random effects u_i ~ Gaussian Obs per group: min = 6 avg = 6.8 max = 7 LR chi2(4) = 52.72 Log likelihood = -75.637123 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.470736 .1738891 3.26 0.001 1.166528 1.854277 co_65_69 | 2.031651 .3033551 4.75 0.000 1.516185 2.722362 co_70_74 | 2.373344 .3930244 5.22 0.000 1.715545 3.283365 co_75_79 | 1.659108 .3814835 2.20 0.028 1.057196 2.603718 service | (exposure) -------------+---------------------------------------------------------------- /lnsig2u | -.9742939 . . . . . -------------+---------------------------------------------------------------- sigma_u | .6143768 . . . ------------------------------------------------------------------------------ Likelihood-ratio test of sigma_u=0: chibar2(01) = 8.96 Pr>=chibar2 = 0.001 . . ** conditional fixed-effects model . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, fe i(ship) Iteration 0: log likelihood = -120.64946 Iteration 1: log likelihood = -104.89768 Iteration 2: log likelihood = -104.83697 Iteration 3: log likelihood = -104.83697 Conditional fixed-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 30.48 Log likelihood = -104.83697 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | .2928003 .1127466 2.60 0.009 .071821 .5137796 co_65_69 | .5824489 .1480547 3.93 0.000 .2922671 .8726308 co_70_74 | .4627844 .151248 3.06 0.002 .1663437 .7592251 co_75_79 | -.1951267 .2135749 -0.91 0.361 -.6137258 .2234724 ------------------------------------------------------------------------------ . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, fe i(ship) ex(service) Iteration 0: log likelihood = -80.738973 Iteration 1: log likelihood = -54.857546 Iteration 2: log likelihood = -54.641897 Iteration 3: log likelihood = -54.641859 Iteration 4: log likelihood = -54.641859 Conditional fixed-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 48.44 Log likelihood = -54.641859 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | .384467 .1182722 3.25 0.001 .1526578 .6162761 co_65_69 | .6971405 .1496414 4.66 0.000 .4038487 .9904322 co_70_74 | .8184266 .1697737 4.82 0.000 .4856764 1.151177 co_75_79 | .4534267 .2331705 1.94 0.052 -.0035791 .9104324 service | (exposure) ------------------------------------------------------------------------------ . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, fe i(ship) ex(service) irr Iteration 0: log likelihood = -80.738973 Iteration 1: log likelihood = -54.857546 Iteration 2: log likelihood = -54.641897 Iteration 3: log likelihood = -54.641859 Iteration 4: log likelihood = -54.641859 Conditional fixed-effects Poisson regression Number of obs = 34 Group variable (i): ship Number of groups = 5 Obs per group: min = 6 avg = 6.8 max = 7 Wald chi2(4) = 48.44 Log likelihood = -54.641859 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.468831 .1737218 3.25 0.001 1.164926 1.852019 co_65_69 | 2.008003 .3004803 4.66 0.000 1.497577 2.692398 co_70_74 | 2.26693 .384865 4.82 0.000 1.625274 3.161912 co_75_79 | 1.573695 .3669393 1.94 0.052 .9964273 2.485397 service | (exposure) ------------------------------------------------------------------------------ . . ** population-averaged model ('eform' is an xtgee option) . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, pa i(ship) ex(service) robust Iteration 1: tolerance = .04083192 Iteration 2: tolerance = .00270188 Iteration 3: tolerance = .00030663 Iteration 4: tolerance = .00003466 Iteration 5: tolerance = 3.891e-06 Iteration 6: tolerance = 4.359e-07 GEE population-averaged model Number of obs = 34 Group variable: ship Number of groups = 5 Link: log Obs per group: min = 6 Family: Poisson avg = 6.8 Correlation: exchangeable max = 7 Wald chi2(3) = 181.55 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on ship) ------------------------------------------------------------------------------ | Semi-robust accident | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | .3942686 .0807592 4.88 0.000 .2359834 .5525537 co_65_69 | .7122029 .0887684 8.02 0.000 .53822 .8861858 co_70_74 | .9720912 .1548704 6.28 0.000 .6685509 1.275632 co_75_79 | .6294916 .1762443 3.57 0.000 .284059 .9749241 _cons | -6.88255 .0702989 -97.90 0.000 -7.020334 -6.744767 service | (exposure) ------------------------------------------------------------------------------ . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, pa i(ship) ex(service) eform Iteration 1: tolerance = .04083192 Iteration 2: tolerance = .00270188 Iteration 3: tolerance = .00030663 Iteration 4: tolerance = .00003466 Iteration 5: tolerance = 3.891e-06 Iteration 6: tolerance = 4.359e-07 GEE population-averaged model Number of obs = 34 Group variable: ship Number of groups = 5 Link: log Obs per group: min = 6 Family: Poisson avg = 6.8 Correlation: exchangeable max = 7 Wald chi2(4) = 81.56 Scale parameter: 1 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.483299 .1589 3.68 0.000 1.202383 1.829846 co_65_69 | 2.038477 .2727095 5.32 0.000 1.568307 2.649601 co_70_74 | 2.643467 .3798956 6.76 0.000 1.994558 3.503491 co_75_79 | 1.876656 .3784496 3.12 0.002 1.26395 2.786374 service | (exposure) ------------------------------------------------------------------------------ . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, pa i(ship) ex(service) robust eform Iteration 1: tolerance = .04083192 Iteration 2: tolerance = .00270188 Iteration 3: tolerance = .00030663 Iteration 4: tolerance = .00003466 Iteration 5: tolerance = 3.891e-06 Iteration 6: tolerance = 4.359e-07 GEE population-averaged model Number of obs = 34 Group variable: ship Number of groups = 5 Link: log Obs per group: min = 6 Family: Poisson avg = 6.8 Correlation: exchangeable max = 7 Wald chi2(3) = 181.55 Scale parameter: 1 Prob > chi2 = 0.0000 (standard errors adjusted for clustering on ship) ------------------------------------------------------------------------------ | Semi-robust accident | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- op_75_79 | 1.483299 .1197901 4.88 0.000 1.266153 1.737685 co_65_69 | 2.038477 .1809524 8.02 0.000 1.712955 2.425859 co_70_74 | 2.643467 .4093947 6.28 0.000 1.951407 3.580962 co_75_79 | 1.876656 .33075 3.57 0.000 1.328511 2.650966 service | (exposure) ------------------------------------------------------------------------------ . . . **************************** . * xtnbreg * . **************************** . . * Negative binomial Poisson models (RE, GEE and FE versions) . . * Again, no prediction for the FE version . . use airacc.dta,clear . * use http://www.stata-press.com/data/r8/airacc, clear . . iis airline . tis time . . ** random-effects model . xtnbreg i_cnt inprog, re exposure(pmiles) irr Fitting comparison negative binomial (constant dispersion) model: Iteration 0: log likelihood = -293.57997 Iteration 1: log likelihood = -293.57997 Iteration 0: log likelihood = -276.12904 Iteration 1: log likelihood = -275.44486 Iteration 2: log likelihood = -275.40558 Iteration 3: log likelihood = -275.40555 Iteration 0: log likelihood = -275.40555 Iteration 1: log likelihood = -274.89983 Iteration 2: log likelihood = -274.89659 Iteration 3: log likelihood = -274.89659 Fitting full model: Iteration 0: log likelihood = -295.72633 Iteration 1: log likelihood = -270.49929 (not concave) Iteration 2: log likelihood = -265.80562 Iteration 3: log likelihood = -265.39132 Iteration 4: log likelihood = -265.38203 Iteration 5: log likelihood = -265.38202 Random-effects negative binomial regression Number of obs = 80 Group variable (i): airline Number of groups = 20 Random effects u_i ~ Beta Obs per group: min = 4 avg = 4.0 max = 4 Wald chi2(1) = 2.04 Log likelihood = -265.38202 Prob > chi2 = 0.1532 ------------------------------------------------------------------------------ i_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .911673 .0590277 -1.43 0.153 .8030206 1.035027 pmiles | (exposure) -------------+---------------------------------------------------------------- /ln_r | 4.794991 .951781 2.929535 6.660448 /ln_s | 3.268052 .4709033 2.345098 4.191005 -------------+---------------------------------------------------------------- r | 120.9033 115.0735 18.71892 780.9007 s | 26.26013 12.36598 10.4343 66.08918 ------------------------------------------------------------------------------ Likelihood-ratio test vs. pooled: chibar2(01) = 19.03 Prob>=chibar2 = 0.000 . predict new_var2 (option xb assumed; linear prediction) . . ** conditional fixed-effects model . xtnbreg i_cnt inprog, fe exposure(pmiles) irr Iteration 0: log likelihood = -176.86277 Iteration 1: log likelihood = -174.41693 Iteration 2: log likelihood = -174.25704 Iteration 3: log likelihood = -174.25144 Iteration 4: log likelihood = -174.25143 Conditional FE negative binomial regression Number of obs = 80 Group variable (i): airline Number of groups = 20 Obs per group: min = 4 avg = 4.0 max = 4 Wald chi2(1) = 2.11 Log likelihood = -174.25143 Prob > chi2 = 0.1463 ------------------------------------------------------------------------------ i_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .9062669 .0613917 -1.45 0.146 .793587 1.034946 pmiles | (exposure) ------------------------------------------------------------------------------ . predict new_var3 (option xb assumed; linear prediction) . . ** population-averaged model ('eform' is an xtgee option) . xtnbreg i_cnt inprog, pa exposure(pmiles) robust eform Iteration 1: tolerance = .02499392 Iteration 2: tolerance = .0000482 Iteration 3: tolerance = 2.929e-07 GEE population-averaged model Number of obs = 80 Group variable: airline Number of groups = 20 Link: log Obs per group: min = 4 Family: negative binomial(k=1) avg = 4.0 Correlation: exchangeable max = 4 Wald chi2(1) = 1.28 Scale parameter: 1 Prob > chi2 = 0.2571 (standard errors adjusted for clustering on airline) ------------------------------------------------------------------------------ | Semi-robust i_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- inprog | .927275 .0617857 -1.13 0.257 .8137513 1.056636 pmiles | (exposure) ------------------------------------------------------------------------------ . . **************************** . * xtrchh * . **************************** . . * Hildreth-Houck random coefficient model . . use invest2.dta,clear . * use http://www.stata-press.com/data/r8/invest2, clear . . * Check the data for possible random coefficients . reshape wide invest market stock, i(time) j(company) (note: j = 1 2 3 4 5) Data long -> wide ----------------------------------------------------------------------------- Number of obs. 100 -> 20 Number of variables 5 -> 16 j variable (5 values) company -> (dropped) xij variables: invest -> invest1 invest2 ... invest5 market -> market1 market2 ... market5 stock -> stock1 stock2 ... stock5 ----------------------------------------------------------------------------- . sureg (invest1 market1 stock1) (invest2 market2 stock2) (invest3 market3 stock3) (invest4 market4 stoc > k4) (invest5 market5 stock5) Seemingly unrelated regression ---------------------------------------------------------------------- Equation Obs Parms RMSE "R-sq" chi2 P ---------------------------------------------------------------------- invest1 20 2 84.94729 0.9207 261.32 0.0000 invest2 20 2 12.36322 0.9119 207.21 0.0000 invest3 20 2 26.46612 0.6876 46.88 0.0000 invest4 20 2 9.742303 0.7264 59.15 0.0000 invest5 20 2 95.85484 0.4220 14.97 0.0006 ---------------------------------------------------------------------- ------------------------------------------------------------------------------ | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- invest1 | market1 | .120493 .0216291 5.57 0.000 .0781007 .1628853 stock1 | .3827462 .032768 11.68 0.000 .318522 .4469703 _cons | -162.3641 89.45922 -1.81 0.070 -337.7009 12.97279 -------------+---------------------------------------------------------------- invest2 | market2 | .0695456 .0168975 4.12 0.000 .0364271 .1026641 stock2 | .3085445 .0258635 11.93 0.000 .2578529 .3592362 _cons | .5043112 11.51283 0.04 0.965 -22.06042 23.06904 -------------+---------------------------------------------------------------- invest3 | market3 | .0372914 .0122631 3.04 0.002 .0132561 .0613268 stock3 | .130783 .0220497 5.93 0.000 .0875663 .1739997 _cons | -22.43892 25.51859 -0.88 0.379 -72.45443 27.57659 -------------+---------------------------------------------------------------- invest4 | market4 | .0570091 .0113623 5.02 0.000 .0347395 .0792788 stock4 | .0415065 .0412016 1.01 0.314 -.0392472 .1222602 _cons | 1.088878 6.258805 0.17 0.862 -11.17815 13.35591 -------------+---------------------------------------------------------------- invest5 | market5 | .1014782 .0547837 1.85 0.064 -.0058958 .2088523 stock5 | .3999914 .1277946 3.13 0.002 .1495186 .6504642 _cons | 85.42324 111.8774 0.76 0.445 -133.8525 304.6989 ------------------------------------------------------------------------------ . . use invest2.dta,clear . xtrchh invest market stock, i(company) t(time) Hildreth-Houck random-coefficients regression Number of obs = 100 Group variable (i): company Number of groups = 5 Obs per group: min = 20 avg = 20.0 max = 20 Wald chi2(2) = 17.55 Prob > chi2 = 0.0002 ------------------------------------------------------------------------------ invest | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- market | .0807646 .0250829 3.22 0.001 .0316031 .1299261 stock | .2839885 .0677899 4.19 0.000 .1511229 .4168542 _cons | -23.58361 34.55547 -0.68 0.495 -91.31108 44.14386 ------------------------------------------------------------------------------ Test of parameter constancy: chi2(12) = 603.99 Prob > chi2 = 0.0000 . . predict new4, xb . . **************************** . * xtfrontier * . **************************** . . *Frontier Models . *Battese-Coelli (1992) parameterization fof time effects multipleid by the inefficienty term. . . *webuse xtfrontier1.dta,clear . *save xtfrontier1.dta . use xtfrontier1.dta,clear . * use http://www.stata-press.com/data/r8/xtfrontier1, clear . . ** time-invariant model . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) Iteration 0: log likelihood = -1473.8703 Iteration 1: log likelihood = -1473.0565 Iteration 2: log likelihood = -1472.6155 Iteration 3: log likelihood = -1472.607 Iteration 4: log likelihood = -1472.6069 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 661.76 Log likelihood = -1472.6069 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .2904551 .0164219 17.69 0.000 .2582688 .3226415 lnworkers | .2943333 .0154352 19.07 0.000 .2640808 .3245858 _cons | 3.030983 .1441022 21.03 0.000 2.748548 3.313418 -------------+---------------------------------------------------------------- /mu | 1.125667 .6479217 1.74 0.082 -.144236 2.39557 /lnsigma2 | 1.421979 .2672745 5.32 0.000 .898131 1.945828 /ilgtgamma | 1.138685 .3562642 3.20 0.001 .4404204 1.83695 -------------+---------------------------------------------------------------- sigma2 | 4.145318 1.107938 2.455011 6.999424 gamma | .7574382 .0654548 .6083592 .8625876 sigma_u2 | 3.139822 1.107235 .9696821 5.309962 sigma_v2 | 1.005496 .0484143 .9106055 1.100386 ------------------------------------------------------------------------------ . xtfrontier lnwidgets machines workers, ti i(id) nodifficult Iteration 0: log likelihood = -1646.4811 Iteration 1: log likelihood = -1646.1971 Iteration 2: log likelihood = -1646.0874 Iteration 3: log likelihood = -1646.0865 Iteration 4: log likelihood = -1646.0865 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 156.88 Log likelihood = -1646.0865 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- machines | .2540003 .0290799 8.73 0.000 .1970048 .3109958 workers | .2769069 .0297783 9.30 0.000 .2185425 .3352713 _cons | 1.661704 .1583643 10.49 0.000 1.351316 1.972092 -------------+---------------------------------------------------------------- /mu | .8424473 .8223803 1.02 0.306 -.7693884 2.454283 /lnsigma2 | 1.571846 .2760161 5.69 0.000 1.030865 2.112828 /ilgtgamma | .7862015 .4048398 1.94 0.052 -.0072699 1.579673 -------------+---------------------------------------------------------------- sigma2 | 4.815531 1.329164 2.803489 8.2716 gamma | .6870151 .0870508 .4981825 .8291582 sigma_u2 | 3.308343 1.328023 .7054661 5.91122 sigma_v2 | 1.507188 .0725043 1.365083 1.649294 ------------------------------------------------------------------------------ . . ** time-invariant model in terms of a cost function . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) cost Iteration 0: log likelihood = -1501.2874 Iteration 1: log likelihood = -1498.5751 Iteration 2: log likelihood = -1480.4493 Iteration 3: log likelihood = -1479.1193 Iteration 4: log likelihood = -1478.8933 Iteration 5: log likelihood = -1478.8902 Iteration 6: log likelihood = -1478.8902 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 660.64 Log likelihood = -1478.8902 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .290513 .0165101 17.60 0.000 .2581538 .3228722 lnworkers | .2956598 .0154756 19.10 0.000 .2653281 .3259914 _cons | -1.924366 .4576805 -4.20 0.000 -2.821404 -1.027329 -------------+---------------------------------------------------------------- /mu | 3.004131 .5213877 5.76 0.000 1.98223 4.026032 /lnsigma2 | 1.021361 .1218467 8.38 0.000 .7825459 1.260176 /ilgtgamma | .5609052 .1963639 2.86 0.004 .1760391 .9457714 -------------+---------------------------------------------------------------- sigma2 | 2.776972 .3383648 2.187033 3.526043 gamma | .636662 .0454236 .5438965 .720264 sigma_u2 | 1.767992 .3354469 1.110528 2.425456 sigma_v2 | 1.008979 .0487203 .9134894 1.10447 ------------------------------------------------------------------------------ . xtfrontier lnwidgets machines workers, ti i(id) nodifficult cost Iteration 0: log likelihood = -1665.9929 (not concave) Iteration 1: log likelihood = -1659.7875 (not concave) Iteration 2: log likelihood = -1658.5987 Iteration 3: log likelihood = -1655.5677 Iteration 4: log likelihood = -1652.7243 Iteration 5: log likelihood = -1652.2688 Iteration 6: log likelihood = -1652.2445 Iteration 7: log likelihood = -1652.2444 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 154.76 Log likelihood = -1652.2444 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- machines | .2521704 .029225 8.63 0.000 .1948905 .3094503 workers | .2770419 .0298596 9.28 0.000 .2185182 .3355656 _cons | -2.942796 .4533121 -6.49 0.000 -3.831272 -2.054321 -------------+---------------------------------------------------------------- /mu | 2.738783 .5348416 5.12 0.000 1.690513 3.787053 /lnsigma2 | 1.181465 .1141596 10.35 0.000 .9577159 1.405213 /ilgtgamma | .1419267 .2163486 0.66 0.512 -.2821087 .5659621 -------------+---------------------------------------------------------------- sigma2 | 3.259144 .3720624 2.605738 4.076396 gamma | .5354222 .0538157 .4299369 .6378309 sigma_u2 | 1.745018 .3663029 1.027078 2.462958 sigma_v2 | 1.514126 .0730942 1.370864 1.657388 ------------------------------------------------------------------------------ . . ** time-invariant model with constraint . constraint define 1 _b[lnmachines] + _b[lnworkers] = 1 . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) constraint(1) Iteration 0: log likelihood = -1686.5627 Iteration 1: log likelihood = -1617.8857 (not concave) Iteration 2: log likelihood = -1615.9986 Iteration 3: log likelihood = -1614.363 Iteration 4: log likelihood = -1614.2972 Iteration 5: log likelihood = -1614.2969 Iteration 6: log likelihood = -1614.2969 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 1541.26 Log likelihood = -1614.2969 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .5111367 .0130197 39.26 0.000 .4856186 .5366547 lnworkers | .4888633 .0130197 37.55 0.000 .4633453 .5143814 _cons | 3.780147 .1779939 21.24 0.000 3.431285 4.129009 -------------+---------------------------------------------------------------- /mu | 1.589284 .5411177 2.94 0.003 .5287125 2.649855 /lnsigma2 | 1.463107 .2139014 6.84 0.000 1.043868 1.882346 /ilgtgamma | .7568042 .3178696 2.38 0.017 .1337912 1.379817 -------------+---------------------------------------------------------------- sigma2 | 4.319358 .923917 2.840181 6.568897 gamma | .6806595 .0690928 .533398 .7989616 sigma_u2 | 2.940012 .9222347 1.132465 4.747559 sigma_v2 | 1.379346 .0664462 1.249114 1.509578 ------------------------------------------------------------------------------ . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) constraint(1) cost Iteration 0: log likelihood = -1660.4883 (not concave) Iteration 1: log likelihood = -1625.5819 Iteration 2: log likelihood = -1621.94 Iteration 3: log likelihood = -1619.0797 Iteration 4: log likelihood = -1618.7807 Iteration 5: log likelihood = -1618.7598 Iteration 6: log likelihood = -1618.7597 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 1527.66 Log likelihood = -1618.7597 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .5108596 .0130704 39.09 0.000 .4852421 .5364771 lnworkers | .4891404 .0130704 37.42 0.000 .4635229 .5147579 _cons | -1.690698 .5887429 -2.87 0.004 -2.844613 -.5367834 -------------+---------------------------------------------------------------- /mu | 3.30837 .6438334 5.14 0.000 2.04648 4.57026 /lnsigma2 | 1.183424 .1084734 10.91 0.000 .9708196 1.396028 /ilgtgamma | .3079684 .1924433 1.60 0.110 -.0692135 .6851502 -------------+---------------------------------------------------------------- sigma2 | 3.265535 .3542237 2.640107 4.039123 gamma | .5763893 .0469878 .4827035 .6648872 sigma_u2 | 1.882219 .3490438 1.198106 2.566333 sigma_v2 | 1.383316 .0667903 1.252409 1.514222 ------------------------------------------------------------------------------ . . constraint define 2 _b[lnmachines] = _b[lnworkers] . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) constraint(2) Iteration 0: log likelihood = -1473.844 Iteration 1: log likelihood = -1473.06 Iteration 2: log likelihood = -1472.6304 Iteration 3: log likelihood = -1472.6221 Iteration 4: log likelihood = -1472.622 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 661.68 Log likelihood = -1472.622 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .2925168 .0113718 25.72 0.000 .2702286 .3148051 lnworkers | .2925168 .0113718 25.72 0.000 .2702286 .3148051 _cons | 3.029892 .1439011 21.06 0.000 2.747851 3.311933 -------------+---------------------------------------------------------------- /mu | 1.123155 .6487434 1.73 0.083 -.1483586 2.394669 /lnsigma2 | 1.422368 .2675059 5.32 0.000 .898066 1.94667 /ilgtgamma | 1.139088 .3565359 3.19 0.001 .4402902 1.837885 -------------+---------------------------------------------------------------- sigma2 | 4.146928 1.109328 2.454851 7.00532 gamma | .7575121 .0654912 .6083282 .8626984 sigma_u2 | 3.141348 1.108628 .9684774 5.31422 sigma_v2 | 1.00558 .0484174 .9106837 1.100476 ------------------------------------------------------------------------------ . xtfrontier lnwidgets lnmachines lnworkers, ti i(id) constraint(2) cost Iteration 0: log likelihood = -1501.3156 Iteration 1: log likelihood = -1498.266 Iteration 2: log likelihood = -1479.5339 Iteration 3: log likelihood = -1478.9207 Iteration 4: log likelihood = -1478.9166 Iteration 5: log likelihood = -1478.9166 Time-invariant inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 660.52 Log likelihood = -1478.9166 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .2932562 .0114105 25.70 0.000 .270892 .3156203 lnworkers | .2932562 .0114105 25.70 0.000 .270892 .3156203 _cons | -1.926673 .4589924 -4.20 0.000 -2.826282 -1.027065 -------------+---------------------------------------------------------------- /mu | 3.00663 .5224647 5.75 0.000 1.982618 4.030642 /lnsigma2 | 1.020843 .1217041 8.39 0.000 .7823069 1.259378 /ilgtgamma | .5599347 .1962039 2.85 0.004 .1753822 .9444872 -------------+---------------------------------------------------------------- sigma2 | 2.775532 .3377937 2.186511 3.52323 gamma | .6364374 .0453986 .5437335 .7200052 sigma_u2 | 1.766453 .334867 1.110125 2.42278 sigma_v2 | 1.00908 .048725 .9135804 1.104579 ------------------------------------------------------------------------------ . . ** time-varying decay model . xtfrontier lnwidgets lnmachines lnworkers, tvd i(id) t(t) Iteration 0: log likelihood = -1551.3798 (not concave) Iteration 1: log likelihood = -1502.2637 Iteration 2: log likelihood = -1476.3093 (not concave) Iteration 3: log likelihood = -1472.9845 Iteration 4: log likelihood = -1472.5365 Iteration 5: log likelihood = -1472.529 Iteration 6: log likelihood = -1472.5289 Time-varying decay inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 661.93 Log likelihood = -1472.5289 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .2907555 .0164376 17.69 0.000 .2585384 .3229725 lnworkers | .2942412 .0154373 19.06 0.000 .2639846 .3244978 _cons | 3.028939 .1436046 21.09 0.000 2.74748 3.310399 -------------+---------------------------------------------------------------- /mu | 1.110831 .6452809 1.72 0.085 -.1538967 2.375558 /eta | .0016764 .00425 0.39 0.693 -.0066535 .0100064 /lnsigma2 | 1.410723 .2679485 5.26 0.000 .885554 1.935893 /ilgtgamma | 1.123982 .3584243 3.14 0.002 .4214828 1.82648 -------------+---------------------------------------------------------------- sigma2 | 4.098919 1.098299 2.424327 6.930228 gamma | .7547265 .0663495 .603838 .8613419 sigma_u2 | 3.093563 1.097606 .9422943 5.244832 sigma_v2 | 1.005356 .0484079 .9104785 1.100234 ------------------------------------------------------------------------------ . . ** time-varying decay model in terms of a cost function . xtfrontier lnwidgets lnmachines lnworkers, tvd i(id) t(t) cost Iteration 0: log likelihood = -1811.7997 (not concave) Iteration 1: log likelihood = -1804.7908 (not concave) Iteration 2: log likelihood = -1800.929 (not concave) Iteration 3: log likelihood = -1658.3367 (not concave) Iteration 4: log likelihood = -1546.2313 Iteration 5: log likelihood = -1483.6914 Iteration 6: log likelihood = -1478.7575 Iteration 7: log likelihood = -1478.0809 Iteration 8: log likelihood = -1478.0799 Iteration 9: log likelihood = -1478.0799 Time-varying decay inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 658.28 Log likelihood = -1478.0799 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .2891801 .0165254 17.50 0.000 .2567909 .3215692 lnworkers | .2957804 .0154644 19.13 0.000 .2654708 .32609 _cons | -1.896644 .4284317 -4.43 0.000 -2.736355 -1.056934 -------------+---------------------------------------------------------------- /mu | 2.917927 .4944838 5.90 0.000 1.948757 3.887097 /eta | .0039011 .0031218 1.25 0.211 -.0022174 .0100197 /lnsigma2 | 1.000129 .1212228 8.25 0.000 .762537 1.237722 /ilgtgamma | .5304644 .1974056 2.69 0.007 .1435566 .9173722 -------------+---------------------------------------------------------------- sigma2 | 2.718633 .3295602 2.143708 3.447749 gamma | .6295914 .0460362 .5358276 .7145064 sigma_u2 | 1.711628 .3265718 1.071559 2.351697 sigma_v2 | 1.007005 .0486255 .9117009 1.102309 ------------------------------------------------------------------------------ . xtfrontier lnwidgets machines workers, tvd i(id) t(t) cost Iteration 0: log likelihood = -1877.6829 (not concave) Iteration 1: log likelihood = -1870.5548 (not concave) Iteration 2: log likelihood = -1847.2125 (not concave) Iteration 3: log likelihood = -1845.1773 (not concave) Iteration 4: log likelihood = -1812.0667 (not concave) Iteration 5: log likelihood = -1797.6096 (not concave) Iteration 6: log likelihood = -1754.7265 (not concave) Iteration 7: log likelihood = -1701.1837 Iteration 8: log likelihood = -1666.3427 Iteration 9: log likelihood = -1651.3357 Iteration 10: log likelihood = -1650.2117 Iteration 11: log likelihood = -1650.1836 Iteration 12: log likelihood = -1650.1825 Iteration 13: log likelihood = -1650.1825 Time-varying decay inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(2) = 156.13 Log likelihood = -1650.1825 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- machines | .2534007 .0291554 8.69 0.000 .1962571 .3105443 workers | .2769901 .0297895 9.30 0.000 .2186038 .3353765 _cons | -2.945962 .4446707 -6.63 0.000 -3.8175 -2.074423 -------------+---------------------------------------------------------------- /mu | 2.636858 .5206263 5.06 0.000 1.616449 3.657267 /eta | .0081311 .0041415 1.96 0.050 .000014 .0162483 /lnsigma2 | 1.139759 .110377 10.33 0.000 .9234245 1.356094 /ilgtgamma | .072507 .2156384 0.34 0.737 -.3501366 .4951505 -------------+---------------------------------------------------------------- sigma2 | 3.126016 .3450403 2.517898 3.881006 gamma | .5181188 .0538388 .4133493 .621319 sigma_u2 | 1.619648 .3387884 .9556347 2.283661 sigma_v2 | 1.506368 .0727234 1.363833 1.648904 ------------------------------------------------------------------------------ . . ** time-varying decay model with constraint . constraint define 3 _b[lnmachines] = 2* _b[lnworkers] . xtfrontier lnwidgets lnmachines lnworkers, tvd i(id) t(t) constraint(3) Iteration 0: log likelihood = -1567.7719 (not concave) Iteration 1: log likelihood = -1517.9039 Iteration 2: log likelihood = -1508.2221 Iteration 3: log likelihood = -1507.8289 Iteration 4: log likelihood = -1507.817 Iteration 5: log likelihood = -1507.8169 Time-varying decay inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 541.07 Log likelihood = -1507.8169 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .3548136 .0152537 23.26 0.000 .3249169 .3847104 lnworkers | .1774068 .0076269 23.26 0.000 .1624585 .1923552 _cons | 2.875151 .1424348 20.19 0.000 2.595984 3.154318 -------------+---------------------------------------------------------------- /mu | .9366172 .7177036 1.31 0.192 -.470056 2.34329 /eta | .0031202 .0045926 0.68 0.497 -.0058813 .0121216 /lnsigma2 | 1.442667 .2796637 5.16 0.000 .8945358 1.990797 /ilgtgamma | 1.053067 .3804413 2.77 0.006 .3074158 1.798718 -------------+---------------------------------------------------------------- sigma2 | 4.231966 1.183527 2.4462 7.32137 gamma | .7413634 .0729472 .5762544 .8579929 sigma_u2 | 3.137425 1.182784 .81921 5.45564 sigma_v2 | 1.094541 .0526787 .9912927 1.19779 ------------------------------------------------------------------------------ . xtfrontier lnwidgets lnmachines lnworkers, tvd i(id) t(t) constraint(3) cost Iteration 0: log likelihood = -1819.0916 (not concave) Iteration 1: log likelihood = -1811.3139 (not concave) Iteration 2: log likelihood = -1810.3401 (not concave) Iteration 3: log likelihood = -1803.9761 (not concave) Iteration 4: log likelihood = -1797.9018 (not concave) Iteration 5: log likelihood = -1656.4115 (not concave) Iteration 6: log likelihood = -1607.5143 (not concave) Iteration 7: log likelihood = -1549.0213 Iteration 8: log likelihood = -1518.3154 Iteration 9: log likelihood = -1514.5209 Iteration 10: log likelihood = -1514.2756 Iteration 11: log likelihood = -1514.2752 Iteration 12: log likelihood = -1514.2752 Time-varying decay inefficiency model Number of obs = 948 Group variable (i): id Number of groups = 91 Time variable (t): t Obs per group: min = 6 avg = 10.4 max = 14 Wald chi2(1) = 534.16 Log likelihood = -1514.2752 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lnwidgets | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- lnmachines | .3546735 .0153459 23.11 0.000 .3245961 .3847508 lnworkers | .1773367 .0076729 23.11 0.000 .1622981 .1923754 _cons | -2.004618 .4861114 -4.12 0.000 -2.957379 -1.051857 -------------+---------------------------------------------------------------- /mu | 2.958217 .5499178 5.38 0.000 1.880397 4.036036 /eta | .0029589 .0032369 0.91 0.361 -.0033853 .0093032 /lnsigma2 | 1.016278 .1161934 8.75 0.000 .7885426 1.244013 /ilgtgamma | .4162817 .1972866 2.11 0.035 .0296072 .8029563 -------------+---------------------------------------------------------------- sigma2 | 2.762891 .3210298 2.200188 3.469507 gamma | .6025932 .0472451 .5074013 .6906065 sigma_u2 | 1.664899 .3173578 1.042889 2.286909 sigma_v2 | 1.097992 .0530204 .9940738 1.20191 ------------------------------------------------------------------------------ . . **************************** . * xthtaylor * . **************************** . . *webuse xthtaylor1.dta,clear . *save xthtaylor1.dta . * use http://www.stata-press.com/data/r8/xthtaylor1, clear . . use xthtaylor1.dta, clear . . ** Hausman-taylor estimator with only endogenous variables . correlate ui z1 z2 x1a x1b x2 eit (obs=10000) | ui z1 z2 x1a x1b x2 eit -------------+--------------------------------------------------------------- ui | 1.0000 z1 | 0.0268 1.0000 z2 | 0.8777 0.0286 1.0000 x1a | -0.0145 0.0065 -0.0034 1.0000 x1b | 0.0026 0.0079 0.0038 -0.0030 1.0000 x2 | 0.8765 0.0191 0.7671 -0.0192 0.0037 1.0000 eit | 0.0060 -0.0198 0.0123 -0.0100 -0.0138 0.0092 1.0000 . xthtaylor yit x1a x1b x2 z1 z2, endog(x2 z2) i(id) Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(5) = 24172.91 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.959736 .0330233 89.63 0.000 2.895011 3.02446 x1b | 2.953891 .0333051 88.69 0.000 2.888614 3.019168 TVendogenous | x2 | 3.022685 .033085 91.36 0.000 2.957839 3.08753 TIexogenous | z1 | 2.709179 .587031 4.62 0.000 1.55862 3.859739 TIendogenous | z2 | 9.525973 8.572966 1.11 0.266 -7.276732 26.32868 | _cons | 2.837072 .4276595 6.63 0.000 1.998875 3.675269 -------------+---------------------------------------------------------------- sigma_u | 8.729479 sigma_e | 3.1657492 rho | .88377062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2, endog(x2 z2) i(id) t(t) amacurdy Amemiya-MaCurdy estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(5) = 26543.37 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.959344 .0315431 93.82 0.000 2.89752 3.021167 x1b | 2.954281 .0318127 92.86 0.000 2.891929 3.016633 TVendogenous | x2 | 3.023333 .0316108 95.64 0.000 2.961377 3.085289 TIexogenous | z1 | 2.934426 .275198 10.66 0.000 2.395048 3.473804 TIendogenous | z2 | 5.780192 1.02449 5.64 0.000 3.772229 7.788155 | _cons | 2.979106 .2683036 11.10 0.000 2.453241 3.504971 -------------+---------------------------------------------------------------- sigma_u | 8.729479 sigma_e | 3.1657492 rho | .88377062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2, endog(x2 z2) i(id) t(t) small Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(5) = 24172.91 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.959736 .0330233 89.63 0.000 2.895003 3.024468 x1b | 2.953891 .0333051 88.69 0.000 2.888606 3.019176 TVendogenous | x2 | 3.022685 .033085 91.36 0.000 2.957832 3.087538 TIexogenous | z1 | 2.709179 .587031 4.62 0.000 1.55848 3.859878 TIendogenous | z2 | 9.525973 8.572966 1.11 0.267 -7.278766 26.33071 | _cons | 2.837072 .4276595 6.63 0.000 1.998774 3.675371 -------------+---------------------------------------------------------------- sigma_u | 8.729479 sigma_e | 3.1657492 rho | .88377062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2, endog(x2 z2) i(id) t(t) amacurdy small Amemiya-MaCurdy estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(5) = 26543.37 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.959344 .0315431 93.82 0.000 2.897513 3.021175 x1b | 2.954281 .0318127 92.86 0.000 2.891922 3.01664 TVendogenous | x2 | 3.023333 .0316108 95.64 0.000 2.961369 3.085296 TIexogenous | z1 | 2.934426 .275198 10.66 0.000 2.394983 3.47387 TIendogenous | z2 | 5.780192 1.02449 5.64 0.000 3.771985 7.788398 | _cons | 2.979106 .2683036 11.10 0.000 2.453177 3.505035 -------------+---------------------------------------------------------------- sigma_u | 8.729479 sigma_e | 3.1657492 rho | .88377062 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . ** Hausman-taylor estimator with constant variables . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) constant(z1 z2 ui) i(id) Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 283334.76 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.960114 .033041 89.59 0.000 2.895355 3.024873 x1b | 2.955181 .0317271 93.14 0.000 2.892997 3.017365 TVendogenous | x2 | 3.02257 .0330989 91.32 0.000 2.957697 3.087443 TIexogenous | z1 | 2.93147 .0352725 83.11 0.000 2.862337 3.000603 ui | .8449571 .1870868 4.52 0.000 .4782738 1.21164 TIendogenous | z2 | 3.507141 .6241467 5.62 0.000 2.283835 4.730446 | _cons | 2.995308 .0352287 85.02 0.000 2.926261 3.064355 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) constant(z1 z2 ui) i(id) t(t) amacurdy Amemiya-MaCurdy estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 288521.34 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.968687 .0313966 94.55 0.000 2.907151 3.030223 x1b | 2.956568 .0314129 94.12 0.000 2.894999 3.018136 TVendogenous | x2 | 3.021085 .0327859 92.15 0.000 2.956826 3.085344 TIexogenous | z1 | 2.936984 .0344449 85.27 0.000 2.869473 3.004495 ui | 1.001444 .0749004 13.37 0.000 .8546424 1.148247 TIendogenous | z2 | 2.985174 .24794 12.04 0.000 2.49922 3.471127 | _cons | 3.002082 .0341385 87.94 0.000 2.935172 3.068992 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) constant(z1 z2 ui) i(id) t(t) small Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 283334.76 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.960114 .033041 89.59 0.000 2.895347 3.024881 x1b | 2.955181 .0317271 93.14 0.000 2.89299 3.017373 TVendogenous | x2 | 3.02257 .0330989 91.32 0.000 2.957689 3.08745 TIexogenous | z1 | 2.93147 .0352725 83.11 0.000 2.862328 3.000611 ui | .8449571 .1870868 4.52 0.000 .4782294 1.211685 TIendogenous | z2 | 3.507141 .6241467 5.62 0.000 2.283687 4.730594 | _cons | 2.995308 .0352287 85.02 0.000 2.926253 3.064363 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . ** Hausman-taylor estimator with varying variables . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) varying(x2 x1a x1b) i(id) Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 283334.76 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.960114 .033041 89.59 0.000 2.895355 3.024873 x1b | 2.955181 .0317271 93.14 0.000 2.892997 3.017365 TVendogenous | x2 | 3.02257 .0330989 91.32 0.000 2.957697 3.087443 TIexogenous | z1 | 2.93147 .0352725 83.11 0.000 2.862337 3.000603 ui | .8449571 .1870868 4.52 0.000 .4782738 1.21164 TIendogenous | z2 | 3.507141 .6241467 5.62 0.000 2.283835 4.730446 | _cons | 2.995308 .0352287 85.02 0.000 2.926261 3.064355 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) varying(x2 x1a x1b) i(id) t(t) amacurdy Amemiya-MaCurdy estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 288521.34 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.968687 .0313966 94.55 0.000 2.907151 3.030223 x1b | 2.956568 .0314129 94.12 0.000 2.894999 3.018136 TVendogenous | x2 | 3.021085 .0327859 92.15 0.000 2.956826 3.085344 TIexogenous | z1 | 2.936984 .0344449 85.27 0.000 2.869473 3.004495 ui | 1.001444 .0749004 13.37 0.000 .8546424 1.148247 TIendogenous | z2 | 2.985174 .24794 12.04 0.000 2.49922 3.471127 | _cons | 3.002082 .0341385 87.94 0.000 2.935172 3.068992 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor yit x1a x1b x2 z1 z2 ui, endog(x2 z2) varying(x2 x1a x1b) i(id) t(t) small Hausman-Taylor estimation Number of obs = 10000 Group variable (i): id Number of groups = 1000 Obs per group: min = 10 avg = 10 max = 10 Random effects u_i ~ i.i.d. Wald chi2(6) = 283334.76 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ yit | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | x1a | 2.960114 .033041 89.59 0.000 2.895347 3.024881 x1b | 2.955181 .0317271 93.14 0.000 2.89299 3.017373 TVendogenous | x2 | 3.02257 .0330989 91.32 0.000 2.957689 3.08745 TIexogenous | z1 | 2.93147 .0352725 83.11 0.000 2.862328 3.000611 ui | .8449571 .1870868 4.52 0.000 .4782294 1.211685 TIendogenous | z2 | 3.507141 .6241467 5.62 0.000 2.283687 4.730594 | _cons | 2.995308 .0352287 85.02 0.000 2.926253 3.064363 -------------+---------------------------------------------------------------- sigma_u | .41494012 sigma_e | 3.1657492 rho | .01688963 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . *webuse psidextract.dta,clear . *save psidextract.dta . * use http://www.stata-press.com/data/r8/psidextract, clear . . use psidextract.dta,clear . iis id . tis t . . xtsum exp exp2 wks ms union, i(id) Variable | Mean Std. Dev. Min Max | Observations -----------------+--------------------------------------------+---------------- exp overall | 19.85378 10.96637 1 51 | N = 4165 between | 10.79018 4 48 | n = 595 within | 2.00024 16.85378 22.85378 | T = 7 | | exp2 overall | 514.405 496.9962 1 2601 | N = 4165 between | 489.0495 20 2308 | n = 595 within | 90.44581 231.405 807.405 | T = 7 | | wks overall | 46.81152 5.129098 5 52 | N = 4165 between | 3.284016 31.57143 51.57143 | n = 595 within | 3.941881 12.2401 63.66867 | T = 7 | | ms overall | .8144058 .3888256 0 1 | N = 4165 between | .3686109 0 1 | n = 595 within | .1245274 -.0427371 1.671549 | T = 7 | | union overall | .3639856 .4812023 0 1 | N = 4165 between | .4543848 0 1 | n = 595 within | .1593351 -.4931573 1.221128 | T = 7 . . ** Hausman-taylor estimator with only endogenous variables . correlate fem blk occ south smsa ind ed (obs=4165) | fem blk occ south smsa ind ed -------------+--------------------------------------------------------------- fem | 1.0000 blk | 0.2086 1.0000 occ | -0.0847 0.0837 1.0000 south | 0.0516 0.1218 0.0413 1.0000 smsa | 0.1044 0.1154 -0.2018 -0.1350 1.0000 ind | -0.1778 -0.0475 0.2260 -0.0769 -0.0689 1.0000 ed | -0.0012 -0.1196 -0.6194 -0.1216 0.1843 -0.2365 1.0000 . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477149 .0063055 south | .0074398 .031955 0.23 0.816 -.0551908 .0700705 smsa | -.0418334 .0189581 -2.21 0.027 -.0789906 -.0046761 ind | .0136039 .0152374 0.89 0.372 -.0162608 .0434686 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082898 .1179758 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003119 wks | .0008374 .0005997 1.40 0.163 -.0003381 .0020129 ms | -.0298508 .01898 -1.57 0.116 -.0670508 .0073493 union | .0327714 .0149084 2.20 0.028 .0035514 .0619914 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3791707 .1173234 blk | -.2857479 .1557019 -1.84 0.066 -.5909179 .0194221 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962977 .1795902 | _cons | 2.912726 .2836522 10.27 0.000 2.356778 3.468674 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp* wks ms union fem blk ed, endog(exp exp2 wks ms union ed) amacu > rdy Amemiya-MaCurdy estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6879.20 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0208498 .0137653 -1.51 0.130 -.0478292 .0061297 south | .0072818 .0319365 0.23 0.820 -.0553126 .0698761 smsa | -.0419507 .0189471 -2.21 0.027 -.0790864 -.0048149 ind | .0136289 .015229 0.89 0.371 -.0162194 .0434771 TVendogenous | exp | .1129704 .0024688 45.76 0.000 .1081316 .1178093 exp2 | -.0004214 .0000546 -7.72 0.000 -.0005283 -.0003145 wks | .0008381 .0005995 1.40 0.162 -.0003368 .002013 ms | -.0300894 .0189674 -1.59 0.113 -.0672649 .0070861 union | .0324752 .0148939 2.18 0.029 .0032837 .0616667 TIexogenous | fem | -.132008 .1266039 -1.04 0.297 -.380147 .1161311 blk | -.2859004 .1554857 -1.84 0.066 -.5906468 .0188459 TIendogenous | ed | .1372049 .0205695 6.67 0.000 .0968894 .1775205 | _cons | 2.927338 .2751274 10.64 0.000 2.388098 3.466578 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp* wks ms union fem blk ed, endog(exp exp2 wks ms union ed) small Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477227 .0063133 south | .0074398 .031955 0.23 0.816 -.0552091 .0700888 smsa | -.0418334 .0189581 -2.21 0.027 -.0790014 -.0046653 ind | .0136039 .0152374 0.89 0.372 -.0162695 .0434773 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082884 .1179772 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003118 wks | .0008374 .0005997 1.40 0.163 -.0003384 .0020132 ms | -.0298508 .01898 -1.57 0.116 -.0670617 .0073601 union | .0327714 .0149084 2.20 0.028 .0035429 .062 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3792431 .1173958 blk | -.2857479 .1557019 -1.84 0.067 -.5910069 .0195111 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962855 .1796024 | _cons | 2.912726 .2836522 10.27 0.000 2.356616 3.468837 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp* wks ms union fem blk ed, endog(exp exp2 wks ms union ed) amacu > rdy small Amemiya-MaCurdy estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6879.20 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0208498 .0137653 -1.51 0.130 -.0478371 .0061376 south | .0072818 .0319365 0.23 0.820 -.0553308 .0698944 smsa | -.0419507 .0189471 -2.21 0.027 -.0790972 -.0048041 ind | .0136289 .015229 0.89 0.371 -.0162281 .0434858 TVendogenous | exp | .1129704 .0024688 45.76 0.000 .1081302 .1178107 exp2 | -.0004214 .0000546 -7.72 0.000 -.0005284 -.0003144 wks | .0008381 .0005995 1.40 0.162 -.0003372 .0020133 ms | -.0300894 .0189674 -1.59 0.113 -.0672758 .0070969 union | .0324752 .0148939 2.18 0.029 .0032752 .0616752 TIexogenous | fem | -.132008 .1266039 -1.04 0.297 -.3802193 .1162034 blk | -.2859004 .1554857 -1.84 0.066 -.5907356 .0189348 TIendogenous | ed | .1372049 .0205695 6.67 0.000 .0968776 .1775323 | _cons | 2.927338 .2751274 10.64 0.000 2.387941 3.466735 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . ** Hausman-taylor estimator with constant variables . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ constant(fem blk ed) Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477149 .0063055 south | .0074398 .031955 0.23 0.816 -.0551908 .0700705 smsa | -.0418334 .0189581 -2.21 0.027 -.0789906 -.0046761 ind | .0136039 .0152374 0.89 0.372 -.0162608 .0434686 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082898 .1179758 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003119 wks | .0008374 .0005997 1.40 0.163 -.0003381 .0020129 ms | -.0298508 .01898 -1.57 0.116 -.0670508 .0073493 union | .0327714 .0149084 2.20 0.028 .0035514 .0619914 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3791707 .1173234 blk | -.2857479 .1557019 -1.84 0.066 -.5909179 .0194221 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962977 .1795902 | _cons | 2.912726 .2836522 10.27 0.000 2.356778 3.468674 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ constant(fem blk ed) amacurdy Amemiya-MaCurdy estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6879.20 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0208498 .0137653 -1.51 0.130 -.0478292 .0061297 south | .0072818 .0319365 0.23 0.820 -.0553126 .0698761 smsa | -.0419507 .0189471 -2.21 0.027 -.0790864 -.0048149 ind | .0136289 .015229 0.89 0.371 -.0162194 .0434771 TVendogenous | exp | .1129704 .0024688 45.76 0.000 .1081316 .1178093 exp2 | -.0004214 .0000546 -7.72 0.000 -.0005283 -.0003145 wks | .0008381 .0005995 1.40 0.162 -.0003368 .002013 ms | -.0300894 .0189674 -1.59 0.113 -.0672649 .0070861 union | .0324752 .0148939 2.18 0.029 .0032837 .0616667 TIexogenous | fem | -.132008 .1266039 -1.04 0.297 -.380147 .1161311 blk | -.2859004 .1554857 -1.84 0.066 -.5906468 .0188459 TIendogenous | ed | .1372049 .0205695 6.67 0.000 .0968894 .1775205 | _cons | 2.927338 .2751274 10.64 0.000 2.388098 3.466578 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ constant(fem blk ed) small Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477227 .0063133 south | .0074398 .031955 0.23 0.816 -.0552091 .0700888 smsa | -.0418334 .0189581 -2.21 0.027 -.0790014 -.0046653 ind | .0136039 .0152374 0.89 0.372 -.0162695 .0434773 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082884 .1179772 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003118 wks | .0008374 .0005997 1.40 0.163 -.0003384 .0020132 ms | -.0298508 .01898 -1.57 0.116 -.0670617 .0073601 union | .0327714 .0149084 2.20 0.028 .0035429 .062 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3792431 .1173958 blk | -.2857479 .1557019 -1.84 0.067 -.5910069 .0195111 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962855 .1796024 | _cons | 2.912726 .2836522 10.27 0.000 2.356616 3.468837 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . ** Hausman-taylor estimator with varying variables . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ varying(ms exp* occ south smsa ind wks union) Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477149 .0063055 south | .0074398 .031955 0.23 0.816 -.0551908 .0700705 smsa | -.0418334 .0189581 -2.21 0.027 -.0789906 -.0046761 ind | .0136039 .0152374 0.89 0.372 -.0162608 .0434686 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082898 .1179758 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003119 wks | .0008374 .0005997 1.40 0.163 -.0003381 .0020129 ms | -.0298508 .01898 -1.57 0.116 -.0670508 .0073493 union | .0327714 .0149084 2.20 0.028 .0035514 .0619914 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3791707 .1173234 blk | -.2857479 .1557019 -1.84 0.066 -.5909179 .0194221 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962977 .1795902 | _cons | 2.912726 .2836522 10.27 0.000 2.356778 3.468674 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ varying(ms exp* occ south smsa ind wks union) amacurdy Amemiya-MaCurdy estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6879.20 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0208498 .0137653 -1.51 0.130 -.0478292 .0061297 south | .0072818 .0319365 0.23 0.820 -.0553126 .0698761 smsa | -.0419507 .0189471 -2.21 0.027 -.0790864 -.0048149 ind | .0136289 .015229 0.89 0.371 -.0162194 .0434771 TVendogenous | exp | .1129704 .0024688 45.76 0.000 .1081316 .1178093 exp2 | -.0004214 .0000546 -7.72 0.000 -.0005283 -.0003145 wks | .0008381 .0005995 1.40 0.162 -.0003368 .002013 ms | -.0300894 .0189674 -1.59 0.113 -.0672649 .0070861 union | .0324752 .0148939 2.18 0.029 .0032837 .0616667 TIexogenous | fem | -.132008 .1266039 -1.04 0.297 -.380147 .1161311 blk | -.2859004 .1554857 -1.84 0.066 -.5906468 .0188459 TIendogenous | ed | .1372049 .0205695 6.67 0.000 .0968894 .1775205 | _cons | 2.927338 .2751274 10.64 0.000 2.388098 3.466578 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . xthtaylor lwage occ south smsa ind exp exp2 wks ms union fem blk ed, endog(exp exp2 wks ms union ed) / > * > */ varying(ms exp* occ south smsa ind wks union) small Hausman-Taylor estimation Number of obs = 4165 Group variable (i): id Number of groups = 595 Obs per group: min = 7 avg = 7 max = 7 Random effects u_i ~ i.i.d. Wald chi2(12) = 6891.87 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ lwage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- TVexogenous | occ | -.0207047 .0137809 -1.50 0.133 -.0477227 .0063133 south | .0074398 .031955 0.23 0.816 -.0552091 .0700888 smsa | -.0418334 .0189581 -2.21 0.027 -.0790014 -.0046653 ind | .0136039 .0152374 0.89 0.372 -.0162695 .0434773 TVendogenous | exp | .1131328 .002471 45.79 0.000 .1082884 .1179772 exp2 | -.0004189 .0000546 -7.67 0.000 -.0005259 -.0003118 wks | .0008374 .0005997 1.40 0.163 -.0003384 .0020132 ms | -.0298508 .01898 -1.57 0.116 -.0670617 .0073601 union | .0327714 .0149084 2.20 0.028 .0035429 .062 TIexogenous | fem | -.1309236 .126659 -1.03 0.301 -.3792431 .1173958 blk | -.2857479 .1557019 -1.84 0.067 -.5910069 .0195111 TIendogenous | ed | .137944 .0212485 6.49 0.000 .0962855 .1796024 | _cons | 2.912726 .2836522 10.27 0.000 2.356616 3.468837 -------------+---------------------------------------------------------------- sigma_u | .94180304 sigma_e | .15180273 rho | .97467788 (fraction of variance due to u_i) ------------------------------------------------------------------------------ note: TV refers to time-varying; TI refers to time-invariant. . . . . . . . . . . . . . . end of do-file