Dear stateliest-ers,
I am trying to replicate margins estimation after xttobit, based on the gsem routine. Here is what I have done.
The margins are estimated as follows:
I finally replicate the xttobit results with gsem:
Now, how can I get the same marginal effects I got after the xttobit?
Many thanks!
Rohit
I am trying to replicate margins estimation after xttobit, based on the gsem routine. Here is what I have done.
Code:
. webuse nlswork3 (National Longitudinal Survey. Young Women 14-26 years of age in 1968) . xtset idcode year panel variable: idcode (unbalanced) time variable: year, 68 to 88, but with gaps delta: 1 unit . xttobit ln_wage union age grade not_smsa, ul(1.9) Obtaining starting values for full model: Iteration 0: log likelihood = -5570.3905 Iteration 1: log likelihood = -5434.9487 Iteration 2: log likelihood = -5433.7625 Iteration 3: log likelihood = -5433.7619 Fitting full model: Iteration 0: log likelihood = -6935.1692 Iteration 1: log likelihood = -6877.0531 Iteration 2: log likelihood = -6875.2535 Iteration 3: log likelihood = -6875.252 Iteration 4: log likelihood = -6875.252 Random-effects tobit regression Number of obs = 19,224 Group variable: idcode Number of groups = 4,148 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 4.6 max = 12 Integration method: mvaghermite Integration pts. = 12 Wald chi2(4) = 2770.47 Log likelihood = -6875.252 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ ln_wage | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1482463 .0069843 21.23 0.000 .1345573 .1619353 age | .0104275 .0004148 25.14 0.000 .0096146 .0112404 grade | .0807764 .0022986 35.14 0.000 .0762713 .0852815 not_smsa | -.1454109 .0092189 -15.77 0.000 -.1634796 -.1273421 _cons | .3629613 .0319946 11.34 0.000 .3002531 .4256696 -------------+---------------------------------------------------------------- /sigma_u | .3094639 .0048855 63.34 0.000 .2998886 .3190393 /sigma_e | .2492985 .0018282 136.36 0.000 .2457152 .2528817 -------------+---------------------------------------------------------------- rho | .6064422 .0083153 .5900559 .6226421 ------------------------------------------------------------------------------ 0 left-censored observations 12,334 uncensored observations 6,890 right-censored observations
Code:
. margins, dydx(*) atmeans predict(ystar(.,1.9)) Conditional marginal effects Number of obs = 19,224 Model VCE : OIM Expression : E(ln_wage*|ln_wage<1.9), predict(ystar(.,1.9)) dy/dx w.r.t. : union age grade not_smsa at : union = .2342905 (mean) age = 31.36366 (mean) grade = 12.7642 (mean) not_smsa = .2829796 (mean) ------------------------------------------------------------------------------ | Delta-method | dy/dx Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- union | .1007414 .0047869 21.05 0.000 .0913592 .1101236 age | .0070861 .0002829 25.05 0.000 .0065317 .0076404 grade | .0548919 .0015846 34.64 0.000 .0517862 .0579977 not_smsa | -.0988145 .0063094 -15.66 0.000 -.1111807 -.0864483 ------------------------------------------------------------------------------
Code:
. gsem ln_wage <- union age grade not_smsa RE[idcode], family(gaussian, rcensored(1.9) > ) Fitting fixed-effects model: Iteration 0: log likelihood = -11846.483 Iteration 1: log likelihood = -10432.472 Iteration 2: log likelihood = -10312.817 Iteration 3: log likelihood = -10312.543 Iteration 4: log likelihood = -10312.543 Refining starting values: Grid node 0: log likelihood = -10058.171 Fitting full model: Iteration 0: log likelihood = -10058.171 (not concave) Iteration 1: log likelihood = -8744.4558 (not concave) Iteration 2: log likelihood = -7819.9317 (not concave) Iteration 3: log likelihood = -7098.5025 Iteration 4: log likelihood = -6918.365 Iteration 5: log likelihood = -6875.2693 Iteration 6: log likelihood = -6875.102 Iteration 7: log likelihood = -6875.102 Generalized structural equation model Number of obs = 19,224 Response : ln_wage Uncensored = 12,334 Upper limit : 1.9 Left-censored = 0 Family : Gaussian Right-censored = 6,890 Link : identity Log likelihood = -6875.102 ( 1) [ln_wage]RE[idcode] = 1 -------------------------------------------------------------------------------- | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- ln_wage <- | union | .1482403 .006981 21.23 0.000 .1345578 .1619229 age | .0104287 .0004147 25.15 0.000 .0096159 .0112415 grade | .0808181 .0022927 35.25 0.000 .0763245 .0853117 not_smsa | -.1454202 .0092168 -15.78 0.000 -.1634848 -.1273557 | RE[idcode] | 1 (constrained) | _cons | .3624916 .0319395 11.35 0.000 .2998912 .4250919 ---------------+---------------------------------------------------------------- var(RE[idcode])| .0958442 .0030309 .0900841 .1019727 ---------------+---------------------------------------------------------------- var(e.ln_wage)| .0621425 .0009115 .0603815 .0639549 --------------------------------------------------------------------------------
Many thanks!
Rohit