<?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: permute site assigment (derive all combinations)? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562354#M10733</link>
    <description>&lt;P&gt;Thanks, this is very helpful. I need to figure out how to assign each of the numbers (1,2,3)&amp;nbsp;to&amp;nbsp;each site such that all combinations are produced but I will play around with proc iml.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 17:10:47 GMT</pubDate>
    <dc:creator>kstolzmann</dc:creator>
    <dc:date>2019-05-29T17:10:47Z</dc:date>
    <item>
      <title>permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562076#M10696</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a dataset with subjects nested in 9 different sites and a variable "wave"&amp;nbsp;where 3 sites are in each of 3 waves (simplified dataset below; SAS 9.4). What I want is to&amp;nbsp;create &lt;EM&gt;n&lt;/EM&gt; different variables/versions of "wave" such that all combinations of&amp;nbsp;sites in waves&amp;nbsp;are represented.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
 
data have;
infile cards;
input subject site wave;
cards;
1 500 1
2 500 1 
3 600 1 
4 600 1
5 600 1
6 700 1
7 702 2 
8 702 2
9 702 2 
10 702 2
11 810 2
12 810 2
13 870 2 
14 870 2
15 870 2
16 870 2
17 911 3 
18 912 3
19 913 3
20 913 3
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 19:29:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562076#M10696</guid>
      <dc:creator>kstolzmann</dc:creator>
      <dc:date>2019-05-28T19:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562081#M10698</link>
      <description>Please show what you expect as output. If you need to simplify the input that's fine.</description>
      <pubDate>Tue, 28 May 2019 19:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562081#M10698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-28T19:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562085#M10700</link>
      <description>&lt;P&gt;See if this is exactly what you are seeking:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table site as select distinct site from have;
   create table wave as select distinct wave from have;
   create table want as select * from site, wave;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking to apply these combinations to every SUBJECT, the same techniques can be extended pretty easily.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 19:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562085#M10700</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-05-28T19:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562099#M10706</link>
      <description>&lt;P&gt;Thanks--what I would want, using a very simple example (using only 3 sites)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards;
input subject site wave1 wave2 wave3 wave4 wave5 wave6;
cards;
1  500 1 1 2 2 3 3
3  600 2 3 1 3 2 1
17 911 3 2 3 1 1 2

;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 12:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562099#M10706</guid>
      <dc:creator>kstolzmann</dc:creator>
      <dc:date>2019-05-29T12:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562100#M10707</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26951"&gt;@kstolzmann&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks--what I would want, using a very simple example (using only 3 sites)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards;
input subject site wave1 wave2 wave3 wave4 wave5 wave6;
cards;
1 500 1 1 2 2 3 3
2 600 2 3 1 3 2 1
3 911 3 2 3 1 1 2

;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since SUBJECT=2 has a SITE=500 in your example data&amp;nbsp;you will have to supply the logic why the output for SUBJECT=2 now has a Site=600.&lt;/P&gt;
&lt;P&gt;Of if the actual subject number is not important let us know.&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 20:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562100#M10707</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-28T20:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562109#M10708</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26951"&gt;@kstolzmann&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks--what I would want, using a very simple example (using only 3 sites)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile cards;
input subject site wave1 wave2 wave3 wave4 wave5 wave6;
cards;
1 500 1 1 2 2 3 3
2 600 2 3 1 3 2 1
3 911 3 2 3 1 1 2

;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How are the wave1, wave2, wave3 values calculated?&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 20:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562109#M10708</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-28T20:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562236#M10715</link>
      <description>&lt;P&gt;Ah, thanks, I edited my post (I'm further confusing the question!)--subjects&amp;nbsp;do need to stay within their site, but the randomization (wave assignment) happens at the site level.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 12:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562236#M10715</guid>
      <dc:creator>kstolzmann</dc:creator>
      <dc:date>2019-05-29T12:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562240#M10717</link>
      <description>&lt;P&gt;The wave1, wave2...wave&lt;EM&gt;n&lt;/EM&gt; variables are assigned randomly such that (in my original post) 3 sites are assigned to wave=1, 3 sites are assigned to wave=2, and 3 sites to wave=3. But I'm looking to generate these assignments for all combinations (9!/3! 3! 3! = n=1680 "wave" variables...eep).&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 12:38:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562240#M10717</guid>
      <dc:creator>kstolzmann</dc:creator>
      <dc:date>2019-05-29T12:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562309#M10718</link>
      <description>&lt;A href="https://blogs.sas.com/content/iml/2010/10/13/generate-all-permutations-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2010/10/13/generate-all-permutations-in-sas.html&lt;/A&gt;</description>
      <pubDate>Wed, 29 May 2019 15:05:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562309#M10718</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-29T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: permute site assigment (derive all combinations)?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562354#M10733</link>
      <description>&lt;P&gt;Thanks, this is very helpful. I need to figure out how to assign each of the numbers (1,2,3)&amp;nbsp;to&amp;nbsp;each site such that all combinations are produced but I will play around with proc iml.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 17:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/permute-site-assigment-derive-all-combinations/m-p/562354#M10733</guid>
      <dc:creator>kstolzmann</dc:creator>
      <dc:date>2019-05-29T17:10:47Z</dc:date>
    </item>
  </channel>
</rss>

