全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8265 10
2013-05-26
计算mlogit后使用listcoef外部命令,stata12有问题,而stata10正常。请大家解读一下怎么回事?

就用连老师的教材的例子吧

findit listcoef   安装外部命令
findit nomocc2.dta   
下载例题数据

然后:
qui mlogit  occ white ed exper
listcoef white

在stata10上的结果与连老师教材相同

mlogit (N=337): Factor Change in the Odds of occ

Variable: white (sd=     .28)

Odds comparing    |
Group 1 - Group 2 |      b         z     P>|z|     e^b   e^bStdX
------------------+---------------------------------------------
Menial  -BlueCol  |  -1.23650   -1.707   0.088   0.2904   0.7105
Menial  -Craft    |  -0.47234   -0.782   0.434   0.6235   0.8776
Menial  -WhiteCol |  -1.57139   -1.741   0.082   0.2078   0.6477
Menial  -Prof     |  -1.77431   -2.350   0.019   0.1696   0.6123
BlueCol -Menial   |   1.23650    1.707   0.088   3.4436   1.4075
BlueCol -Craft    |   0.76416    1.208   0.227   2.1472   1.2352
BlueCol -WhiteCol |  -0.33488   -0.359   0.720   0.7154   0.9116
BlueCol -Prof     |  -0.53780   -0.673   0.501   0.5840   0.8619
Craft   -Menial   |   0.47234    0.782   0.434   1.6037   1.1395
Craft   -BlueCol  |  -0.76416   -1.208   0.227   0.4657   0.8096
Craft   -WhiteCol |  -1.09904   -1.343   0.179   0.3332   0.7380
Craft   -Prof     |  -1.30196   -2.011   0.044   0.2720   0.6978
WhiteCol-Menial   |   1.57139    1.741   0.082   4.8133   1.5440
WhiteCol-BlueCol  |   0.33488    0.359   0.720   1.3978   1.0970
WhiteCol-Craft    |   1.09904    1.343   0.179   3.0013   1.3550
WhiteCol-Prof     |  -0.20292   -0.233   0.815   0.8163   0.9455
Prof    -Menial   |   1.77431    2.350   0.019   5.8962   1.6331
Prof    -BlueCol  |   0.53780    0.673   0.501   1.7122   1.1603
Prof    -Craft    |   1.30196    2.011   0.044   3.6765   1.4332
Prof    -WhiteCol |   0.20292    0.233   0.815   1.2250   1.0577
----------------------------------------------------------------



在stata12上的结果就不对了,只呈现一组变量的数据 ,如下:
mlogit (N=337): Factor Change in the Odds of occ

Variable: white (sd=.27642268)

Odds comparing    |
Alternative 1     |
to Alternative 2  |      b         z     P>|z|     e^b   e^bStdX
------------------+---------------------------------------------
Menial  -Prof     |  -1.77431   -2.350   0.019   0.1696   0.6123
Prof    -Menial   |   1.77431    2.350   0.019   5.8962   1.6331
----------------------------------------------------------------


不知道是怎么回事??按说stata10可以运行的命令在stata12没有出问题的道理啊
                        






二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-5-26 23:32:47
我的12没有问题,可能是软件没有升级的问题



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-27 03:07:12
Scott Long那本Regression Models for Categorical Dependent Variables Using Stata的第二版
主要以 Stata 9 为主,您的重要指令mlogit与listcoef可参见该书的6.2.2小节,即231页到234页


use nomocc2.dta ,clear

qui mlogit  occ white ed exper
listcoef white

version 9
qui mlogit  occ white ed exper
listcoef white

您应当可以看到前面那个显示出您的问题,而后者没有问题。
【参考看看】
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-27 05:49:15
h3327156 发表于 2013-5-27 03:07
Scott Long那本Regression Models for Categorical Dependent Variables Using Stata的第二版
主要以 Stat ...
升完级应没有问题

sysuse  nomocc2.dta
version

mlogit occ white ed exp
listcoef white, percent help




. sysuse  nomocc2.dta
(1982 General Social Survey)

. version
version 12.1


.
. mlogit occ white ed exp

Iteration 0:   log likelihood = -509.84406  
Iteration 1:   log likelihood = -432.18549  
Iteration 2:   log likelihood = -426.88668  
Iteration 3:   log likelihood = -426.80057  
Iteration 4:   log likelihood = -426.80048  
Iteration 5:   log likelihood = -426.80048  

