全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
5178 2
2010-11-12
我现在有200个变量,s1,s2,......s200. 要用一个proc step。proc logistic。。。
model y= s1;
run;
要run200次,每次把covariate替换成s2, s3。。。
请问怎样实现呢?
是不是应该要用到 do from i=1 to 200;这样的语句?我只在data step中见过这句,不知道在proc 中怎么用。
3x
二维码

扫码加我 拉你入群

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

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

全部回复
2010-11-12 07:16:03
%macro test;
   %do i=1 %to 200;
       proc logistic data=ds-name;
              model y=s&i;
           run;
   %end;
%mend;

%test
二维码

扫码加我 拉你入群

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

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

2010-11-12 10:36:14
shorty 发表于 2010-11-12 05:13
我现在有200个变量,s1,s2,......s200. 要用一个proc step。proc logistic。。。
model y= s1;
run;
要run200次,每次把covariate替换成s2, s3。。。
请问怎样实现呢?
是不是应该要用到 do from i=1 to 200;这样的语句?我只在data step中见过这句,不知道在proc 中怎么用。
3x
A trick can be played as a fast way to profile 200 variables individually. It only reads the data once.

Here is an example,

data t1;
   array x(20);
   do i = 1 to 50;
        do j=1 to 20;
           x[j]=rannor(99879);
        end;
           y=1+1*x1+1*x2+1*x3>    rannor(99879);
           output;
    end;
run;


   proc logistic data=t1;
      model y(event='1')=x1-x20
                   / link=probit
                     selection=F stop=1
                     slentry=1e-10
                     details
                     lackfit;
     
   run;
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群