<?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: Stratified Randomization in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Stratified-Randomization/m-p/469324#M70793</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/164073"&gt;@azt5173&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your dataset TREAT will contain only one observation (Treatment="C") because you forgot to write OUTPUT statements after each of the three assignment statements. This explains why A and B do not occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what your dataset SCORE looks like, but if you want to randomly assign 2310 subjects to three treatment groups, the GROUPS= option of PROC SURVEYSELECT could be helpful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data subjects;
do subjno=1 to 2310;
  output;
end;
run;

proc surveyselect data=subjects groups=(924 462 924)
out=assignment
seed=12345678;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to replace the numeric treatment variable GroupID with values 1, 2, 3 by a character variable TREATMENT with values "A", "B", "C" in dataset ASSIGNMENT afterwards (or just assign a format to map 1 --&amp;gt; "A" etc.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above technique as well as an alternative -- PROC PLAN --&amp;nbsp;were suggested in replies to a similar question in 2016:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/Generate-random-order-within-a-set-of-number/m-p/285601/highlight/true#M4228" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/Generate-random-order-within-a-set-of-number/m-p/285601/highlight/true#M4228&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 17:40:57 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-06-11T17:40:57Z</dc:date>
    <item>
      <title>Stratified Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stratified-Randomization/m-p/469290#M70791</link>
      <description>&lt;P&gt;I have 3 treatments (A,B,C). I need to build a data set with these treatments and allocate the subject according to a 2:1:2 randomization ratio. I have a sample of 2310 so I just divided the treatments as 924 for treatment A(2/5*2310), 462 for treatment B, and 924 treatment C.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data treat;&lt;BR /&gt;Treatment="A";&lt;BR /&gt;Treatment="B";&lt;BR /&gt;Treatment="C";&lt;BR /&gt;run;&lt;BR /&gt;proc surveyselect data=score out=score1&lt;BR /&gt;method=SRS&lt;BR /&gt;seed=12345678&lt;BR /&gt;sampsize=(924 462 924);&lt;BR /&gt;strata treatment notsorted;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;When I run the code I just get the treatment C for the variable A and B does not show up. Probability of selection is still 0.4 which is not what I want and sample ratio is not really working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:32:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stratified-Randomization/m-p/469290#M70791</guid>
      <dc:creator>azt5173</dc:creator>
      <dc:date>2018-06-11T15:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Stratified Randomization</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Stratified-Randomization/m-p/469324#M70793</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/164073"&gt;@azt5173&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your dataset TREAT will contain only one observation (Treatment="C") because you forgot to write OUTPUT statements after each of the three assignment statements. This explains why A and B do not occur.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what your dataset SCORE looks like, but if you want to randomly assign 2310 subjects to three treatment groups, the GROUPS= option of PROC SURVEYSELECT could be helpful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data subjects;
do subjno=1 to 2310;
  output;
end;
run;

proc surveyselect data=subjects groups=(924 462 924)
out=assignment
seed=12345678;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to replace the numeric treatment variable GroupID with values 1, 2, 3 by a character variable TREATMENT with values "A", "B", "C" in dataset ASSIGNMENT afterwards (or just assign a format to map 1 --&amp;gt; "A" etc.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above technique as well as an alternative -- PROC PLAN --&amp;nbsp;were suggested in replies to a similar question in 2016:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/Generate-random-order-within-a-set-of-number/m-p/285601/highlight/true#M4228" target="_blank"&gt;https://communities.sas.com/t5/SAS-Data-Mining-and-Machine/Generate-random-order-within-a-set-of-number/m-p/285601/highlight/true#M4228&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 17:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Stratified-Randomization/m-p/469324#M70793</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-06-11T17:40:57Z</dc:date>
    </item>
  </channel>
</rss>

