<?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 Simulate blocks and treatments in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528677#M144326</link>
    <description>&lt;P&gt;Please, I want to simulate a dataset with&amp;nbsp;&lt;STRONG&gt;4 blocks&lt;/STRONG&gt; and &lt;STRONG&gt;4 treatments&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;counts&lt;/STRONG&gt; following a &lt;STRONG&gt;Poisson&lt;/STRONG&gt;&amp;nbsp;and &lt;STRONG&gt;negative binomial&lt;/STRONG&gt;&amp;nbsp;distribution. Is it possible is SAS?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2019 04:29:00 GMT</pubDate>
    <dc:creator>vdfdd</dc:creator>
    <dc:date>2019-01-21T04:29:00Z</dc:date>
    <item>
      <title>Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528677#M144326</link>
      <description>&lt;P&gt;Please, I want to simulate a dataset with&amp;nbsp;&lt;STRONG&gt;4 blocks&lt;/STRONG&gt; and &lt;STRONG&gt;4 treatments&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;counts&lt;/STRONG&gt; following a &lt;STRONG&gt;Poisson&lt;/STRONG&gt;&amp;nbsp;and &lt;STRONG&gt;negative binomial&lt;/STRONG&gt;&amp;nbsp;distribution. Is it possible is SAS?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 04:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528677#M144326</guid>
      <dc:creator>vdfdd</dc:creator>
      <dc:date>2019-01-21T04:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528684#M144331</link>
      <description>&lt;P&gt;Sure,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;function RAND generates pseudo random numbers from many distributions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Pois = rand("Poisson", m); /* Generates a Poisson variate */&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NegBin = rand("NegBinomial", p, k); /* Genarates a negative binomial variate */&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the documentation for the precise parameterisation.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2019 05:25:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528684#M144331</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-21T05:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528759#M144345</link>
      <description>&lt;P&gt;Here is an example. Your model will determine the definitions of mu, r, and p. I just invented a few values to demonstrate the basic idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data SimBlock;
call streaminit(123);
do Block = 1 to 4;
   do Treatment = 1 to 4;
      /* invent a formula for the expected count */
      mu = ( Block + (Treatment-2.5)**2 );
      PoisCount = rand("Poisson", mu);
      /* invent a probability and number of trials */
      r = mu / 8; /* prob of success */
      k = 1;        /* number of successes */
      NBCount = rand("NegBin", r, k); /* number of failures before k successes */
      output;
   end;
end;
drop mu k r;
run;

proc means data=SimBlock;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Jan 2019 14:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/528759#M144345</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-01-21T14:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533139#M146131</link>
      <description>Thank you for your response.</description>
      <pubDate>Wed, 06 Feb 2019 05:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533139#M146131</guid>
      <dc:creator>vdfdd</dc:creator>
      <dc:date>2019-02-06T05:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533140#M146132</link>
      <description>Thank you for your response. Please I have 2 questions:&lt;BR /&gt;1. In defining the mu (mu = ( Block + (Treatment-2.5)**2 )), you added 2.5. Why?&lt;BR /&gt;2. You defined r = mu / 8; Why the value 8?</description>
      <pubDate>Wed, 06 Feb 2019 05:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533140#M146132</guid>
      <dc:creator>vdfdd</dc:creator>
      <dc:date>2019-02-06T05:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533190#M146155</link>
      <description>&lt;P&gt;No reason. I just invented some numbers because you did not provide any information about the design of the simulation. The number 2.5 represents the average treatment effect. I used 8 to make sure r is a probability in [0, 1].&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 11:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533190#M146155</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-02-06T11:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate blocks and treatments</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533281#M146193</link>
      <description>&lt;P&gt;Thank you for your prompt response.&amp;nbsp;Here is the description of the experiment&amp;nbsp;:&lt;BR /&gt;i. block - 4&lt;BR /&gt;ii. treatments = 4&lt;BR /&gt;iii. repetition = 8&lt;BR /&gt;iv. counts = containing some &lt;STRONG&gt;zeros&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;: Simulate the &lt;STRONG&gt;count&lt;/STRONG&gt;&amp;nbsp;as coming from&amp;nbsp;&lt;BR /&gt;i. a NegBin distribution&lt;BR /&gt;ii. a Poisson distribution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, again, in anticipation.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 15:09:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simulate-blocks-and-treatments/m-p/533281#M146193</guid>
      <dc:creator>vdfdd</dc:creator>
      <dc:date>2019-02-06T15:09:57Z</dc:date>
    </item>
  </channel>
</rss>

