<?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 Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804082#M316614</link>
    <description>&lt;P&gt;Thank you! How do I then get the output to assign condition 1-5 and a random study ID? Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Mar 2022 14:31:45 GMT</pubDate>
    <dc:creator>pshaffer122</dc:creator>
    <dc:date>2022-03-25T14:31:45Z</dc:date>
    <item>
      <title>stratified randomization</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/803960#M316605</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to randomize 1,000 patients to 5 study conditions. I'd like to block on three factors, and preliminary data indicates that there is a predicted percentage of participants that will fall within each level within each factor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Factor 1=gender: male (60%; female (40%)&lt;/P&gt;&lt;P&gt;Factor2= SUD: OUD only (32%); OUD+otherSUD(68%)&lt;/P&gt;&lt;P&gt;Factor3: psych_severity yes(21%); no(79%)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help thank you so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 02:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/803960#M316605</guid>
      <dc:creator>pshaffer122</dc:creator>
      <dc:date>2022-03-25T02:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: stratified randomization</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804036#M316608</link>
      <description>&lt;P&gt;Like this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
proc plan seed=123456789 ;
factors study=1  _gender=1000 ;
output  out=factor1;
run;
factors study=1  _SUD=1000;
output  out=factor2;
run;
factors study=1  _psych_severity=1000;
output  out=factor3;
run;
quit;
ods select all;


data factor1;
 set factor1;
gender=ifc(_gender in (1:600),'Male      ' ,'Female');
run;
data factor2;
 set factor2;
 SUD=ifc(_SUD in (1:320),'OUD only       ' ,'OUD+otherSUD');
run;
data factor3;
 set factor3;
 psych_severity=ifc(_psych_severity in (1:210),'yes ' ,'no  ');
run;


data want;
 merge factor1-factor3;
 drop _:;
run;



proc freq data=want;
table gender SUD  psych_severity /missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Mar 2022 12:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804036#M316608</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-03-25T12:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: stratified randomization</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804082#M316614</link>
      <description>&lt;P&gt;Thank you! How do I then get the output to assign condition 1-5 and a random study ID? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 14:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804082#M316614</guid>
      <dc:creator>pshaffer122</dc:creator>
      <dc:date>2022-03-25T14:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: stratified randomization</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804246#M316695</link>
      <description>&lt;P&gt;Add one more factor in it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
proc plan seed=123456789 ;
factors study=1  _gender=1000 ;
output  out=factor1;
run;
factors study=1   _SUD=1000 ;
output  out=factor2;
run;
factors study=1   _psych_severity=1000 ;
output  out=factor3;
run;
factors study=1   _studyid=1000 ;
output  out=factor4;
run;
quit;
ods select all;


data factor1;
 set factor1;
gender=ifc(_gender in (1:600),'Male      ' ,'Female');
run;
data factor2;
 set factor2;
 SUD=ifc(_SUD in (1:320),'OUD only       ' ,'OUD+otherSUD');
run;
data factor3;
 set factor3;
 psych_severity=ifc(_psych_severity in (1:210),'yes ' ,'no  ');
run;
data factor4;
 set factor4;
 if _studyid in (1:200) then studyid=1;
 if _studyid in (201:400) then studyid=2;
 if _studyid in (401:600) then studyid=3;
 if _studyid in (601:800) then studyid=4;
 if _studyid in (801:1000) then studyid=5;
run;


data want;
 merge factor1-factor4;
 drop _: study;
run;



proc freq data=want;
table gender SUD  psych_severity studyid/missing ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 26 Mar 2022 10:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stratified-randomization/m-p/804246#M316695</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-03-26T10:12:24Z</dc:date>
    </item>
  </channel>
</rss>

