Ordered Probit and Logit Models Stata Program and Output PDF
Ordered Probit and Logit Models Stata Program and Output PDF
clear all
set more off
use C:\Econometrics\Data\ordered_health.dta
tabulate $ylist
.
. use C:\Econometrics\Data\ordered_health.dta
.
. * Dependent variable has 3 categories denoted 1,2,3
. global ylist healthstatus
.
. describe $ylist $xlist
.
. tabulate $ylist
health |
status |
(fair, |
good, |
excellent) | Freq. Percent Cum.
------------+-----------------------------------
fair | 523 9.38 9.38
good | 2,034 36.49 45.87
excellent | 3,017 54.13 100.00
------------+-----------------------------------
Total | 5,574 100.00
.
. * Ordered logit model
. ologit $ylist $xlist
Iteration 0: log likelihood = -5140.0463
Iteration 1: log likelihood = -4776.008
Iteration 2: log likelihood = -4769.8693
Iteration 3: log likelihood = -4769.8525
Iteration 4: log likelihood = -4769.8525
--------------------------------------------------------------------------------
healthstatus | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | -.0292944 .001681 -17.43 0.000 -.0325891 -.0259996
logincome | .2836537 .0231098 12.27 0.000 .2383593 .3289481
numberdiseases | -.0549905 .0040692 -13.51 0.000 -.0629661 -.047015
---------------+----------------------------------------------------------------
/cut1 | -1.39598 .2061301 -1.799987 -.9919722
/cut2 | .9513097 .2054301 .5486741 1.353945
--------------------------------------------------------------------------------
.
. * Ordered logit marginal effects
. margins, dydx(*) atmeans predict(outcome(1))
--------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | .002058 .0001333 15.44 0.000 .0017969 .0023192
logincome | -.0199278 .0017344 -11.49 0.000 -.0233272 -.0165284
numberdiseases | .0038633 .0003056 12.64 0.000 .0032643 .0044623
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | -.0072824 .0004179 -17.43 0.000 -.0081014 -.0064634
logincome | .070515 .0057527 12.26 0.000 .05924 .0817901
numberdiseases | -.0136704 .0010126 -13.50 0.000 -.015655 -.0116858
--------------------------------------------------------------------------------
.
. * Ordered logit predicted probabilities
. predict p1ologit p2ologit p3ologit, pr
. tabulate $ylist
health |
status |
(fair, |
good, |
excellent) | Freq. Percent Cum.
------------+-----------------------------------
fair | 523 9.38 9.38
good | 2,034 36.49 45.87
excellent | 3,017 54.13 100.00
------------+-----------------------------------
Total | 5,574 100.00
.
.
. * Ordered probit model coefficients
. oprobit $ylist $xlist
--------------------------------------------------------------------------------
healthstatus | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | -.0171681 .0009898 -17.34 0.000 -.0191082 -.0152281
logincome | .1654079 .01286 12.86 0.000 .1402028 .190613
numberdiseases | -.0315288 .0023848 -13.22 0.000 -.0362029 -.0268548
---------------+----------------------------------------------------------------
/cut1 | -.7945455 .115108 -1.020153 -.5689379
/cut2 | .5459371 .1148228 .3208886 .7709857
--------------------------------------------------------------------------------
.
. * Ordered probit model marginal effects
. margins, dydx(*) atmeans predict(outcome(1))
--------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | .0024261 .0001545 15.70 0.000 .0021233 .002729
logincome | -.0233749 .0019304 -12.11 0.000 -.0271584 -.0195914
numberdiseases | .0044556 .0003587 12.42 0.000 .0037525 .0051586
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | .0043886 .0002786 15.75 0.000 .0038426 .0049347
logincome | -.0422827 .0034702 -12.18 0.000 -.0490842 -.0354812
numberdiseases | .0080596 .0006459 12.48 0.000 .0067937 .0093256
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
| Delta-method
| dy/dx Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
age | -.0068148 .0003929 -17.34 0.000 -.0075849 -.0060447
logincome | .0656577 .0051072 12.86 0.000 .0556476 .0756677
numberdiseases | -.0125152 .0009472 -13.21 0.000 -.0143717 -.0106587
--------------------------------------------------------------------------------
.
. * Ordered probit model predicted probabilities
. predict p1oprobit, pr outcome(1)
. tabulate $ylist
health |
status |
(fair, |
good, |
excellent) | Freq. Percent Cum.
------------+-----------------------------------
fair | 523 9.38 9.38
good | 2,034 36.49 45.87
excellent | 3,017 54.13 100.00
------------+-----------------------------------
Total | 5,574 100.00