<?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: Generating Random Numbers in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65124#M18558</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; See also my blog post, "&lt;A href="http://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas/"&gt;How to generate random numbers in SAS&lt;/A&gt;."&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Oct 2011 13:09:24 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2011-10-12T13:09:24Z</dc:date>
    <item>
      <title>Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65120#M18554</link>
      <description>Is there a function that will generate a random number &lt;I&gt;with decimal places&lt;/I&gt; within a certain range?&lt;BR /&gt;
&lt;BR /&gt;
For example, I need to generate a random number between -12.345 and 67.890.  This number must have 3 decimal places, and can be positive or negative, as long as it's within the range given.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Much obliged! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Suzy</description>
      <pubDate>Wed, 18 Aug 2010 14:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65120#M18554</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-18T14:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65121#M18555</link>
      <description>Something like this would work.  &lt;BR /&gt;
&lt;BR /&gt;
var=round(ranuni(0)*(12.345+67.890),0.001)-12.345;&lt;BR /&gt;
&lt;BR /&gt;
To generalize it you would need to create a macro or use proc fcmp.</description>
      <pubDate>Wed, 18 Aug 2010 14:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65121#M18555</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-08-18T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65122#M18556</link>
      <description>Thank you, Rick, that's awesome!&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Suzy</description>
      <pubDate>Wed, 18 Aug 2010 14:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65122#M18556</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-08-18T14:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65123#M18557</link>
      <description>Future reference, consider searching the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website which has SAS-hosted product documentation and supplemental technical / conference reference material.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
generate random numbers site:sas.com</description>
      <pubDate>Wed, 18 Aug 2010 16:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65123#M18557</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-18T16:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65124#M18558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; See also my blog post, "&lt;A href="http://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas/"&gt;How to generate random numbers in SAS&lt;/A&gt;."&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 13:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65124#M18558</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-10-12T13:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65125#M18559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that this approach makes the endpoints of the range half as likely to be realized as the internal points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rick Wicklin's blog post looks at continuous ranges and integer ranges; here we have non-integer but discrete ranges.&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;RickM wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this would work.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var=round(ranuni(0)*(12.345+67.890),0.001)-12.345;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generalize it you would need to create a macro or use proc fcmp.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 21:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65125#M18559</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2011-10-12T21:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65126#M18560</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rick! Do you a sample simulation code to generate multilevel data (nested data)? An example of this is a cluster-randomized trial (CRT) design where the treatment is implemented at the group level while the outcome is measured at the individual level?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aye&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2013 06:35:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65126#M18560</guid>
      <dc:creator>ayecon0325</dc:creator>
      <dc:date>2013-09-21T06:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: Generating Random Numbers</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65127#M18561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are examples like this in my book &lt;EM&gt;&lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;. For example, s&lt;/EM&gt;ee Section 7.5 and Section 11.3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2013 13:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generating-Random-Numbers/m-p/65127#M18561</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-09-24T13:24:37Z</dc:date>
    </item>
  </channel>
</rss>

