<?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: generate ordinal data with known correlation matrix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/generate-ordinal-data-with-known-correlation-matrix/m-p/186063#M303855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like your code is for the multivariate normal case. You can simplify your life by using the built-in &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_modlib_sect022.htm"&gt;RANDNORMAL function&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your other two questions, you might want to look at my book &lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Chapter 8 deals with simulating MV data from standard distributions. For the MVN case, you can generate 20 replicates like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NumSamples = 20;&lt;/P&gt;&lt;P&gt;Mean = j(1,4,0);&lt;/P&gt;&lt;P&gt;x = RandNormal( NumSamples*N, Mean, R);&lt;/P&gt;&lt;P&gt;ID = colvec(repeat( T(1:NumSamples), 1, N));&lt;/P&gt;&lt;P&gt;Y = ID || x;&lt;/P&gt;&lt;P&gt;varNames = "x1":"x4";&lt;/P&gt;&lt;P&gt;create MVN from Y[c=("ID"||varNames)];&lt;/P&gt;&lt;P&gt;append from Y;&lt;/P&gt;&lt;P&gt;close MVN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The case of ordinal variables is described in Chapter 9.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jan 2014 15:05:29 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-01-06T15:05:29Z</dc:date>
    <item>
      <title>generate ordinal data with known correlation matrix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/generate-ordinal-data-with-known-correlation-matrix/m-p/186062#M303854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to generating data with a known correlation structure. I use proc iml and this codes.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;proc&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;iml&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; n = 5;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; r = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.25&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.6&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;, &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.25&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;, &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.25&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;, &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.6&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.25&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.07&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; print r;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; c = root(r);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; print c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; z=j(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;n&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;4&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt; i = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;n&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt; j = &lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;to&lt;/SPAN&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;4&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z[i,j]=rannor(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;-99&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; print z;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; d = z*c;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; print d;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; x1 = d[,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;];&amp;nbsp; x2=d[,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;2&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;]; x3=d[,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;3&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;]; x4=d[,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: teal; background: white;"&gt;4&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&amp;nbsp; print x1 x2 x3 x4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;create&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt; mvn var{x1 x2 x3 x4};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;append&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;quit&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;proc&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;print&lt;/SPAN&gt;&lt;/STRONG&gt; &lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt; = mvn; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: navy; background: white;"&gt;run&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;It is okey but I want to iteration. &lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I've tried&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;many codes&lt;/SPAN&gt;&lt;SPAN&gt;, but&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;so far&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I did not succeed&lt;/SPAN&gt;&lt;SPAN&gt;. How can I make 20 replicate?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;And also I want to generate ordinal data. How I can do it?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-size: 9.0pt; font-family: 'Arial','sans-serif'; color: black; background: white;"&gt;&lt;SPAN lang="en"&gt;&lt;SPAN&gt;Thanks for your help...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 10:37:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/generate-ordinal-data-with-known-correlation-matrix/m-p/186062#M303854</guid>
      <dc:creator>asayin</dc:creator>
      <dc:date>2014-01-02T10:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: generate ordinal data with known correlation matrix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/generate-ordinal-data-with-known-correlation-matrix/m-p/186063#M303855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like your code is for the multivariate normal case. You can simplify your life by using the built-in &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_modlib_sect022.htm"&gt;RANDNORMAL function&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your other two questions, you might want to look at my book &lt;A href="http://support.sas.com/publishing/authors/wicklin.html"&gt;Simulating Data with SAS&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Chapter 8 deals with simulating MV data from standard distributions. For the MVN case, you can generate 20 replicates like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NumSamples = 20;&lt;/P&gt;&lt;P&gt;Mean = j(1,4,0);&lt;/P&gt;&lt;P&gt;x = RandNormal( NumSamples*N, Mean, R);&lt;/P&gt;&lt;P&gt;ID = colvec(repeat( T(1:NumSamples), 1, N));&lt;/P&gt;&lt;P&gt;Y = ID || x;&lt;/P&gt;&lt;P&gt;varNames = "x1":"x4";&lt;/P&gt;&lt;P&gt;create MVN from Y[c=("ID"||varNames)];&lt;/P&gt;&lt;P&gt;append from Y;&lt;/P&gt;&lt;P&gt;close MVN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The case of ordinal variables is described in Chapter 9.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jan 2014 15:05:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/generate-ordinal-data-with-known-correlation-matrix/m-p/186063#M303855</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-01-06T15:05:29Z</dc:date>
    </item>
  </channel>
</rss>

