<?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 how to get randomization numbers in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488874#M127494</link>
    <description>&lt;P&gt;data main ;&lt;BR /&gt;input subid $ condition $ ;&lt;BR /&gt;cards ;&lt;BR /&gt;101 normal&lt;BR /&gt;101 abnormal&lt;BR /&gt;102 normal&lt;BR /&gt;102 abnormal&lt;BR /&gt;103 normal&lt;BR /&gt;103 abnormal&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;how to assign type variable&lt;/P&gt;&lt;P&gt;i want to data like see below&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;subid&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;condition&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;type&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;101&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;normal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;101&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;abnormal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;normal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;102&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;abnormal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;103&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;normal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;0&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;103&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;abnormal&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Wed, 22 Aug 2018 13:52:35 GMT</pubDate>
    <dc:creator>thanikondharish</dc:creator>
    <dc:date>2018-08-22T13:52:35Z</dc:date>
    <item>
      <title>how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488874#M127494</link>
      <description>&lt;P&gt;data main ;&lt;BR /&gt;input subid $ condition $ ;&lt;BR /&gt;cards ;&lt;BR /&gt;101 normal&lt;BR /&gt;101 abnormal&lt;BR /&gt;102 normal&lt;BR /&gt;102 abnormal&lt;BR /&gt;103 normal&lt;BR /&gt;103 abnormal&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;how to assign type variable&lt;/P&gt;&lt;P&gt;i want to data like see below&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;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/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 22 Aug 2018 13:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488874#M127494</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-08-22T13:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488876#M127495</link>
      <description>&lt;P&gt;Please explain the process that assigns a 0 or 1 to type.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 13:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488876#M127495</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-22T13:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488877#M127496</link>
      <description>&lt;P&gt;Please post full information, how is the 0 or 1 assigned?&amp;nbsp; Maybe:&lt;/P&gt;
&lt;PRE&gt;x=rand('UNIFORM');&lt;/PRE&gt;
&lt;P&gt;From the manual:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001466748.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 13:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488877#M127496</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-22T13:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488881#M127497</link>
      <description>subjects have type numbers like 0 means subject is not in that condition ,&lt;BR /&gt;1 means subject present in that condition</description>
      <pubDate>Wed, 22 Aug 2018 13:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488881#M127497</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2018-08-22T13:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488883#M127498</link>
      <description>&lt;P&gt;Is type simply a random 0/1 variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so then do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set main;
   a=rand('Integer', 0, 1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Aug 2018 13:57:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488883#M127498</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-22T13:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488892#M127504</link>
      <description>&lt;P&gt;is 0 and 1 always assigned to normal&amp;nbsp;= 0 and abnormal&amp;nbsp;= 1?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;having a full understanding of what you have and what you want, and maybe the why helps others understand without having to solve the implied assumptions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488892#M127504</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-08-22T14:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488894#M127505</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;subjects have type numbers like 0 means subject is not in that condition ,&lt;BR /&gt;1 means subject present in that condition&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But this explains nothing. The question is not what does 0 or 1 mean. The question is: How do we assign the 0 or the 1?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488894#M127505</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-22T14:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488896#M127506</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;is 0 and 1 always assigned to normal&amp;nbsp;= 0 and abnormal&amp;nbsp;= 1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The original example did not follow this rule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;having a full understanding of what you have and what you want, and maybe the why helps others understand without having to solve the implied assumptions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, I agree completely, there's no way to answer the question without this explanation.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488896#M127506</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-22T14:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488898#M127507</link>
      <description>&lt;P&gt;One way to assign a random value of 0 or 1.&lt;/P&gt;
&lt;PRE&gt;data want;
 set have;
 type= rand('table',.5, .5) -1;
run;&lt;/PRE&gt;
&lt;P&gt;The .5 are the probabilities of selection. If you want/need other than 50/50 split adjust the values but keep a total of 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488898#M127507</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-22T14:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488913#M127514</link>
      <description>&lt;P&gt;RAND() function with Bernoulli option and you can specify the probability of a 0 or 1.&amp;nbsp;&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/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;data main ;&lt;BR /&gt;input subid $ condition $ ;&lt;BR /&gt;cards ;&lt;BR /&gt;101 normal&lt;BR /&gt;101 abnormal&lt;BR /&gt;102 normal&lt;BR /&gt;102 abnormal&lt;BR /&gt;103 normal&lt;BR /&gt;103 abnormal&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;how to assign type variable&lt;/P&gt;
&lt;P&gt;i want to data like see below&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;subid&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;condition&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;type&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;101&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;normal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;101&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;abnormal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;102&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;normal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;102&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;abnormal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;103&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;normal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;0&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;103&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;abnormal&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 14:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488913#M127514</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-22T14:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to get randomization numbers</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488954#M127527</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data main ;
input subid $ condition $ ;
array x{0:1} _temporary_ ;
call streaminit(12345678);
i=mod(_n_,2);
if i=1 then do;
    if rand('bern',0.5)=1 then do;x{0}=1;x{1}=0;end;
	 else do;x{0}=0;x{1}=1;end;
end;
flag=x{i};
drop i ;
cards ;
101 normal
101 abnormal
102 normal
102 abnormal
103 normal
103 abnormal
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Aug 2018 15:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-randomization-numbers/m-p/488954#M127527</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-08-22T15:54:12Z</dc:date>
    </item>
  </channel>
</rss>

