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。我现在不知道问题出在哪里,该怎么改?烦请各位高手帮我看看。多谢了先!!