楼主: unholylight
4586 3

[回归分析求助] 巢式logit数据结构问题 [推广有奖]

  • 1关注
  • 1粉丝

高中生

32%

还不是VIP/贵宾

-

威望
0
论坛币
101 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2816 点
帖子
4
精华
0
在线时间
49 小时
注册时间
2011-4-21
最后登录
2025-3-13

楼主
unholylight 发表于 2013-3-14 12:46:49 |AI写论文
3论坛币
tree structure specified for the nested logit model

type  N      severity N   k
------------------------------
low   99 --- 1        99  30
high 198 --- 2        99  55
           +- 3        99  14
------------------------------
               total  297  99

k = number of times alternative is chosen
N = number of observations at each level

. nlogit choice  Cause Weather||type: AccidentForm  ControlType RoadType||severity:,case( accident
> _id)
variable Cause is not alternative-specific: it has no within-case variability
r(459);


其中cause是事故原因代码,是分类数据,求问红字原因,新手初学

关键词:logit 数据结构 Log observations Alternative 结构

沙发
蓝色 发表于 2013-3-14 13:30:56
Pages from nlogit_Page_1.jpg Pages from nlogit_Page_2.jpg
看手册里面例子的介绍
看看你的数据格式是否符合。
很明显你的那个变量是没有变化的,而人家要求是有变化的

藤椅
unholylight 发表于 2013-3-14 14:22:15
蓝色 发表于 2013-3-14 13:30
看手册里面例子的介绍
看看你的数据格式是否符合。
很明显你的那个变量是没有变化的,而人家要求是有变 ...
我也觉得是版主大人所说的问题,但是这个案例http://www.stata.com/statalist/archive/2002-10/msg00187.html,里面
To run nlogit, we must interact the attributes with dummy variables for the choi
ces:
. gen sexJap = sex*(car==2)

. gen sexEur = sex*(car==3)

. gen incJap = income*(car==2)

. gen incEur = income*(car==3)

. gen consFor = (type==2)
这种处理方法我实在没看明白,请版主解惑

板凳
tjflypig 发表于 2013-11-12 20:42:11
unholylight 发表于 2013-3-14 14:22
我也觉得是版主大人所说的问题,但是这个案例http://www.stata.com/statalist/archive/2002-10/msg00187. ...
请问lz这个问题解决了吗?我也遇到这个问题了,也是STATA新手,但是导师要解一个nlogit没办法了,各种纠结啊。

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-1 14:15