Here is a sample / modified regression output, where the dependent variable (score) is censored from above and below.
HTML Code:
. metobit score ib2.sex##ib1.socioeconomic_status ||site:, ul(33) ll(0) nolog Mixed-effects tobit regression Number of obs = 2,517 Uncensored = 1,908 Limits: lower = 0 Left-censored = 605 upper = 33 Right-censored = 4 Group variable: site Number of groups = 18 Obs per group: min = 1 avg = 139.8 max = 544 Integration method: mvaghermite Integration pts. = 7 Wald chi2(5) = 157.08 Log likelihood = -6742.3941 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------------------ score | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------------------+---------------------------------------------------------------- 1.sex | -1.086671 .8398094 -1.29 0.196 -2.732667 .5593255 | socioeconomic_status | 2 | 4.746687 .6094876 7.79 0.000 3.552114 5.941261 3 | 2.188796 .5561682 3.94 0.000 1.098726 3.278866 | sex#socioeconomic_status | 1 2 | 1.175162 .9674324 1.21 0.224 -.7209706 3.071295 1 3 | .1404838 .9092797 0.15 0.877 -1.641672 1.922639 | _cons | 3.722792 1.754563 2.12 0.034 .2839111 7.161673 -------------------------+---------------------------------------------------------------- site | var(_cons)| 48.08904 17.2385 23.81856 97.09051 -------------------------+---------------------------------------------------------------- var(e.score)| 39.85155 1.345925 37.299 42.57878 ------------------------------------------------------------------------------------------ LR test vs. tobit model: chibar2(01) = 1258.16 Prob >= chibar2 = 0.0000
HTML Code:
. margins i.socioeconomic_status##i.sex, asobserved post Predictive margins Number of obs = 2,517 Model VCE : OIM Expression : Marginal linear prediction, predict() ------------------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------------------+---------------------------------------------------------------- socioeconomic_status | 1 | 3.292355 1.726483 1.91 0.057 -.0914902 6.6762 2 | 8.504531 1.69834 5.01 0.000 5.175847 11.83322 3 | 5.536797 1.688287 3.28 0.001 2.227816 8.845778 | sex | 1 | 5.706036 1.694424 3.37 0.001 2.385027 9.027045 2 | 6.37486 1.687879 3.78 0.000 3.066679 9.683041 | socioeconomic_status#sex | 1 1 | 2.636121 1.804892 1.46 0.144 -.9014013 6.173644 1 2 | 3.722792 1.754563 2.12 0.034 .2839111 7.161673 2 1 | 8.557971 1.721823 4.97 0.000 5.18326 11.93268 2 2 | 8.469479 1.711487 4.95 0.000 5.115027 11.82393 3 1 | 4.965401 1.70449 2.91 0.004 1.624661 8.306141 3 2 | 5.911588 1.693488 3.49 0.000 2.592413 9.230762 ------------------------------------------------------------------------------------------
HTML Code:
. margins i.socioeconomic_status##i.sex, predict(ystar(0,33)) asobserved post
Predictive margins Number of obs = 2,517
Model VCE : OIM
Expression : E(score*|0<score<33), predict(ystar(0,33))
------------------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
-------------------------+----------------------------------------------------------------
socioeconomic_status |
1 | 5.619221 1.097938 5.12 0.000 3.467302 7.77114
2 | 9.421321 1.381066 6.82 0.000 6.714481 12.12816
3 | 7.142504 1.216324 5.87 0.000 4.758552 9.526455
|
sex |
1 | 7.325288 1.223074 5.99 0.000 4.928107 9.72247
2 | 7.791398 1.259778 6.18 0.000 5.322279 10.26052
|
socioeconomic_status#sex |
1 1 | 5.204548 1.100674 4.73 0.000 3.047266 7.36183
1 2 | 5.891215 1.145994 5.14 0.000 3.645108 8.137321
2 1 | 9.464794 1.402626 6.75 0.000 6.715697 12.21389
2 2 | 9.392806 1.390159 6.76 0.000 6.668143 12.11747
3 1 | 6.732649 1.193513 5.64 0.000 4.393406 9.071892
3 2 | 7.411337 1.242576 5.96 0.000 4.975931 9.846742
------------------------------------------------------------------------------------------
I expected that when I added in the predict(ystar, 0,33) extension, my margins results would have been those observed in the first margins output, which matches up with the censored regression output posted. What am I not understanding?
0 Response to Margins command after mixed-effect tobit regression
Post a Comment