<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Randomization in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506340#M2522</link>
    <description>&lt;P&gt;Thank you very much, this was exactly what i needed moreover your code looks very clean. I have been able to tweak your code to my specific need.&lt;/P&gt;&lt;P&gt;Your code even allows me to pull trials names from another data source and randomly allocate them to different treatment centers.&lt;/P&gt;</description>
    <pubDate>Sun, 21 Oct 2018 23:48:15 GMT</pubDate>
    <dc:creator>vjikong</dc:creator>
    <dc:date>2018-10-21T23:48:15Z</dc:date>
    <item>
      <title>Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506207#M2517</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS v 9.4&lt;/P&gt;&lt;P&gt;I want to generate a randomization scheme for an experimental trial with three treatment groups, ABC, BCD and CDF.&amp;nbsp; I have a total of 150 subjects for the study and the study is carried out in 5 different study centers. My randomization is in the ratio 2:2:1, ie for every 5 subjects, the allocation scheme is 2 for ABC, 2 for BCD and 1 for CDF. I want to generate the randomization scheme that shows site number, subject number and treatment group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;title "RANDOMIZATION SCHEDULE FOR CLINICAL TRIAL";&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Proc format;&lt;BR /&gt;value treat 1='ABC'&lt;BR /&gt;2='BCD'&lt;BR /&gt;3='CDF';&lt;BR /&gt;run;&lt;BR /&gt;proc plan seed=6457149;&lt;BR /&gt;factors block=5 random treat=30&lt;BR /&gt;random/noprint;&lt;BR /&gt;output out=first&lt;BR /&gt;treat nvals=(1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3)&lt;BR /&gt;random;&lt;BR /&gt;run;&lt;BR /&gt;data first(keep=pid block treat);&lt;BR /&gt;set first;&lt;BR /&gt;pid=put(_n_, z2.);&lt;BR /&gt;run;&lt;BR /&gt;proc sort; by pid;&lt;BR /&gt;run;&lt;BR /&gt;proc print noobs uniform split='*';&lt;BR /&gt;var pid treat;&lt;BR /&gt;label pid="Subject*Number"&lt;BR /&gt;treat="Treatment*Group";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 20 Oct 2018 04:02:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506207#M2517</guid>
      <dc:creator>vjikong</dc:creator>
      <dc:date>2018-10-20T04:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506211#M2518</link>
      <description>&lt;P&gt;I believe the code seems working fine and giving the expected result. The only update required is for the PID i.e. the format need to be used should be z3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if my understanding is incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data first(keep=pid block treat);
set first;
pid=put(_n_, z3.);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Oct 2018 07:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506211#M2518</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-10-20T07:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506219#M2519</link>
      <description>Thanks for the suggestion.&lt;BR /&gt;I can, t figure out how to allocate the test individuals to the five different trial centers.&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Oct 2018 13:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506219#M2519</guid>
      <dc:creator>vjikong</dc:creator>
      <dc:date>2018-10-20T13:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506247#M2520</link>
      <description>&lt;P&gt;You only need to transform any random number into a pid, such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc plan seed=6457149;
factors block=5 random treat=30
random/noprint;
output out=first
treat nvals=(1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3)
random;
run;

Proc format;
value treat 1='ABC'
2='BCD'
3='CDF';
run;

data second;
call streamInit(88678);
set first;
pid = rand("uniform");
format treat treat.; 
run;

proc rank data=second out=third;
var pid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Oct 2018 19:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506247#M2520</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-10-20T19:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506333#M2521</link>
      <description>&lt;P&gt;Seems like this is what you want because for every 5 subjects in a center you want to assign the complete set of treatments in the ratio 2:2:1 at random the other factor don't need to be random.&lt;/P&gt;
&lt;P&gt;Centers=5;&lt;/P&gt;
&lt;P&gt;Blocks/center=6 of size 5.&lt;/P&gt;
&lt;P&gt;Treatment 2:2:1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc plan seed=6457149;
   factors center=5 ordered block=6 ordered treat=5 random;
   output out=plan treat cvals=('ABC' 'ABC' 'BCD' 'BCD' 'CDF') random;
   run;
   quit;
data plan;
   set plan;
   length usubjid $16;
   subject + 1;
   usubjid = catx('-','XYZ01',vvalue(center),vvalue(subject));
   format subject center z3.;
   run;
proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 332px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24232i5F339C9EFE7A43E7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 20:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506333#M2521</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-21T20:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506340#M2522</link>
      <description>&lt;P&gt;Thank you very much, this was exactly what i needed moreover your code looks very clean. I have been able to tweak your code to my specific need.&lt;/P&gt;&lt;P&gt;Your code even allows me to pull trials names from another data source and randomly allocate them to different treatment centers.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Oct 2018 23:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506340#M2522</guid>
      <dc:creator>vjikong</dc:creator>
      <dc:date>2018-10-21T23:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506572#M2523</link>
      <description>&lt;P&gt;This is another somewhat&amp;nbsp;parameterized version.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let center=5;
%let block=6;
%let ratio = 1 1 2 2 3;
%let treat=%sysfunc(countw(%superq(ratio)));
%let subject=%eval(&amp;amp;center*&amp;amp;block*&amp;amp;treat);
%put _global_;
proc format; value trt 1='Active Low Dose' 2='Active High Dose' 3='Placebo'; quit;

proc plan;
   factors center=&amp;amp;center ordered block=&amp;amp;block ordered treat=&amp;amp;treat random subject=1 of &amp;amp;subject perm / noprint;
   output out=plan treat nvals=(&amp;amp;ratio) random;
   run;
   quit;
data plan;
   retain SYSRANDOM &amp;amp;SYSRANDOM SYSRANEND &amp;amp;SYSRANEND;
   set plan;
   length usubjid $16;
   usubjid = catx('-','XYZ-01',vvalue(center),vvalue(subject));
   format subject center z3.;
   run;
proc print;
   run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Oct 2018 19:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Randomization/m-p/506572#M2523</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2018-10-22T19:00:43Z</dc:date>
    </item>
  </channel>
</rss>

