<?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: Randomly generate names from a column (name) and group the generated random names in groups of 4 in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434381#M4568</link>
    <description>&lt;P&gt;PROC SURVEYSELECT is the way to go then. The documentation has examples, if you have issues with the implementation post your code, referencing the SASHELP.CLASS data set or including sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 'manual' way would be to create a random number, sort by random number, Group each 4 together using the MOD() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/191567"&gt;@bobtalam&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I wanted to randomly assign them into 50 groups of 4 participants in each.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2018 20:44:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-05T20:44:20Z</dc:date>
    <item>
      <title>Randomly generate names from a column (name) and group the generated random names in groups of 4.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434363#M4565</link>
      <description>&lt;P&gt;I'm using sas studio how do I generate random names from a group of 200 obs and group the names in groups of 4. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 20:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434363#M4565</guid>
      <dc:creator>bobtalam</dc:creator>
      <dc:date>2018-02-05T20:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434365#M4566</link>
      <description>&lt;P&gt;Are you asking how you would assign each of 200 observations randomly to one of four groups?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are, PROC SURVEYSELECT might be where you want to go.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 20:20:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434365#M4566</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2018-02-05T20:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434366#M4567</link>
      <description>&lt;P&gt;I wanted to randomly assign them into 50 groups of 4 participants in each.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 20:21:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434366#M4567</guid>
      <dc:creator>bobtalam</dc:creator>
      <dc:date>2018-02-05T20:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434381#M4568</link>
      <description>&lt;P&gt;PROC SURVEYSELECT is the way to go then. The documentation has examples, if you have issues with the implementation post your code, referencing the SASHELP.CLASS data set or including sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 'manual' way would be to create a random number, sort by random number, Group each 4 together using the MOD() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/191567"&gt;@bobtalam&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I wanted to randomly assign them into 50 groups of 4 participants in each.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 20:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434381#M4568</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-05T20:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434398#M4569</link>
      <description>&lt;P&gt;Thanks for you response. I do have this as my code, but I don't know where to put the specification to group them into group of 4.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc surveyselect data=work.import&lt;BR /&gt;method=srs n=38&lt;BR /&gt;out=work.samplesrs;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 22:05:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434398#M4569</guid>
      <dc:creator>bobtalam</dc:creator>
      <dc:date>2018-02-05T22:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434404#M4570</link>
      <description>&lt;P&gt;You want an N=4 and REPS=50. Note that you've specified SRS which is Simple Random Sample which means names can be repeated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="delete_surveyselect.JPG" style="width: 532px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18345iF924E001DEE45D54/image-size/large?v=v2&amp;amp;px=999" role="button" title="delete_surveyselect.JPG" alt="delete_surveyselect.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/191567"&gt;@bobtalam&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for you response. I do have this as my code, but I don't know where to put the specification to group them into group of 4.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc surveyselect data=work.import&lt;BR /&gt;method=srs n=38&lt;BR /&gt;out=work.samplesrs;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 22:13:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434404#M4570</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-05T22:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434406#M4571</link>
      <description>&lt;P&gt;Is there a way I can set it not to repeat names?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 22:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434406#M4571</guid>
      <dc:creator>bobtalam</dc:creator>
      <dc:date>2018-02-05T22:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Randomly generate names from a column (name) and group the generated random names in groups of 4</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434413#M4572</link>
      <description>&lt;P&gt;I would think so, but I can't seem to figure it out. I'm 99% sure there's a way though so I'll move it to the stats forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the random variable method:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _random;
set sashelp.class;
rand = rand('normal', 0, 25);
run;

proc sort data=_Random;
by rand;run;

data groups;
set _random;
if _n_=1 then group=0;

if mod(_n_, 2) = 1 then group+1;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Feb 2018 22:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Randomly-generate-names-from-a-column-name-and-group-the/m-p/434413#M4572</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-05T22:48:24Z</dc:date>
    </item>
  </channel>
</rss>

