Hi everyone,
I am using the new ziologit function in Stata 17 to assess the determinants of the level of expenditure of households on a discretionary product (e.g. tobacco). I am interested in the individual effects on each outcome (level). I know that I can test individual probabilities using the margins command with the contrast(at) option, or with the post option followed by a Wald test (as in the below code). However, it would be easier if one could see the individual results of regressions for each outcome. I could not find an option for that.
My questions:
I am using the new ziologit function in Stata 17 to assess the determinants of the level of expenditure of households on a discretionary product (e.g. tobacco). I am interested in the individual effects on each outcome (level). I know that I can test individual probabilities using the margins command with the contrast(at) option, or with the post option followed by a Wald test (as in the below code). However, it would be easier if one could see the individual results of regressions for each outcome. I could not find an option for that.
My questions:
- Would such individual results for outcomes have a sense? If so:
- Is there an option with the ziologit command, or postestimation, to generate these results? If not, in alternative:
- Would running the regression on one outcome (akin to zero-inflated logit, I guess), give correct results? I guess not, given that Ziologit estimates a single model based on two equations, and the model would then be “shorter”.
- If none of the above: What would be the correct the most effective way to test all independent [dummy] variables across outcomes?
Code:
. use https://www.stata-press.com/data/r17/tobacco (Fictional tobacco consumption data) . ziologit tobacco education income i.female, inflate(income education i.parent) or Iteration 0: log likelihood = -15977.364 (not concave) Iteration 1: log likelihood = -13149.83 (not concave) Iteration 2: log likelihood = -12467.245 Iteration 3: log likelihood = -11039.218 Iteration 4: log likelihood = -9929.2298 Iteration 5: log likelihood = -9715.1143 Iteration 6: log likelihood = -9703.2464 Iteration 7: log likelihood = -9703.2168 Iteration 8: log likelihood = -9703.2168 Zero-inflated ordered logit regression Number of obs = 15,000 Wald chi2(3) = 3147.70 Log likelihood = -9703.2168 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ tobacco | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- tobacco | education | 1.663763 .0157788 53.68 0.000 1.633122 1.694978 income | 1.792544 .0205068 51.02 0.000 1.752799 1.833191 | female | Female | .5881507 .034156 -9.14 0.000 .5248755 .659054 -------------+---------------------------------------------------------------- inflate | income | .8798818 .0062032 -18.15 0.000 .8678073 .8921242 education | .8682758 .0043147 -28.42 0.000 .8598602 .8767738 | parent | Smoking | 3.280066 .1736572 22.44 0.000 2.956768 3.638714 _cons | 13.69758 1.584661 22.62 0.000 10.91866 17.18378 -------------+---------------------------------------------------------------- /cut1 | 5.85957 .104449 5.654853 6.064286 /cut2 | 11.14187 .1945483 10.76056 11.52318 /cut3 | 14.3632 .2495117 13.87417 14.85224 ------------------------------------------------------------------------------ Note: Estimates are transformed only in the first 2 equations to odds ratios. Note: _cons estimates baseline odds. . margins, at(female=(0 1)) contrast(at) Contrasts of predictive margins Number of obs = 15,000 Model VCE: OIM 1._predict: Pr(tobacco=0), predict(pmargin outcome(0)) 2._predict: Pr(tobacco=1), predict(pmargin outcome(1)) 3._predict: Pr(tobacco=2), predict(pmargin outcome(2)) 4._predict: Pr(tobacco=3), predict(pmargin outcome(3)) 1._at: female = 0 2._at: female = 1 ------------------------------------------------ | df chi2 P>chi2 -------------+---------------------------------- _at@_predict | 1 | 1 83.08 0.0000 2 | 1 79.31 0.0000 3 | 1 79.96 0.0000 4 | 1 83.52 0.0000 Joint | 3 84.91 0.0000 ------------------------------------------------ . margins, at(female=(0 1)) post Predictive margins Number of obs = 15,000 Model VCE: OIM 1._predict: Pr(tobacco=0), predict(pmargin outcome(0)) 2._predict: Pr(tobacco=1), predict(pmargin outcome(1)) 3._predict: Pr(tobacco=2), predict(pmargin outcome(2)) 4._predict: Pr(tobacco=3), predict(pmargin outcome(3)) 1._at: female = 0 2._at: female = 1 ------------------------------------------------------------------------------ | Delta-method | Margin std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- _predict#_at | 1 1 | .6177199 .0037014 166.89 0.000 .6104653 .6249744 1 2 | .6491048 .0038512 168.55 0.000 .6415567 .656653 2 1 | .2604932 .0030529 85.33 0.000 .2545097 .2664767 2 2 | .2453202 .0029757 82.44 0.000 .2394879 .2511524 3 1 | .0736063 .0019345 38.05 0.000 .0698146 .0773979 3 2 | .0653043 .0017719 36.86 0.000 .0618315 .0687771 4 1 | .0481807 .0015966 30.18 0.000 .0450513 .0513101 4 2 | .0402707 .0015138 26.60 0.000 .0373036 .0432377 ------------------------------------------------------------------------------ . test 1._predict#1._at=2._predict#1._at ( 1) 1bn._predict#1bn._at - 2._predict#1bn._at = 0 chi2( 1) = 3177.28 Prob > chi2 = 0.0000
Comment