<?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: Wright-Fisher simulation in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690053#M33279</link>
    <description>Thank you so much!! Worked perfectly!&lt;BR /&gt;</description>
    <pubDate>Thu, 08 Oct 2020 15:32:13 GMT</pubDate>
    <dc:creator>jeffgreen</dc:creator>
    <dc:date>2020-10-08T15:32:13Z</dc:date>
    <item>
      <title>Wright-Fisher simulation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/689946#M33269</link>
      <description>Hi everyone,&lt;BR /&gt;I have created the following dataset:&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;data binomial;&lt;BR /&gt;input n p;&lt;BR /&gt;cards;&lt;BR /&gt;12 .5&lt;BR /&gt;9 .4&lt;BR /&gt;15 .6&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;&amp;amp;nbsp;</description>
      <pubDate>Thu, 08 Oct 2020 15:39:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/689946#M33269</guid>
      <dc:creator>jeffgreen</dc:creator>
      <dc:date>2020-10-08T15:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Wright-Fisher simulation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/689963#M33270</link>
      <description>I moved this post to the Statistical Procedures forum, where it should get noticed by folks more familiar with topics like this.</description>
      <pubDate>Thu, 08 Oct 2020 13:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/689963#M33270</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2020-10-08T13:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Wright-Fisher simulation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690027#M33277</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/343927"&gt;@jeffgreen&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
call streaminit(27182818);
set binomial;
k=n*p;
do r=1 by 1 until(k=0 | k=n);
  k=rand('binom',k/n,n);
  output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you don't need the individual binomial random numbers in dataset WANT, just omit the OUTPUT statement. Then you'll get only the final random number k (equal to 0 or n) and the number r of random number generations which led to this result.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 14:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690027#M33277</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-10-08T14:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Wright-Fisher simulation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690034#M33278</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/343927"&gt;@jeffgreen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have created the following dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data binomial;&lt;BR /&gt;input n p;&lt;BR /&gt;cards;&lt;BR /&gt;12 .5&lt;BR /&gt;9 .4&lt;BR /&gt;15 .6&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, I want to run a Wright-Fisher simulation. For example, in the first line of code, I want to run binomial(12, .5), and using this result (say for example the result was 5), I want to do another binomial calculation- binomial (12, 5/12) where 5/12 is the result of the previous binomial simulation divided by n (12). I want to create code that, for each line of code, will repeat this until the generated number is 0 or n (which means the binomial simulation is either a success 0% of the time or 100% of the time). How would I go about doing this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please describe in some detail what this phrase means: " I want to run binomial(12, .5)".&lt;/P&gt;
&lt;P&gt;SAS&amp;nbsp; provides a number of functions that will let you work with specified distributions like binomial with given parameters: CDF PDF PROBBNML but "run" does not describe much.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690034#M33278</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-08T15:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Wright-Fisher simulation</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690053#M33279</link>
      <description>Thank you so much!! Worked perfectly!&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Wright-Fisher-simulation/m-p/690053#M33279</guid>
      <dc:creator>jeffgreen</dc:creator>
      <dc:date>2020-10-08T15:32:13Z</dc:date>
    </item>
  </channel>
</rss>

