搜索
人大经济论坛 附件下载

附件下载

所在主题:
文件名:  aaa.txt
资料下载链接地址: https://bbs.pinggu.org/a-1154188.html
附件大小:
在SAS 的logistic过程中,对于自变量是分类变量时,该如果选择Class选项??
有无Class及Class后的参数不同结果相差很大,并且,2分类及3分类又不相同。

为了什么问题,我设计程序如下,希望高人回答。
/*
sex: 取值0、1
sex1:取值F、M
test:取值0、1、2
数据中,sex对应sex1,其中sex=1对应sex1="M",sex=0对应sex1="F"。
*/

data a;
input y sex sex1$ test @@;
cards;
0 1 M 1
1 1 M 2
0 1 M 2
0 1 M 1
1 1 M 0
0 1 M 1
0 0 F 0
0 0 F 0
0 1 M 1
0 1 M 1
0 1 M 1
0 1 M 1
1 0 F 0
0 1 M 1
0 1 M 2
0 1 M 2
0 1 M 2
0 1 M 1
1 1 M 1
0 1 M 1
0 1 M 1
0 0 F 0
0 1 M 1
0 1 M 1
1 1 M 1
0 1 M 1
1 1 M 2
0 0 F 0
0 1 M 1
0 1 M 2
0 1 M 1
0 1 M 2
0 1 M 1
0 1 M 1
1 0 F 2
0 1 M 2
0 1 M 2
0 1 M 1
0 0 F 0
0 1 M 1
0 1 M 2
1 1 M 1
0 1 M 1
0 0 F 0
0 1 M 1
0 1 M 2
0 1 M 1
0 0 F 0
0 1 M 1
1 1 M 1
;
run;

proclogistic data=a desc;
title '例1:SEX1 F and M 有class Ref=“M”';
class sex1(param=ref ref="M");
model y=sex1;
run;

proclogistic data=a desc;
title '例2:SEX1 F and M 有class Ref=“F”';
class sex1(param=ref ref="F");
model y=sex1;
run;

proclogistic data=a desc;
title '例3:SEX 0 and 1 有 classref="1"';
class sex(param=ref ref="1");
model y=sex;
run;

proclogistic data=a desc;
title '例4:SEX 0 and 1 有 classref="0"';
class sex(param=ref ref="0");
model y=sex;
run;

proclogistic data=a desc;
title '例5:SEX 0 and 1 无 class';
model y=sex;
run;

proclogistic data=a desc;
title '例6:SEX 0 and 1 有 classref=last';
class sex(param=ref ref=last);
model y=sex;
run;

proclogistic data=a desc;
title '例7:SEX 0 and 1 有 classref=first';
class sex(param=ref ref=first);
model y=sex;
run;

proclogistic data=a desc;
title '例8:SEX 0 and 1 有 class 有param无ref参数';
class sex(param=ref);
model y=sex;
run;

proclogistic data=a desc;
title '例9:SEX 0 and 1 有 class 无任何参数';
class sex;
model y=sex;
run;

proclogistic data=a desc;
title '例10:Test 0、1、2 有 classref="2"';
class Test(param=ref ref="2");
model y=Test;
run;

proclogistic data=a desc;
title '例11:Test 0、1、2 有 classref="0"';
class Test(param=ref ref="0");
model y=Test;
run;

proclogistic data=a desc;
title '例12:Test 0、1、2 无 class';
model y=Test;
run;

proclogistic data=a desc;
title '例13:Test 0、1、2 有 classref=last';
class Test(param=ref ref=last);
model y=Test;
run;

proclogistic data=a desc;
title '例14:Test 0、1、2 有 classref=first';
class Test(param=ref ref=first);
model y=Test;
run;

proclogistic data=a desc;
title '例15:Test 0、1、2 有 class 有param无ref参数';
class Test(param=ref);
model y=Test;
run;

proclogistic data=a desc;
title '例16:Test 0、1、2 有 class 无任何参数';
class Test;
model y=Test;
run;





    熟悉论坛请点击新手指南
下载说明
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。
2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。
3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。
(如有侵权,欢迎举报)
二维码

扫码加我 拉你入群

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

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

GMT+8, 2025-12-29 07:30