Multinomial logistic regression                   Number of obs   =        337
                                                  LR chi2(12)     =     166.09
                                                  Prob > chi2     =     0.0000
Log likelihood = -426.80048                       Pseudo R2       =     0.1629

------------------------------------------------------------------------------
         occ |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
Menial       |
       white |  -1.774306   .7550543    -2.35   0.019    -3.254186   -.2944273
          ed |  -.7788519   .1146293    -6.79   0.000    -1.003521   -.5541826
       exper |  -.0356509    .018037    -1.98   0.048    -.0710028    -.000299
       _cons |   11.51833   1.849356     6.23   0.000     7.893659      15.143
-------------+----------------------------------------------------------------
BlueCol      |
       white |  -.5378027   .7996033    -0.67   0.501    -2.104996    1.029391
          ed |  -.8782767   .1005446    -8.74   0.000     -1.07534   -.6812128
       exper |  -.0309296   .0144086    -2.15   0.032      -.05917   -.0026893
       _cons |   12.25956   1.668144     7.35   0.000     8.990061    15.52907
-------------+----------------------------------------------------------------
Craft        |
       white |  -1.301963    .647416    -2.01   0.044    -2.570875   -.0330509
          ed |  -.6850365   .0892996    -7.67   0.000    -.8600605   -.5100126
       exper |  -.0079671   .0127055    -0.63   0.531    -.0328693    .0169351
       _cons |   10.42698   1.517943     6.87   0.000     7.451864    13.40209
-------------+----------------------------------------------------------------
WhiteCol     |
       white |  -.2029212   .8693072    -0.23   0.815    -1.906732     1.50089
          ed |  -.4256943   .0922192    -4.62   0.000    -.6064407   -.2449479
       exper |   -.001055   .0143582    -0.07   0.941    -.0291967    .0270866
       _cons |   5.279722   1.684006     3.14   0.002     1.979132    8.580313
-------------+----------------------------------------------------------------
Prof         |  (base outcome)
------------------------------------------------------------------------------

. listcoef white, percent help

mlogit (N=337): Percentage Change in the Odds of occ

Variable: white (sd=.27642268)

Odds comparing    |
Alternative 1     |
to Alternative 2  |      b         z     P>|z|       %     %StdX
------------------+---------------------------------------------
Menial  -BlueCol  |  -1.23650   -1.707   0.088    -71.0    -29.0
Menial  -Craft    |  -0.47234   -0.782   0.434    -37.6    -12.2
Menial  -WhiteCol |  -1.57139   -1.741   0.082    -79.2    -35.2
Menial  -Prof     |  -1.77431   -2.350   0.019    -83.0    -38.8
BlueCol -Menial   |   1.23650    1.707   0.088    244.4     40.7
BlueCol -Craft    |   0.76416    1.208   0.227    114.7     23.5
BlueCol -WhiteCol |  -0.33488   -0.359   0.720    -28.5     -8.8
BlueCol -Prof     |  -0.53780   -0.673   0.501    -41.6    -13.8
Craft   -Menial   |   0.47234    0.782   0.434     60.4     13.9
Craft   -BlueCol  |  -0.76416   -1.208   0.227    -53.4    -19.0
Craft   -WhiteCol |  -1.09904   -1.343   0.179    -66.7    -26.2
Craft   -Prof     |  -1.30196   -2.011   0.044    -72.8    -30.2
WhiteCol-Menial   |   1.57139    1.741   0.082    381.3     54.4
WhiteCol-BlueCol  |   0.33488    0.359   0.720     39.8      9.7
WhiteCol-Craft    |   1.09904    1.343   0.179    200.1     35.5
WhiteCol-Prof     |  -0.20292   -0.233   0.815    -18.4     -5.5
Prof    -Menial   |   1.77431    2.350   0.019    489.6     63.3
Prof    -BlueCol  |   0.53780    0.673   0.501     71.2     16.0
Prof    -Craft    |   1.30196    2.011   0.044    267.7     43.3
Prof    -WhiteCol |   0.20292    0.233   0.815     22.5      5.8
----------------------------------------------------------------
       b = raw coefficient
       z = z-score for test of b=0
   P>|z| = p-value for z-test
       % = percent change in odds for unit increase in X
   %StdX = percent change in odds for SD increase in X


