<?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 Bivariate Table distribution in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Bivariate-Table-distribution/m-p/146682#M1253</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to simulate data of a bivariate "table" distribution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to generate a vector of values (0,1,2,3,4,5) with probabilities (p(0), p(1), p(2), p(3), p(4), p(5)). Then I want to generate another such vector, with a correlation of let's say 0.8 to the first vector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jan 2014 14:05:52 GMT</pubDate>
    <dc:creator>BlueNose</dc:creator>
    <dc:date>2014-01-20T14:05:52Z</dc:date>
    <item>
      <title>Bivariate Table distribution</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Bivariate-Table-distribution/m-p/146682#M1253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to simulate data of a bivariate "table" distribution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to generate a vector of values (0,1,2,3,4,5) with probabilities (p(0), p(1), p(2), p(3), p(4), p(5)). Then I want to generate another such vector, with a correlation of let's say 0.8 to the first vector.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2014 14:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Bivariate-Table-distribution/m-p/146682#M1253</guid>
      <dc:creator>BlueNose</dc:creator>
      <dc:date>2014-01-20T14:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bivariate Table distribution</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Bivariate-Table-distribution/m-p/146683#M1254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Although your message sounds like you might be wanting to use conditional probability, I suspect that you are trying to generate two vectors jointly from a correlated multivariate ordinal distribution.&amp;nbsp;&amp;nbsp; This is described in Section 9.4 of &lt;EM&gt;&lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;&lt;/EM&gt;, and further described in the Appendix B. Using the modules described in the book, the code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* read in programs from Simulating Data with SAS */&lt;BR /&gt;%include "C:\Downloads\Wicklin2013\RandMVOrd.sas";&lt;BR /&gt;proc iml;&lt;BR /&gt;load module=_all_;&lt;/P&gt;&lt;P&gt;/* define the probabilities of X1 and X2 */&lt;BR /&gt;/*&amp;nbsp;&amp;nbsp; X1&amp;nbsp;&amp;nbsp; X2 */&lt;BR /&gt;P = {0.1&amp;nbsp; 0.1,&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P(0) */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.2&amp;nbsp; 0.2,&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P(1) */&lt;BR /&gt;&amp;nbsp; 0.2&amp;nbsp; 0.2,&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P(2) */&lt;BR /&gt;&amp;nbsp; 0.2&amp;nbsp; 0.2,&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P(3) */&lt;BR /&gt;&amp;nbsp; 0.2&amp;nbsp; 0.2,&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P(4) */&lt;BR /&gt;&amp;nbsp; 0.1&amp;nbsp; 0.1 };&amp;nbsp; /* P(5) */&lt;BR /&gt;/* define the correlation between X1 and X2 */&lt;BR /&gt;Delta = {1&amp;nbsp;&amp;nbsp; 0.8,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.8 1.0 };&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;/* generate two vectors of 100 observations */&amp;nbsp;&amp;nbsp; &lt;BR /&gt;call randseed(54321);&lt;BR /&gt;X = RandMVOrdinal(100, P, Delta);&lt;/P&gt;&lt;P&gt;/* test the process by computing sample correlation */&lt;BR /&gt;corr = corr(X);&lt;BR /&gt;print corr; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 10pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; corr&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 0.7709831&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; font-size: 10pt;"&gt;0.7709831&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 14:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Bivariate-Table-distribution/m-p/146683#M1254</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-01-21T14:45:27Z</dc:date>
    </item>
  </channel>
</rss>

