<?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: Simulation  data using SAS in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/447558#M23421</link>
    <description>&lt;P&gt;It sounds like you are looking for resources and sample code. Rather than answer your specific questions, here are some links that you might find useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start by reading &lt;A href="https://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way.html" target="_self"&gt;"Simulation in SAS: The slow way or the BY way"&lt;/A&gt;&amp;nbsp;to learn the general structure of simulation code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To learn how to simulate multivariate normal data in SAS, see &lt;A href="https://blogs.sas.com/content/iml/2011/01/12/sampling-from-the-multivariate-normal-distribution.html" target="_self"&gt;"Sampling from the multivariate normal distribution"&lt;/A&gt;&amp;nbsp;and &lt;A href="https://blogs.sas.com/content/iml/2013/04/10/generate-multiple-mvn-samples.html" target="_self"&gt;"How to generate multiple samples from the multivariate normal distribution in SAS"&lt;/A&gt;.&amp;nbsp; If you don't have SAS/IML, you can &lt;A href="https://blogs.sas.com/content/iml/2017/09/25/simulate-multivariate-normal-data-sas-simnormal.html" target="_self"&gt;use PROC SIMNORMAL.&lt;/A&gt;&amp;nbsp;For 2-D data or for nonnormal data, you can use the DATA step, as you are doing in your post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For power estimation using simulation, see&lt;A href="https://blogs.sas.com/content/iml/2013/05/30/simulation-power.html" target="_self"&gt; "Using simulation to estimate the power of a statistical test."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information, see &lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1387-2015.pdf" target="_self"&gt;"Ten Tips for Simulating Data with SAS"&lt;/A&gt;, which includes an example of using simulations to estimate power. For many more examples and details, see &lt;A href="https://support.sas.com/en/books/authors/rick-wicklin.html" target="_self"&gt;&lt;EM&gt;Simulating Data with SAS&lt;/EM&gt;&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 19:57:43 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-03-21T19:57:43Z</dc:date>
    <item>
      <title>Simulation  data using SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446472#M23386</link>
      <description>&lt;P&gt;How do I code my sas prog. to solve this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I trying to comparing correlated means in the presence of incomplete data (Task) using simulated data&lt;/P&gt;&lt;P&gt;I've tried to perform this task using simulated date - statistical power cal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compute the empirical size and power calculation using 1000 data sets and significance level of α = 0:05. Under the alternative hypotheses&amp;nbsp; &amp;nbsp;is varied among 0 and 1.0, and the correlation &amp;nbsp;is varied among ρ =&amp;nbsp; 0.2 and 0.9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Simulation1&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generate from Exponential distribution with scale parameter = 1; using&amp;nbsp; np = 20, nux = 10, and nuy = 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Simulation 2&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Generate from normal distribution using &amp;nbsp;np = 20, nux = 30, and nuy = 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Simulation 3&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Generate from normal distribution using&amp;nbsp; np = 10, nux = 15, and nuy = 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where &lt;STRONG&gt;np&lt;/STRONG&gt; represent the number of complete pairs where both observations (x; y) are present, nux is the number of unpaired observations where only the first value (x) is present&lt;/P&gt;&lt;P&gt;and nuy is the number of unpaired observations where only the second value (y) is present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Figure 4 – Two Correlated Normally Distributed Variables&lt;BR /&gt;Data Example4;&lt;BR /&gt;call streaminit(5678);&lt;BR /&gt;keep x y;&lt;BR /&gt;mu1=10; mu2=20; var1=4; var2=9; rho=.5;&lt;BR /&gt;do i = 1 to 1000;&lt;BR /&gt;x = rand("Normal", 0,1);&lt;BR /&gt;y = rho*x+sqrt(1-rho**2)*rand("Normal",0,1);&lt;BR /&gt;x = mu1 + sqrt(var1)*x;&lt;BR /&gt;y = mu2 + sqrt(var2)*y;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 18:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446472#M23386</guid>
      <dc:creator>collbb1</dc:creator>
      <dc:date>2018-03-17T18:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simulation  data using SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446519#M23387</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120366"&gt;@collbb1&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You will most likely have to ask a more specific question than &lt;EM&gt;How do I code my sas prog.&lt;/EM&gt; to get an answer.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Mar 2018 02:00:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446519#M23387</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-03-18T02:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Simulation  data using SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446579#M23389</link>
      <description>&lt;P&gt;Thanks, Need to know how to set up sas code to simulate dat&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compute the empirical size and power calculation using 1000 data sets and significance level of α = 0:05. Under the alternative hypotheses is varied among 0 and 1.0, and the correlation is varied among ρ = 0.2 and 0.9.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simulation1&lt;/P&gt;&lt;P&gt;Generate from Exponential distribution with scale parameter = 1; using np = 20, nux = 10, and nuy = 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where np represent the number of complete pairs where both observations (x; y) are present, nux is the number of unpaired observations where only the first value (x) is present&lt;/P&gt;&lt;P&gt;and nuy is the number of unpaired observations where only the second value (y) is present&lt;/P&gt;</description>
      <pubDate>Sun, 18 Mar 2018 16:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/446579#M23389</guid>
      <dc:creator>collbb1</dc:creator>
      <dc:date>2018-03-18T16:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simulation  data using SAS</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/447558#M23421</link>
      <description>&lt;P&gt;It sounds like you are looking for resources and sample code. Rather than answer your specific questions, here are some links that you might find useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start by reading &lt;A href="https://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way.html" target="_self"&gt;"Simulation in SAS: The slow way or the BY way"&lt;/A&gt;&amp;nbsp;to learn the general structure of simulation code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To learn how to simulate multivariate normal data in SAS, see &lt;A href="https://blogs.sas.com/content/iml/2011/01/12/sampling-from-the-multivariate-normal-distribution.html" target="_self"&gt;"Sampling from the multivariate normal distribution"&lt;/A&gt;&amp;nbsp;and &lt;A href="https://blogs.sas.com/content/iml/2013/04/10/generate-multiple-mvn-samples.html" target="_self"&gt;"How to generate multiple samples from the multivariate normal distribution in SAS"&lt;/A&gt;.&amp;nbsp; If you don't have SAS/IML, you can &lt;A href="https://blogs.sas.com/content/iml/2017/09/25/simulate-multivariate-normal-data-sas-simnormal.html" target="_self"&gt;use PROC SIMNORMAL.&lt;/A&gt;&amp;nbsp;For 2-D data or for nonnormal data, you can use the DATA step, as you are doing in your post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For power estimation using simulation, see&lt;A href="https://blogs.sas.com/content/iml/2013/05/30/simulation-power.html" target="_self"&gt; "Using simulation to estimate the power of a statistical test."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For more information, see &lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1387-2015.pdf" target="_self"&gt;"Ten Tips for Simulating Data with SAS"&lt;/A&gt;, which includes an example of using simulations to estimate power. For many more examples and details, see &lt;A href="https://support.sas.com/en/books/authors/rick-wicklin.html" target="_self"&gt;&lt;EM&gt;Simulating Data with SAS&lt;/EM&gt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 19:57:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulation-data-using-SAS/m-p/447558#M23421</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-03-21T19:57:43Z</dc:date>
    </item>
  </channel>
</rss>

