楼主: sunkai_bick
7367 10

[回归分析求助] listcoef命令在stata12不能正常运行么? [推广有奖]

VIP

教授

2%

还不是VIP/贵宾

-

威望
0
论坛币
99379 个
通用积分
39.3807
学术水平
183 点
热心指数
220 点
信用等级
178 点
经验
5606 点
帖子
751
精华
0
在线时间
1278 小时
注册时间
2008-9-28
最后登录
2023-11-20
毕业学校
厦门大学

楼主
sunkai_bick 在职认证  学生认证  发表于 2013-5-26 20:22:01 |只看作者 |坛友微信交流群|倒序 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
计算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没有出问题的道理啊
                        






二维码

扫码加我 拉你入群

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

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

关键词:listcoef stata12 Stata tata list 正常

沙发
蓝色 发表于 2013-5-26 23:32:47 |只看作者 |坛友微信交流群
我的12没有问题,可能是软件没有升级的问题



已有 1 人评分学术水平 热心指数 信用等级 收起 理由
h3327156 + 1 + 2 + 3 版主的Stata真给力,我的Stata就出问题= = .

总评分: 学术水平 + 1  热心指数 + 2  信用等级 + 3   查看全部评分

使用道具

藤椅
h3327156 发表于 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

您应当可以看到前面那个显示出您的问题,而后者没有问题。
【参考看看】
已有 1 人评分经验 学术水平 热心指数 收起 理由
sunkai_bick + 100 + 5 + 5 热心帮助

总评分: 经验 + 100  学术水平 + 5  热心指数 + 5   查看全部评分

使用道具

板凳
蓝色 发表于 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


.


已有 1 人评分经验 学术水平 热心指数 收起 理由
sunkai_bick + 200 + 10 + 10 热心帮助

总评分: 经验 + 200  学术水平 + 10  热心指数 + 10   查看全部评分

使用道具

报纸
sunkai_bick 在职认证  学生认证  发表于 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
----------------------------------------------------------------

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

使用道具

地板
sunkai_bick 在职认证  学生认证  发表于 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
----------------------------------------------------------------

使用道具

7
蓝色 发表于 2013-5-27 10:56:18 |只看作者 |坛友微信交流群
试试  which listcoef

. which listcoef
D:\StataSE12\ado\stbplus\l\listcoef.ado
*! version 1.9.4 2012-07-25 bug in mprobit noted; format fix

看看你的listcoef 的版本吧
现在我的是都没有问题的

使用道具

8
h3327156 发表于 2013-5-27 11:23:20 |只看作者 |坛友微信交流群
蓝色 发表于 2013-5-27 10:56
试试  which listcoef

. which listcoef
感谢蓝色版主。
经检查,确实我的listcoef版本太低,
经更新后,现在我的Stata 12.1 也没有问题了!

. which listcoef
c:\ado\plus\l\listcoef.ado
*!1.6.1 8/22/00 - fix label for ordinal  (STB-57: sg152)

使用道具

9
sunkai_bick 在职认证  学生认证  发表于 2013-5-27 11:45:16 |只看作者 |坛友微信交流群
h3327156 发表于 2013-5-27 11:23
感谢蓝色版主。
经检查,确实我的listcoef版本太低,
经更新后,现在我的Stata 12.1 也没有问题了!
请问您如何更新这一命令呢?

我试过
adoupdate sg152 , update
(note: adoupdate updates user-written files; type -update- to check for updates to official Stata)

Checking status of specified packages...

  [531] sg152 at http://www.stata.com/stb/stb57:
        installed package is up to date
(no packages require updating)
然后
. which listcoef
F:\Stata12\ado\plus\l\listcoef.ado
*! version 1.8.2 29Jun2007
仍然旧版本

使用道具

10
sunkai_bick 在职认证  学生认证  发表于 2013-5-27 11:50:28 |只看作者 |坛友微信交流群
sunkai_bick 发表于 2013-5-27 11:45
请问您如何更新这一命令呢?

我试过
http://www.indiana.edu/~jslsoc/stata/spost9_ado/listcoef.ado这个版本不能用。
listcoef white
unrecognized command:  _get_mlogit_bv
r(199);
然后
findit spost9_ado.pkg
似乎可以了
which listcoef
F:\Stata12\ado\plus\l\listcoef.ado
*! version 3.1.6b 2013-05-11 | long freese | long catvals for mlogit
*! TODO: r(table) for all models jsl
*! VERIFY  slogit cutpoint with _se 0; jsl don't think we need _se check


使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-19 17:07