<?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: Simulating data using data step to randomly generate continuous data with non-standard distribut in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687559#M33160</link>
    <description>&lt;P&gt;Can you provide more details, or show some data and code? Are you simulating univariate data or multivariate data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you are simulating from non-normal data, you can fit the data to a flexible distribution with several parameters, then simulate from that distribution.&amp;nbsp;If you provide more details about your problem, we can probably steer you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will also be helpful to know what products you have access to. Do you have SAS/IML or SAS/ETS?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:44:09 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-09-29T15:44:09Z</dc:date>
    <item>
      <title>Simulating data using data step to randomly generate continuous data with non-standard distributions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687540#M33156</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using the rand function to simulate a data set to use for an analysis.&amp;nbsp; I am using moments from a pre-existing data set to guide the simulation (I am not able to use the original data so proc surveyselect is not an option for me), but I am having difficulty simulating the follow-up time&amp;nbsp; to match the outcome (binary event) in each treatment group because the distributions are non-standard.&amp;nbsp; I read that it's possible to use a macro to simulate data specifying the distribution parameters needed, but I am having problems putting the SAS code together successfully. I would appreciate an points in the right direction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687540#M33156</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-09-29T15:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687549#M33157</link>
      <description>&lt;P&gt;I don't have an answer to your question, but I moved it to the statistics forum.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general for anything simulation related,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;is the guru and his book is a great reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simulating data with SAS&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.amazon.ca/Simulating-Data-SAS-Rick-Wicklin/dp/1612903320" target="_blank"&gt;https://www.amazon.ca/Simulating-Data-SAS-Rick-Wicklin/dp/1612903320&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340602"&gt;@MichelleR0&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am using the rand function to simulate a data set to use for an analysis.&amp;nbsp; I am using moments from a pre-existing data set to guide the simulation (I am not able to use the original data so proc surveyselect is not an option for me), but I am having difficulty simulating the follow-up time&amp;nbsp; to match the outcome (binary event) in each treatment group because the distributions are non-standard.&amp;nbsp; I read that it's possible to use a macro to simulate data specifying the distribution parameters needed, but I am having problems putting the SAS code together successfully. I would appreciate an points in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687549#M33157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-29T15:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687555#M33158</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp; I have downloaded Chapter 2 available online for free.&amp;nbsp; This is a one time task so I was hoping to avoid having to purchase any books.&amp;nbsp; Thanks for the quick reply.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687555#M33158</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-09-29T15:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687558#M33159</link>
      <description>&lt;P&gt;Rick has written&amp;nbsp;&lt;STRONG&gt;many&lt;/STRONG&gt; articles on this topic, &lt;A href="https://blogs.sas.com/content/tag/simulation/" target="_self"&gt;which you can find on his blog here&lt;/A&gt;.&amp;nbsp; Free!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:42:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687558#M33159</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-09-29T15:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687559#M33160</link>
      <description>&lt;P&gt;Can you provide more details, or show some data and code? Are you simulating univariate data or multivariate data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you are simulating from non-normal data, you can fit the data to a flexible distribution with several parameters, then simulate from that distribution.&amp;nbsp;If you provide more details about your problem, we can probably steer you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will also be helpful to know what products you have access to. Do you have SAS/IML or SAS/ETS?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687559#M33160</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-09-29T15:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687799#M33168</link>
      <description>Thank you for your questions.&lt;BR /&gt;It is multivariate data (combination of binary, categorical, and continuous baseline variables and time to follow-up data (# of days until event) for incidence of outcome defined both as binary and cumulative).&lt;BR /&gt;&lt;BR /&gt;Below are some examples of the codes I used to simulate the baseline variables (replaced the variables with "var" - I am at a loss for what to do to simulate the number of days to event - the distributions are different by event status and treatment arm. Please let me know what additional information I could provide that would be helpful&lt;BR /&gt;&lt;BR /&gt;%Let N = 1;&lt;BR /&gt;%Let mu_var = 72.8;&lt;BR /&gt;%Let sigma_var = 10.5;&lt;BR /&gt;%Let norm_var = rand('normal',&amp;amp;mu_var,&amp;amp;sigma_var);&lt;BR /&gt;do x=1 to &amp;amp;N;&lt;BR /&gt;&lt;BR /&gt;array a [6] (0.02 0.146 0.066 0.0033 0.02 0.745);&lt;BR /&gt;&lt;BR /&gt;varnew=&amp;amp;norm_var;&lt;BR /&gt;&lt;BR /&gt;If rand("uniform") &amp;lt; 0.666 then var = 0; else var = 1;&lt;BR /&gt;var = rand("Table", of a[*]);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am using SAS 9.4. I am not familiar with SAS/IML or SAS/ETS, but if you think these platforms are necessary, I can inquire if my institute has access to them.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Sep 2020 13:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687799#M33168</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-09-30T13:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687883#M33169</link>
      <description>&lt;P&gt;I have to say I wonder about this bit of code:&lt;/P&gt;
&lt;PRE&gt;If rand("uniform") &amp;lt; 0.666 then var = 0; else var = 1;
var = rand("Table", of a[*]);&lt;/PRE&gt;
&lt;P&gt;You conditionally set var to 0/1. Then immediately set it to some integer in the range [1,6] where 0 is no longer possible. So why bother with the rand("uniform") test at all.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 17:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687883#M33169</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-30T17:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687888#M33170</link>
      <description>Thank you for your attention. I replaced the real variable names with 'var' for example only. So the first line is to generate a binary variable and the second is to generate a categorical variable with 6 levels. I hope that makes sense?</description>
      <pubDate>Wed, 30 Sep 2020 17:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/687888#M33170</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-09-30T17:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating data using data step to randomly generate continuous data with non-standard distribut</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/688508#M33186</link>
      <description>&lt;P&gt;The way to proceed is this:&lt;/P&gt;
&lt;P&gt;1. Simulate the explanatory variables.&lt;/P&gt;
&lt;P&gt;2. Simulate the response variable as a STATISTICAL MODEL of the explanatory variables. I haven't blogged about survival models, although they are discussed in Chapter 12 of my book (p.242-247). To get an idea about what it means to simulate a response from a model, start with the more familiar linear regression models:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/01/28/simulate-data-regression-categorical-continuous.html" target="_self"&gt;Linear regression models with categorical covariates&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/06/25/simulate-logistic-data.html" target="_self"&gt;Logistic regression models&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/05/06/simulate-glim.html" target="_self"&gt;Generalized linear models with link functions&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Although I haven't blogged about survival models, you can see &lt;A href="http://sas-and-r.blogspot.com/2010/03/example-730-simulate-censored-survival.html" target="_self"&gt;examples on the web&lt;/A&gt;&amp;nbsp;or you can read Gibbs and Kiernan (2020), &lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4400-2020.pdf" target="_self"&gt;"Simulating Data for Complex Linear Models."&lt;/A&gt; The survival example is p 17-18.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 13:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-data-using-data-step-to-randomly-generate-continuous/m-p/688508#M33186</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-10-02T13:35:39Z</dc:date>
    </item>
  </channel>
</rss>

