楼主: webgu
29579 74

[学习分享] SAS专版精要贴索引目录--JUN 07, 2013更新...   [推广有奖]

41
迅哥儿2012 在职认证  发表于 2013-4-15 23:28:33 |只看作者 |坛友微信交流群
辛苦了!
waiting

使用道具

42
hlyz2008 发表于 2013-4-15 23:29:24 |只看作者 |坛友微信交流群
很不错的帖子,顶你!!!

使用道具

43
webgu 发表于 2013-4-16 08:58:52 |只看作者 |坛友微信交流群
新增 playmore 宏系列。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

使用道具

44
402play 发表于 2013-4-16 14:49:04 |只看作者 |坛友微信交流群
options

    mprintsymbolgen mlogic

      ;

%macro ransample_data(dsin,dsout,Replacement,SampleSize);

%if %upcase("&Replacement")="YES"  %then%do;

%*creating random sample with replacement;

   data &dsout(drop=i);

    do i=1to &SampleSize;

        PickIt=ceil(ranuni(123)*TotObs);

        ObsPicked=PickIt;

        set &dsin point=PickIt   nobs=TotObs;

        output;

      end;

      stop;

run;

%end;

%else  %if %upcase("&Replacement")="NO"  %then%do;

%* create random sample without replace;

  data &dsout(drop=SampleSize ObsLeft);

         SampleSize=&SampleSize;

         ObsLeft=TotObs;

         do while(SampleSize>0and ObsLeft>0) ;

           PickIt+1;

         if ranuni(123)<SampleSize/ObsLeft then

           do;

                ObsPicked=PickIt;

                set &dsin point=PickIt nobs=TotObs;

                output;

                SampleSize=SampleSize-1;

               end;

              ObsLeft=ObsLeft-1;

            end;

     stop;

run;

%end;

%else  %putERROR:Replacement shout be  yes or no ;

%mendransample_data;

   



   

%ransample_data(sashelp.class, class_data_rep,yes,10);

%ransample_data(sashelp.class, class_data_norep,no,10);

  %ransample_data(sashelp.class, class_data_norep,whatever,10);

使用道具

45
美髯客 发表于 2013-4-17 09:27:40 |只看作者 |坛友微信交流群
千求百寻中,找到了支持!

使用道具

46
美髯客 发表于 2013-4-17 09:28:16 |只看作者 |坛友微信交流群
千求百寻中,找到了支持!

使用道具

47
yeting2000 在职认证  发表于 2013-4-17 09:42:54 |只看作者 |坛友微信交流群
看看

使用道具

48
sl050326 发表于 2013-4-17 10:19:59 |只看作者 |坛友微信交流群

thanks! good job!

使用道具

49
pxxs23 在职认证  学生认证  发表于 2013-4-17 19:43:15 |只看作者 |坛友微信交流群
有待学习

使用道具

50
知识2012 发表于 2013-4-18 16:57:40 |只看作者 |坛友微信交流群
支持,辛苦了,谢谢。

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-23 18:14