.


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-27 09:37:35
h3327156 发表于 2013-5-27 03:07
Scott Long那本Regression Models for Categorical Dependent Variables Using Stata的第二版
主要以 Stat ...
多谢h3327156 老师正解。
我的stata版本是12.1 ,记录如下:

. version 9

. qui mlogit  occ white ed exper

. listcoef white

mlogit (N=337): Factor Change in the Odds of occ

Variable: white (sd=.27642268)

Odds comparing    |
Alternative 1     |
to Alternative 2  |      b         z     P>|z|     e^b   e^bStdX
------------------+---------------------------------------------
Menial  -BlueCol  |  -1.23650   -1.707   0.088   0.2904   0.7105
Menial  -Craft    |  -0.47234   -0.782   0.434   0.6235   0.8776
Menial  -WhiteCol |  -1.57139   -1.741   0.082   0.2078   0.6477
Menial  -Prof     |  -1.77431   -2.350   0.019   0.1696   0.6123
BlueCol -Menial   |   1.23650    1.707   0.088   3.4436   1.4075
BlueCol -Craft    |   0.76416    1.208   0.227   2.1472   1.2352
BlueCol -WhiteCol |  -0.33488   -0.359   0.720   0.7154   0.9116
BlueCol -Prof     |  -0.53780   -0.673   0.501   0.5840   0.8619
Craft   -Menial   |   0.47234    0.782   0.434   1.6037   1.1395
Craft   -BlueCol  |  -0.76416   -1.208   0.227   0.4657   0.8096
Craft   -WhiteCol |  -1.09904   -1.343   0.179   0.3332   0.7380
Craft   -Prof     |  -1.30196   -2.011   0.044   0.2720   0.6978
WhiteCol-Menial   |   1.57139    1.741   0.082   4.8133   1.5440
WhiteCol-BlueCol  |   0.33488    0.359   0.720   1.3978   1.0970
WhiteCol-Craft    |   1.09904    1.343   0.179   3.0013   1.3550
WhiteCol-Prof     |  -0.20292   -0.233   0.815   0.8163   0.9455
Prof    -Menial   |   1.77431    2.350   0.019   5.8962   1.6331
Prof    -BlueCol  |   0.53780    0.673   0.501   1.7122   1.1603
Prof    -Craft    |   1.30196    2.011   0.044   3.6765   1.4332
Prof    -WhiteCol |   0.20292    0.233   0.815   1.2250   1.0577
----------------------------------------------------------------

. version 12.1

. qui mlogit  occ white ed exper

. listcoef white

mlogit (N=337): Factor Change in the Odds of occ

Variable: white (sd=.27642268)

Odds comparing    |
Alternative 1     |
to Alternative 2  |      b         z     P>|z|     e^b   e^bStdX
------------------+---------------------------------------------
Menial  -Prof     |  -1.77431   -2.350   0.019   0.1696   0.6123
Prof    -Menial   |   1.77431    2.350   0.019   5.8962   1.6331
----------------------------------------------------------------

接下来会接受蓝色版主的建议,升级一下。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-5-27 09:52:55
蓝色 发表于 2013-5-26 23:32
我的12没有问题,可能是软件没有升级的问题
我的升级后依然仅给出一对变量数据,有点诡异啊。

. update

Update status
    Last check for updates:  27 May 2013
    New update available:    none         (as of 27 May 2013)
    Current update level:    20 Mar 2013  (what's new)

Possible actions

    Check for available updates           (or type -update query-)

. use "E:\data\逻辑斯蒂 专业选择\nomocc2.dta", clear
(1982 General Social Survey)

. qui mlogit occ white ed exper

. listcoef white

mlogit (N=337): Factor Change in the Odds of occ

Variable: white (sd=.27642268)

Odds comparing    |
Alternative 1     |
to Alternative 2  |      b         z     P>|z|     e^b   e^bStdX
------------------+---------------------------------------------
Menial  -Prof     |  -1.77431   -2.350   0.019   0.1696   0.6123
Prof    -Menial   |   1.77431    2.350   0.019   5.8962   1.6331
----------------------------------------------------------------
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群