楼主: ziyoumind
3566 1

求助:nlogit模型 [推广有奖]

  • 0关注
  • 2粉丝

本科生

62%

还不是VIP/贵宾

-

威望
0
论坛币
5695 个
通用积分
2.8252
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
996 点
帖子
19
精华
0
在线时间
174 小时
注册时间
2009-9-16
最后登录
2025-12-23

楼主
ziyoumind 发表于 2012-4-5 08:54:14 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
Dear all, 我碰到一个nlogit模型的问题,不知道该怎么解决,请大家帮我看看倒底问题是出在哪里?

我们是用的调研数据,想看看哪些因素对人们交通出行所采用的交通工具有影响。因变量是交通工具,包括私家车、步行、自行车、公交车、地铁、和其他交通工具这6类,自变量就包括各类出行方式的成本、出行距离、人口家庭因素、出发点和到达地点的交通通达度(例如距离最近的地铁站的距离等)。

数据的结构像这个样子:

[backcolor=rgba(255, 255, 255, 0.917969)]TripID   Mode    decision    owncar       cost       tripdistance    age        
[backcolor=rgba(255, 255, 255, 0.917969)]1             1             0             1           103            20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]1             2             1             1            20             20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]1             3             0             1            87             20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]1             4             0             1            32             20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]1             5             0             1            67             20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]1             6             0             1            54             20.5           37
[backcolor=rgba(255, 255, 255, 0.917969)]2             1             0             0            77             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]2             2             0             0            12             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]2             3             1             0            50             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]2             4             0             0            32             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]2             5             0             0            40             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]2             6             0             0            42             12              23
[backcolor=rgba(255, 255, 255, 0.917969)]3             1             0             0            40              9               46

[backcolor=rgba(255, 255, 255, 0.917969)]

我们用的是stata 12写的程序。程序如下:

[backcolor=rgba(255, 255, 255, 0.917969)]nlogitgen tree = mode(car:2, nonauto:1|3|4|5|6)
[backcolor=rgba(255, 255, 255, 0.917969)]nlogittree mode tree, choice(decision)

[backcolor=rgba(255, 255, 255, 0.917969)] tree            N             mode          N        k
[backcolor=rgba(255, 255, 255, 0.917969)]------------------------------[backcolor=rgba(255, 255, 255, 0.917969)]---------
[backcolor=rgba(255, 255, 255, 0.917969)] car              37169 ---  2              35215  6350
[backcolor=rgba(255, 255, 255, 0.917969)] nonauot     223014 ---  1              35215  5759
[backcolor=rgba(255, 255, 255, 0.917969)]                                 |- 3            35215 11766
[backcolor=rgba(255, 255, 255, 0.917969)]                                 |- 4            35215  4549
[backcolor=rgba(255, 255, 255, 0.917969)]                                 |- 5            35215  5332
[backcolor=rgba(255, 255, 255, 0.917969)]                                 |- 6            35215  1459
[backcolor=rgba(255, 255, 255, 0.917969)]------------------------------[backcolor=rgba(255, 255, 255, 0.917969)]---------
[backcolor=rgba(255, 255, 255, 0.917969)]                                total          211290 35215
[backcolor=rgba(255, 255, 255, 0.917969)]

[backcolor=rgba(255, 255, 255, 0.917969)]

[backcolor=rgba(255, 255, 255, 0.917969)]constraint 1 [car_tau]_cons=1
[backcolor=rgba(255, 255, 255, 0.917969)]nlogit decision  cost tripdistance [backcolor=rgba(255, 255, 255, 0.917969)]individual-family-[backcolor=rgba(255, 255, 255, 0.917969)]characteristics accessibility-factors || tree: [backcolor=rgba(255, 255, 255, 0.917969)]owncar, base(nonauto) || mode:, case(tripid) constraints(1)


但运行到这一步的时候,stata给我的信息是:


[backcolor=rgba(255, 255, 255, 0.917969)]note: 1 case (210106 obs) dropped due to no positive outcome or [backcolor=rgba(255, 255, 255, 0.917969)]multiple positive outcomes per case
[backcolor=rgba(255, 255, 255, 0.917969)]  no cases remain after removing invalid observations
[backcolor=rgba(255, 255, 255, 0.917969)]

[backcolor=rgba(255, 255, 255, 0.917969)]我对每一个case都检查了,每一个case的"decision"的值就只有一种交通出行工具的值是1,其他的出行方式都是0。我现在不知道问题出在哪里,该怎么改?烦请各位高手帮我看看。多谢了先!!
二维码

扫码加我 拉你入群

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

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

关键词:logit模型 Nlogit logit Log observations 模型

沙发
yasmdltv 发表于 2012-4-5 17:05:30
程序高手啊,我还是那啥

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-26 04:56