<?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 Randomization with PROC RANK in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837583#M331186</link>
    <description>&lt;P&gt;Hello, I need to use&amp;nbsp;RANUNI(5) and PROC RANK to randomize 30 subjects to Stage 1 and then 30 to Stage 2, and then again randomize to treatment Y and treatment Z. I'm not sure how to get there to be 15 in each group. My code below produced 14 and 16&amp;nbsp; for stage 1, but overall it is randomized&amp;nbsp; equally for all 60 subjects.&amp;nbsp; This is a homework assignment and I need to use the code I have below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Specifically, they would like assistance in establishing a randomization scheme for&lt;BR /&gt;a randomized Phase II study of Treatments Y vs. Z in advanced prostate cancer patients.&lt;BR /&gt;The study will be done in two stages. Fifteen patients per treatment will be assigned&lt;BR /&gt;in Stage 1 and 15 per group in Stage 2. Produce a randomization list for them indicating&lt;BR /&gt;how the total of 60 patients will be randomized to one of the two arms (15 to each arm&lt;BR /&gt;for Stage 1, and 15 to each arm in Stage 2). The list should sorted by Stage, numbered&lt;BR /&gt;from 1 to 30 within each stage, and show the corresponding treatment assignment Y or Z.&lt;BR /&gt;Check that you have achieved a balance between the 2 treatments within each block (15 Ys and 15 Zs).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;*Randomize 60 patients;&lt;BR /&gt;DATA random;&lt;BR /&gt;DO Subject = 1 to 60;&lt;BR /&gt;number = RANUNI(5);&lt;BR /&gt;IF Subject &amp;lt;=30 then stage = 1;&lt;BR /&gt;else stage = 2;&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;*Use Proc rank to create rank variable to rank the patients to treatment groups;&lt;BR /&gt;PROC RANK DATA = random OUT = ranked;&lt;BR /&gt;VAR number;&lt;BR /&gt;RANKS numrank;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;*Assign 15 patients to each treatment group;;&lt;BR /&gt;DATA ranked2;&lt;BR /&gt;SET ranked;&lt;BR /&gt;IF (numrank&amp;lt;=30) THEN Treatment = 'Y';&lt;BR /&gt;ELSE Treatment = 'Z';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=ranked2;&lt;BR /&gt;by Stage;&lt;BR /&gt;run;&lt;BR /&gt;proc print data = ranked2;&lt;BR /&gt;var Subject Stage treatment;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 09 Oct 2022 21:24:43 GMT</pubDate>
    <dc:creator>Zaichik17</dc:creator>
    <dc:date>2022-10-09T21:24:43Z</dc:date>
    <item>
      <title>Randomization with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837583#M331186</link>
      <description>&lt;P&gt;Hello, I need to use&amp;nbsp;RANUNI(5) and PROC RANK to randomize 30 subjects to Stage 1 and then 30 to Stage 2, and then again randomize to treatment Y and treatment Z. I'm not sure how to get there to be 15 in each group. My code below produced 14 and 16&amp;nbsp; for stage 1, but overall it is randomized&amp;nbsp; equally for all 60 subjects.&amp;nbsp; This is a homework assignment and I need to use the code I have below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Specifically, they would like assistance in establishing a randomization scheme for&lt;BR /&gt;a randomized Phase II study of Treatments Y vs. Z in advanced prostate cancer patients.&lt;BR /&gt;The study will be done in two stages. Fifteen patients per treatment will be assigned&lt;BR /&gt;in Stage 1 and 15 per group in Stage 2. Produce a randomization list for them indicating&lt;BR /&gt;how the total of 60 patients will be randomized to one of the two arms (15 to each arm&lt;BR /&gt;for Stage 1, and 15 to each arm in Stage 2). The list should sorted by Stage, numbered&lt;BR /&gt;from 1 to 30 within each stage, and show the corresponding treatment assignment Y or Z.&lt;BR /&gt;Check that you have achieved a balance between the 2 treatments within each block (15 Ys and 15 Zs).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;*Randomize 60 patients;&lt;BR /&gt;DATA random;&lt;BR /&gt;DO Subject = 1 to 60;&lt;BR /&gt;number = RANUNI(5);&lt;BR /&gt;IF Subject &amp;lt;=30 then stage = 1;&lt;BR /&gt;else stage = 2;&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;*Use Proc rank to create rank variable to rank the patients to treatment groups;&lt;BR /&gt;PROC RANK DATA = random OUT = ranked;&lt;BR /&gt;VAR number;&lt;BR /&gt;RANKS numrank;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;*Assign 15 patients to each treatment group;;&lt;BR /&gt;DATA ranked2;&lt;BR /&gt;SET ranked;&lt;BR /&gt;IF (numrank&amp;lt;=30) THEN Treatment = 'Y';&lt;BR /&gt;ELSE Treatment = 'Z';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sort data=ranked2;&lt;BR /&gt;by Stage;&lt;BR /&gt;run;&lt;BR /&gt;proc print data = ranked2;&lt;BR /&gt;var Subject Stage treatment;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Oct 2022 21:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837583#M331186</guid>
      <dc:creator>Zaichik17</dc:creator>
      <dc:date>2022-10-09T21:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837632#M331212</link>
      <description>&lt;P&gt;I think you want a &lt;FONT face="courier new,courier"&gt;BY STAGE;&lt;/FONT&gt; in PROC RANK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC RANK DATA = random OUT = ranked;
by stage;
VAR number;
RANKS numrank;
RUN;

*Assign 15 patients to each treatment group;;
DATA ranked2;
SET ranked;
IF (numrank&amp;lt;=15) THEN Treatment = 'Y';
ELSE Treatment = 'Z';
run;

proc freq data=ranked2;
tables treatment*stage;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 10:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837632#M331212</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-10T10:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Randomization with PROC RANK</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837646#M331219</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*Why not PROC PLAN ?*/
DATA random;
call streaminit(123);
DO Subject = 1 to 60;
number1 = RANUNI(5);
number2 = RANUNI(5);
OUTPUT;
END;
RUN;
PROC RANK DATA = random OUT = ranked(index=(numrank1)) groups=2;
VAR number1;
RANKS numrank1;
RUN;
PROC RANK DATA = ranked OUT = ranked2 groups=2;
by numrank1;
VAR number2;
RANKS numrank2;
RUN;


proc freq data=ranked2;
table numrank1*numrank2/list;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2022 11:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomization-with-PROC-RANK/m-p/837646#M331219</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-10T11:46:28Z</dc:date>
    </item>
  </channel>
</rss>

