楼主: br1229
6390 6

请问有人用sas做过nested logit 分析吗 [推广有奖]

  • 0关注
  • 0粉丝

初中生

57%

还不是VIP/贵宾

-

威望
0
论坛币
6 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
206 点
帖子
11
精华
0
在线时间
16 小时
注册时间
2005-9-12
最后登录
2018-5-10

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
请问有人用sas做过nested logit 分析吗?对于个人相关变量(年龄)怎么让每个alternative都有一个系数?
二维码

扫码加我 拉你入群

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

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

关键词:nested logit nest Log Est SAS logit nested

回帖推荐

hanszhu 发表于5楼  查看完整内容

Can SAS perform LOGIT operations?Users have asked about various types of LOGIT operations, including 'multinomial logit', 'nested logit', and 'joint multinomial models'. Also, the question of a two-stage (LOGIT or PROBIT) model with a Heckman Correction has been raised. SAS can handle multinomial logit models with the PHREG procedure. The nested model is an extension of the multinomial logit mode ...

hanszhu 发表于4楼  查看完整内容

SN-010047 ***Alert Note*** Goodness-of-fit statistics are incorrect for nested logit models Product: SAS/ETS Component: MDC procedure Priority: ALERT The goodness-of-fit statistics are incorrect for nested logit models. Correct values of the goodness-of-fit measures may be computed in a DATA step using the log likelihood value, number of observations, number of regressors in the mode ...

hanszhu 发表于3楼  查看完整内容

Hi Everyone,I am newbie to this list server and I would like to request someone to help resolve my SAS nested logit question.I have a SAS input database consisting of following variables:1. Y (choice variable either 0 or 1) 2. time 3. cost 4. reliability 5. mode (defines 10 discrete mode variables like bus (1), car(2), train (3) etc.) 6. id (refers to each individual who is asked a set of alt ...

本帖被以下文库推荐

沙发
ybai 发表于 2005-10-7 09:14:00 |只看作者 |坛友微信交流群
好像sas不能做吧,可以用limdep

使用道具

藤椅
hanszhu 发表于 2005-10-7 09:19:00 |只看作者 |坛友微信交流群

Hi Everyone,

I am newbie to this list server and I would like to request someone to help resolve my SAS nested logit question.

I have a SAS input database consisting of following variables:

1. Y (choice variable either 0 or 1) 2. time 3. cost 4. reliability 5. mode (defines 10 discrete mode variables like bus (1), car(2), train (3) etc.) 6. id (refers to each individual who is asked a set of alternative questions)

Now, I would like to fit a nested logit model to this Stated Preferenr dataset based on a certain nested structure. As an example, if I have just 4 mode variables as bus (1), train (2), car (3) and motorcycle (4) where I want to model for Public and Private Modes separately. Such as, bus and train would fall under the public mode category, and, car and motorcycle under the private mode category. I used the PROC MDC procedure below to define the nested logit model in SAS: proc mdc data=input; model y = cost time rel / type=nlogit choice=(mode 1 2 3 4) covest=op; id id; utility u(1,) = cost time rel; nest level(1) = (1 2 @ 1, 3 4 @ 2), level(2) = (1 2 @ 1); run;

When I run the above script, I get an error as follows: " The CHOICE= variable contains redundant alternatives."

Can anyone here please help me how to resolve this issue? Also, I would like to know if any of you have done nested logit model in SAS using PROC MDC procedure. Thanks for your help in advance.

Regards,

已有 1 人评分经验 论坛币 收起 理由
bakoll + 2 + 1 热心帮助其他会员

总评分: 经验 + 2  论坛币 + 1   查看全部评分

使用道具

板凳
hanszhu 发表于 2005-10-7 09:21:00 |只看作者 |坛友微信交流群

SN-010047 ***Alert Note***

Goodness-of-fit statistics are incorrect for nested logit models

Product: SAS/ETS Component: MDC procedure Priority: ALERT

The goodness-of-fit statistics are incorrect for nested logit models.

Correct values of the goodness-of-fit measures may be computed in a DATA step using the log likelihood value, number of observations, number of regressors in the model, and the null model log likelihood value. In order to compute the null model log likelihood value, use PROC MDC to estimate the null model by restricting the regressor coefficients to 0.0 and the inclusive value parameters to 1.0, as in the following example:

proc mdc data=choicedata; title 'Null Model'; model decision = x1 x2 x3 / type=nlogit choice=(mode); id id; restrict fixedparm=(0.0 0.0 0.0 1.0 1.0); * Release 8.2 syntax *; *restrict x1_L1=0.0, x2_L1=0.0, x3_L2G1=0.0, INC_L2G1C1=1.0, INC_L2G1C2=1; * SAS System 9 syntax *; utility u(1,)=x1-x2, u(2, 1 2 @ 1)=x3; nest level(1) = (1 2 3 @ 1, 4 5 @ 2), level(2) = (1 2 @ 1); run;

data GoodnessOfFit; LogLo=-611.58641; * null model log likelihood *; LogL =-610.23835; * log likelihood *; N=380; * number of observations *; K=3; * number of regressors *; length measure $ 20; keep measure Value; R=2*(LogL-LogLo); U=-2*LogLo; measure='LikelihoodRatio'; value=R; output; measure='UpperBoundOfR'; value=U; output; measure='AldrichNelson'; value=R/(R+N); output; measure='CraggUhler1'; value=1-exp(-R/N); output; measure='CraggUhler2'; value=(1-exp(-R/N))/(1-exp(-U/N)); output; measure='Estrella'; value=1-(1-R/U)**(U/N); output; measure='AdjustedEstrella'; value=1-((LogL-K)/LogLo)**(-2/N*LogLo); output; measure='McFaddenLRI'; value=R/U; output; measure='VeallZimmermann'; value=(R*(U+N))/(U*(R+N)); output; run;

使用道具

报纸
hanszhu 发表于 2005-10-7 09:23:00 |只看作者 |坛友微信交流群

Can SAS perform LOGIT operations?

Users have asked about various types of LOGIT operations, including 'multinomial logit', 'nested logit', and 'joint multinomial models'. Also, the question of a two-stage (LOGIT or PROBIT) model with a Heckman Correction has been raised. SAS can handle multinomial logit models with the PHREG procedure. The nested model is an extension of the multinomial logit model, but can not be handled with PHREG. The nested model is not currently available in any procedure. The 'joint multinomial model' also is not available in SAS.

As for the two-stage Heckman model, SAS Institute has provided this information in eMail dated 05-11-1999: We do not have anything directly available in SAS software to perform the two-stage Heckman model. However, there is a user-written program on our web site that purports to do this. We cannot affirm the correctness of this program, nor do we support it, but perhaps it will prove useful. It can be found at the following address:

www.sas.com/techsup/download/stat/heckman.sas

使用道具

地板
br1229 发表于 2005-10-12 16:41:00 |只看作者 |坛友微信交流群
hanszhu,你不是说你的mode 有10个值吗?当然我想系统返回The CHOICE= variable contains redundant alternatives就不足为奇了吧

使用道具

7
br1229 发表于 2005-10-12 17:21:00 |只看作者 |坛友微信交流群

另外谢谢你的SN-010047 ***Alert Note***

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

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

GMT+8, 2024-4-19 12:57