使用设置哑变量的方式就能将问题解决。
data aa;
input somking diabetes fenlei stroke weight;
cards;
0 0 0 0 29056
0 0 0 1 512
0 1 1 0 2127
0 1 1 1 110
1 0 2 0 7283
1 0 2 1 253
1 1 3 0 503
1 1 3 1 43
;
run;
proc logistic data=aa descending;
class fenlei (ref=first);
frequency weight;
model stroke=fenlei/rsq cl rl;
run;