<?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: How to randomise number to a range of +/- 1,000 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652799#M196045</link>
    <description>&lt;P&gt;Hi everyone. Interesting solution, thanks for the information.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2020 09:45:16 GMT</pubDate>
    <dc:creator>johnmorgan</dc:creator>
    <dc:date>2020-06-03T09:45:16Z</dc:date>
    <item>
      <title>How to randomise number to a range of +/- 1,000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652787#M196036</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a numeric variable which is the median price of a property in a region. I need to add some noise to the data. Basically I would like to increase/decrease the values in the variable by no more than 1,000.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So on row 1, 176,000, might come 176,200 or on Row 2 79,000, might become 78,400.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would anyone know how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 08:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652787#M196036</guid>
      <dc:creator>Sean_OConnor</dc:creator>
      <dc:date>2020-06-03T08:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomise number to a range of +/- 1,000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652794#M196041</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try: (RAND("uniform")*2000 - 1000)&lt;BR /&gt;&lt;BR /&gt;but before that use: call streaminit(123);&lt;BR /&gt;&lt;BR /&gt;All the best&lt;BR /&gt;Bart</description>
      <pubDate>Wed, 03 Jun 2020 09:26:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652794#M196041</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-06-03T09:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomise number to a range of +/- 1,000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652795#M196042</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
	set have;
    x_noise=ceil(ranuni(1)*2000) - 1000 + x;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652795#M196042</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-06-03T09:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomise number to a range of +/- 1,000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652796#M196043</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/116786"&gt;@Sean_OConnor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With a recent SAS release such as 9.4M5 or M6 you can also use the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0fpeei0opypg8n1b06qe4r040lv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p0i0papjdn73pzn1kxrjoyygmdfb" target="_blank" rel="noopener"&gt;Integer Distribution&lt;/A&gt;&amp;nbsp;(if a discrete uniform distribution is fine)&lt;FONT face="helvetica"&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input median_price;
cards;
176000
 79000
;

data want;
call streaminit(27182818);
set have;
median_price+rand('integer',-1000,1000);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652796#M196043</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-06-03T09:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomise number to a range of +/- 1,000</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652799#M196045</link>
      <description>&lt;P&gt;Hi everyone. Interesting solution, thanks for the information.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomise-number-to-a-range-of-1-000/m-p/652799#M196045</guid>
      <dc:creator>johnmorgan</dc:creator>
      <dc:date>2020-06-03T09:45:16Z</dc:date>
    </item>
  </channel>
</rss>

