<?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: Randomize order of 1 variable within different strata in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795400#M255132</link>
    <description>To clarify, I do not simply want to randomize the order of observation within the strata, but I want to RETAIN the order of the blocks and randomize their order within each strata. Each block has an identifying number. Thank you!</description>
    <pubDate>Thu, 10 Feb 2022 00:45:37 GMT</pubDate>
    <dc:creator>keherder</dc:creator>
    <dc:date>2022-02-10T00:45:37Z</dc:date>
    <item>
      <title>Randomize order of 1 variable within different strata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795399#M255131</link>
      <description>&lt;P&gt;Hello! I am wondering if anyone has an answer on how I can randomize the order of one variable within strata. So, I used proc plan to create 3 randomization lists stratified by clinic and cancer stage (10 strata) in blocks of 2, 4, and 8. I merged the 3 lists into 1, but now within each strata, the blocks are ordered by all the blocks of 2, all the blocks of 4, and all the blocks of 8. I somehow want to randomize the order of the blocks within each strata. Can anyone help me with this? Each block has its own number, so I can see that they are ordered chronologically. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 00:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795399#M255131</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2022-02-10T00:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Randomize order of 1 variable within different strata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795400#M255132</link>
      <description>To clarify, I do not simply want to randomize the order of observation within the strata, but I want to RETAIN the order of the blocks and randomize their order within each strata. Each block has an identifying number. Thank you!</description>
      <pubDate>Thu, 10 Feb 2022 00:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795400#M255132</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2022-02-10T00:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Randomize order of 1 variable within different strata</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795425#M255145</link>
      <description>&lt;P&gt;Posting data as working data step will, most likely, increase quantity and quality of the answer given by the community.&lt;/P&gt;
&lt;P&gt;So this is untested code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ordered;
  set have;
  new_position = rand('uniform');
run;

proc sort data=ordered out=want;
  by identifying_number new_position;
run;
  &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Feb 2022 06:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Randomize-order-of-1-variable-within-different-strata/m-p/795425#M255145</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-02-10T06:17:51Z</dc:date>
    </item>
  </channel>
</rss>

