小弟看文献时候发现,作者在做mlogit分析的时候也输出了model calibration and discrimination分析结果,其中model calibration 用的是 Hosmer–Lemeshow goodness-of-fit,而discrimination 用的是auc,结果如下图所示
我的问题是 文中的三个数值是怎么做出来的?
因为我用stata只能做出一个值,而不会每一个对比都输出一个值,我猜测可能是根据公式手算的?
请问有大神可以指点下怎么用stata算出三个值么?
图片出处是以下文章
Need or availability? Modeling aftercare decisions for psychiatrically hospitalized adolescents
以下是我自己用数据做出来的结果
. mlog blcrordinial pp acct input pios trust acu dexp pexp, base(0)
Iteration 0: log likelihood = -173.32384
Iteration 1: log likelihood = -149.44969
Iteration 2: log likelihood = -145.9323
Iteration 3: log likelihood = -145.79316
Iteration 4: log likelihood = -145.79288
Iteration 5: log likelihood = -145.79288
Multinomial logistic regression Number of obs = 174
LR chi2(24) = 55.06
Prob > chi2 = 0.0003
Log likelihood = -145.79288 Pseudo R2 = 0.1588
------------------------------------------------------------------------------
blcrordinial | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
0 | (base outcome)
-------------+----------------------------------------------------------------
1 |
pp | .5095293 .4547095 1.12 0.262 -.381685 1.400744
acct | -.7946018 .6727708 -1.18 0.238 -2.113208 .5240048
input | -1.12022 .8523212 -1.31 0.189 -2.790739 .5502983
pios | -.0138823 .6227175 -0.02 0.982 -1.234386 1.206622
trust | -.4866782 .6371079 -0.76 0.445 -1.735387 .7620303
acu | .6553389 .7824059 0.84 0.402 -.8781486 2.188826
dexp | -.4189236 .3693497 -1.13 0.257 -1.142836 .3049885
pexp | .4635925 .3684036 1.26 0.208 -.2584652 1.18565
_cons | 6.681248 2.992565 2.23 0.026 .8159292 12.54657
-------------+----------------------------------------------------------------
2 |
pp | .8263762 .6241719 1.32 0.186 -.3969782 2.049731
acct | -1.581878 .882971 -1.79 0.073 -3.312469 .1487137
input | 1.008641 1.167792 0.86 0.388 -1.280189 3.29747
pios | -1.292252 .8093578 -1.60 0.110 -2.878564 .29406
trust | -1.278975 .760055 -1.68 0.092 -2.768656 .2107053
acu | .7955599 .9549703 0.83 0.405 -1.076147 2.667267
dexp | -.0412076 .4772525 -0.09 0.931 -.9766054 .8941902
pexp | .3944344 .4717318 0.84 0.403 -.5301428 1.319012
_cons | 5.412803 3.920221 1.38 0.167 -2.270689 13.0963
-------------+----------------------------------------------------------------
3 |
pp | .6333809 .4390877 1.44 0.149 -.2272151 1.493977
acct | -.1405083 .6656027 -0.21 0.833 -1.445066 1.164049
input | -.4288982 .8345902 -0.51 0.607 -2.064665 1.206868
pios | .1512663 .6100139 0.25 0.804 -1.044339 1.346872
trust | -.2094653 .6250139 -0.34 0.738 -1.43447 1.015539
acu | .0757255 .7665314 0.10 0.921 -1.426649 1.5781
dexp | -.2195288 .3608373 -0.61 0.543 -.9267569 .4876992
pexp | .2306123 .3591492 0.64 0.521 -.4733073 .9345318
_cons | 2.837748 2.943727 0.96 0.335 -2.931851 8.607347
------------------------------------------------------------------------------
. fistat
command fistat is unrecognized
r(199);
. fitstat
| mlogit
-------------------------+-------------
Log-likelihood |
Model | -145.793
Intercept-only | -173.324
-------------------------+-------------
Chi-square |
Deviance (df=147) | 291.586
LR (df=24) | 55.062
p-value | 0.000
-------------------------+-------------
R2 |
McFadden | 0.159
McFadden (adjusted) | 0.003
Cox-Snell/ML | 0.271
Cragg-Uhler/Nagelkerke | 0.314
Count | 0.621
Count (adjusted) | 0.275
-------------------------+-------------
IC |
AIC | 345.586
AIC divided by N | 1.986
BIC (df=27) | 430.880
. mlogitgof
Goodness-of-fit test for a multinomial logistic regression model
Dependent variable: blcrordinial
number of observations = 174
number of outcome values = 4
base outcome value = 0
number of groups = 10
chi-squared statistic = 17.903
degrees of freedom = 24
Prob > chi-squared = 0.808
附件列表