以下是本人写的代码,语法应该没有错了,也有结果得出,但是没有具体值,肯定是出错了,还请各位指点错在哪了?
data b;
input id x1 x2 y;
cards;
1 12 35 1
2 22 38 2
3 25 34 3
4 12 56 1
5 21 54 2
;
run;
data newdatal(keep=id x1 x2 y decision);
set b;
do i=1 to 3;
if y=i then decision=1;
else decision=0;
output;
end;
run;
proc mdc data=newdatal;
model decision = x1 x2 /type=mixedlogit nchoice=3
mixed=(normalparm=x1 x2);
id id;
run;
以下是结果:
The MDC Procedure
Mixed Multinomial Logit Estimates
Parameter Estimates
Standard Approx
Parameter DF Estimate Error t Value Pr > |t|
x1_M 1 1E-6 . . .
x1_S 1 0 0 0.00 1.0000
x2_M 1 1E-6 . . .
x2_S 1 0 0 0.00 1.0000