<?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: How to simulate two parameters with correlation of 0.8 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731956#M228060</link>
    <description>&lt;P&gt;You can either use a TYPE=CORR or a TYPE=COV matrix as an input matrix to PROC SIMNORMAL. Here is both ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outcorr(type=CORR);
input _TYPE_ $ 1-4 _NAME_ $ 5-6 a b;
datalines ;
MEAN    0      0
STD     0.1225 2
CORR a  1      0.8
CORR b  0.8    1
run;

proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or (the harder way, because you have to &lt;A href="https://blogs.sas.com/content/iml/2010/12/10/converting-between-correlation-and-covariance-matrices.html" target="_self"&gt;form the covariance matrix yourself&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outcorr(type=COV);
input _TYPE_ $ 1-4 _NAME_ $ 5-6 a b;
datalines ;
MEAN    0      0
COV  a  0.015  0.196
COV  b  0.196  4
run;

%let N = 60;            /* sample size */
%let NumSamples = 100;  /* number of samples */
proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure that the OP wants bivariate normal data. The initial post states&lt;/P&gt;
&lt;P&gt;a ~ (0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ (0,2)&lt;/P&gt;
&lt;P&gt;I do not know what that notation means. People seem to be interpreting it as&lt;/P&gt;
&lt;P&gt;a ~ N(0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ N(0,2)&lt;/P&gt;
&lt;P&gt;which seems likely, but worth verifying with the instructor of the class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Apr 2021 17:13:12 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-04-07T17:13:12Z</dc:date>
    <item>
      <title>How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731911#M228032</link>
      <description>&lt;P&gt;I want to simulate two parameters a* and b satisfying the following conditions. How should I simulate these two parameter so that the correlation of them is 0.8. Thanks much for the help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_1-1617803411370.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57048iCFDE522F6EEBAB4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="superbug_1-1617803411370.png" alt="superbug_1-1617803411370.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 13:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731911#M228032</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T13:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731913#M228034</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/09/25/simulate-multivariate-normal-data-sas-simnormal.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2017/09/25/simulate-multivariate-normal-data-sas-simnormal.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 13:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731913#M228034</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-07T13:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731916#M228036</link>
      <description>Do you have SAS IML? If so, this could this be considered a multivariate normal distribution?&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/01/12/sampling-from-the-multivariate-normal-distribution.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2011/01/12/sampling-from-the-multivariate-normal-distribution.html&lt;/A&gt;&lt;BR /&gt;Note the bottom note about using a correlation matrix instead of a covariance matrix.</description>
      <pubDate>Wed, 07 Apr 2021 14:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731916#M228036</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-07T14:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731921#M228037</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much!&lt;/P&gt;
&lt;P&gt;I don't have SAS IML.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_3-1617804835704.png" style="width: 783px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57050i635BEEAAE213EC6A/image-dimensions/783x135?v=v2" width="783" height="135" role="button" title="superbug_3-1617804835704.png" alt="superbug_3-1617804835704.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I don't know how to do this step as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tinyMceEditorsuperbug_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 14:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731921#M228037</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T14:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731944#M228052</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for the information.&lt;/P&gt;
&lt;P&gt;Flowing example you provided, I made up my outcorr data, which looks like following table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_0-1617807171815.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57052iE72C008F84AB9F02/image-size/medium?v=v2&amp;amp;px=400" role="button" title="superbug_0-1617807171815.png" alt="superbug_0-1617807171815.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I use the following code&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import datafile="....\outcorr.csv"
dbms=csv out=outcorr replace; run;

%let N = 60;            /* sample size */
%let NumSamples = 100;  /* number of samples */
proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, there is following error message&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_1-1617807530964.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57053i6CF1F0D8F5F6D9A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="superbug_1-1617807530964.png" alt="superbug_1-1617807530964.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am seeing the "outcorr" data has been normally read in. Do you have any idea of what caused this error message?&lt;/P&gt;
&lt;P&gt;Again thanks much!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731944#M228052</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T15:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731945#M228053</link>
      <description>&lt;P&gt;How was OUTCORR created? Can you show us (screen capture is okay) OUTCORR?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731945#M228053</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-07T15:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731947#M228054</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I manually created outcorr.csv, which looks like following&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_0-1617807996844.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57054i4570563E4F9B8782/image-size/medium?v=v2&amp;amp;px=400" role="button" title="superbug_0-1617807996844.png" alt="superbug_0-1617807996844.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731947#M228054</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731949#M228055</link>
      <description>&lt;P&gt;I will throw this question over to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;to see if he has any ideas why you are getting an error.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:09:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731949#M228055</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-07T15:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731955#M228059</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;I'll keep you updated once I hear from him.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731955#M228059</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T15:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731956#M228060</link>
      <description>&lt;P&gt;You can either use a TYPE=CORR or a TYPE=COV matrix as an input matrix to PROC SIMNORMAL. Here is both ways:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outcorr(type=CORR);
input _TYPE_ $ 1-4 _NAME_ $ 5-6 a b;
datalines ;
MEAN    0      0
STD     0.1225 2
CORR a  1      0.8
CORR b  0.8    1
run;

proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or (the harder way, because you have to &lt;A href="https://blogs.sas.com/content/iml/2010/12/10/converting-between-correlation-and-covariance-matrices.html" target="_self"&gt;form the covariance matrix yourself&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outcorr(type=COV);
input _TYPE_ $ 1-4 _NAME_ $ 5-6 a b;
datalines ;
MEAN    0      0
COV  a  0.015  0.196
COV  b  0.196  4
run;

%let N = 60;            /* sample size */
%let NumSamples = 100;  /* number of samples */
proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to make sure that the OP wants bivariate normal data. The initial post states&lt;/P&gt;
&lt;P&gt;a ~ (0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ (0,2)&lt;/P&gt;
&lt;P&gt;I do not know what that notation means. People seem to be interpreting it as&lt;/P&gt;
&lt;P&gt;a ~ N(0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ N(0,2)&lt;/P&gt;
&lt;P&gt;which seems likely, but worth verifying with the instructor of the class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 17:13:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731956#M228060</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-04-07T17:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731957#M228061</link>
      <description>&lt;P&gt;Use PROC SIMNORMAL with the COV matrix that you specify in the image.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 15:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731957#M228061</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-04-07T15:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731964#M228067</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you SOOO much for your quick response!&lt;/P&gt;
&lt;P&gt;Yes, your code worked. The standard expression should be the following as you pointed out&lt;/P&gt;
&lt;P&gt;a ~ N(0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ N(0, 2)&lt;/P&gt;
&lt;P&gt;Could you please explain how did you get the numbers in the covariance matrix as following?&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;COV  a  1.915  0.3873
COV  b  0.3873 4.321&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 16:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731964#M228067</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T16:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731968#M228069</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is the correct DATA step to create the input matrix for PROC SIMNORMAL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data outcorr(type=COV);
input _TYPE_ $ 1-4 _NAME_ $ 5-6 a b;
datalines ;
MEAN    0      0
STD     0.1225 2
COV  a  1.915  0.3873
COV  b  0.3873 4.321
run;

%let N = 60;            /* sample size */
%let NumSamples = 100;  /* number of samples */
proc simnormal data=work.outcorr outsim=SimMVN
               numreal = %sysevalf(&amp;amp;N*&amp;amp;NumSamples) 
               seed = 12345;          /* random number seed */
   var a b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want t make sure that the OP wants bivariate normal data. The initial post states&lt;/P&gt;
&lt;P&gt;a ~ (0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ (0,2)&lt;/P&gt;
&lt;P&gt;I do not know what that notation means. People seem to be interpreting it as&lt;/P&gt;
&lt;P&gt;a ~ N(0, 0.1225)&lt;/P&gt;
&lt;P&gt;b ~ N(0,2)&lt;/P&gt;
&lt;P&gt;which seems likely, but worth verifying with the instructor of the class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, that seems like an obvious error to me, now that you have pointed it out. COV matrix not CORR matrix. Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 16:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731968#M228069</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-04-07T16:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731989#M228082</link>
      <description>&lt;P&gt;I'm very sorry. That was a mistake on my part because I copied/pasted from another source.&lt;/P&gt;
&lt;P&gt;From your follow-up post, I assume that&amp;nbsp;N(0,2) means "mean=0 and stdDev=2." If so, the correct covariance matrix should be&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;COV  a  0.015  0.196
COV  b  0.196  4&lt;/LI-CODE&gt;
&lt;P&gt;which is the matrix in the second part of the problem. I will edit my solution. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 17:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/731989#M228082</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-04-07T17:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732004#M228088</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;when I changed it to&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-sas"&gt;&lt;CODE&gt;COV  a  0.015  0.196
COV  b  0.196  4&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and run the code, it has the following error message&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="superbug_0-1617818674360.png" style="width: 458px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57061i42CACD897902DA3D/image-dimensions/458x132?v=v2" width="458" height="132" role="button" title="superbug_0-1617818674360.png" alt="superbug_0-1617818674360.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 18:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732004#M228088</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T18:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732008#M228091</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please ignore my last message. the error message resolved.&lt;/P&gt;
&lt;P&gt;I very much appreciate your help and expertise. Again thanks much!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Apr 2021 18:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732008#M228091</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-07T18:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732201#M228162</link>
      <description>&lt;P&gt;So interesting. Maybe you need this ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(12345678);
do i=1 to 1000;
 x=rand('normal',0,0.1225);
 e=rand('normal',0,0.1225);
 y=0.8*x + sqrt(1-0.8**2)*e;
 output;
end;
run;

proc standard data=have out=temp std=2;
var y;
run;
data want;
 merge have(keep=x) temp(keep=y);
 run;
 proc corr data=want;
var x y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="x.jpg" style="width: 496px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/57116iEAE39E8145A9DAC0/image-size/large?v=v2&amp;amp;px=999" role="button" title="x.jpg" alt="x.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 11:49:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732201#M228162</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-09T11:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate two parameters with correlation of 0.8</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732268#M228191</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks much for you alternative input. it is awesome!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Apr 2021 17:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-simulate-two-parameters-with-correlation-of-0-8/m-p/732268#M228191</guid>
      <dc:creator>superbug</dc:creator>
      <dc:date>2021-04-08T17:01:40Z</dc:date>
    </item>
  </channel>
</rss>

