<?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: SAS novice attempting to work with survival analysis in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656578#M196893</link>
    <description>&lt;PRE&gt;data survData;&lt;BR /&gt;  lambdat = 0.02; *baseline hazard;&lt;BR /&gt;  lambdac = 0.04; *censoring hazard;&lt;BR /&gt;  do i = 1 to 100;&lt;BR /&gt;    t = RANEXP(12345)/lambdat;    * time of event;&lt;BR /&gt;    c = RANEXP(67890)/lambdac;    * time of censoring;&lt;BR /&gt;    time = min(t, c);    * which happens first?;&lt;BR /&gt;    censored = (c &amp;lt; t);	 * censored when the censoring hapapened before event;&lt;BR /&gt;    output;&lt;BR /&gt;  end;&lt;BR /&gt;  drop i lambda:;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;proc freq data=SurvData;&lt;BR /&gt;tables censored ;&lt;BR /&gt;run;&lt;BR /&gt;proc univariate data=survData;&lt;BR /&gt;histogram T C;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Above is the sample code that I have and below are a few questions. This is the same code &amp;amp; questions from earlier, but now they are copy and pasted instead of images.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;simulate a survival data with the following specifications:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Event time T follows an exponential distribution with a mean of 40&lt;/LI&gt;&lt;LI&gt;Censoring time Tc follows an exponential distribution with a mean of 25&lt;/LI&gt;&lt;LI&gt;Generate 500 observations, with censoring flag indicating whether censoring happened before events.&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Wed, 10 Jun 2020 21:29:48 GMT</pubDate>
    <dc:creator>Buchholz91</dc:creator>
    <dc:date>2020-06-10T21:29:48Z</dc:date>
    <item>
      <title>SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656492#M196836</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buchholz91_0-1591810417218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42149i760F09CE1DCF90F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Buchholz91_0-1591810417218.png" alt="Buchholz91_0-1591810417218.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the sample code above, how do I simulate survival data using certain specifications such as:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buchholz91_1-1591810503864.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42150i44559F496312DF39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Buchholz91_1-1591810503864.png" alt="Buchholz91_1-1591810503864.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My SAS skills are very rusty as I have not used it in over a year now. Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 17:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656492#M196836</guid>
      <dc:creator>Buchholz91</dc:creator>
      <dc:date>2020-06-10T17:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656510#M196844</link>
      <description>&lt;P&gt;Please do not post images of your code or question. It makes it harder to comment and modify it, unless I type it all out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding 1/2, line 5/6 of the code controls that. Look up the exponential randexp function to see how to set it with a specified mean. You probably want to switch to using the RAND() function instead which allows you to do this more easily.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding 3, look at line 4 of the code. What happens if you run the code as is. And then what happens when you change it and run it again?&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/266870"&gt;@Buchholz91&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buchholz91_0-1591810417218.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42149i760F09CE1DCF90F0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Buchholz91_0-1591810417218.png" alt="Buchholz91_0-1591810417218.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the sample code above, how do I simulate survival data using certain specifications such as:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Buchholz91_1-1591810503864.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/42150i44559F496312DF39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Buchholz91_1-1591810503864.png" alt="Buchholz91_1-1591810503864.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My SAS skills are very rusty as I have not used it in over a year now. Any help would be greatly appreciated.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&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;</description>
      <pubDate>Wed, 10 Jun 2020 18:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656510#M196844</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-10T18:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656578#M196893</link>
      <description>&lt;PRE&gt;data survData;&lt;BR /&gt;  lambdat = 0.02; *baseline hazard;&lt;BR /&gt;  lambdac = 0.04; *censoring hazard;&lt;BR /&gt;  do i = 1 to 100;&lt;BR /&gt;    t = RANEXP(12345)/lambdat;    * time of event;&lt;BR /&gt;    c = RANEXP(67890)/lambdac;    * time of censoring;&lt;BR /&gt;    time = min(t, c);    * which happens first?;&lt;BR /&gt;    censored = (c &amp;lt; t);	 * censored when the censoring hapapened before event;&lt;BR /&gt;    output;&lt;BR /&gt;  end;&lt;BR /&gt;  drop i lambda:;&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;proc freq data=SurvData;&lt;BR /&gt;tables censored ;&lt;BR /&gt;run;&lt;BR /&gt;proc univariate data=survData;&lt;BR /&gt;histogram T C;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Above is the sample code that I have and below are a few questions. This is the same code &amp;amp; questions from earlier, but now they are copy and pasted instead of images.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;simulate a survival data with the following specifications:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Event time T follows an exponential distribution with a mean of 40&lt;/LI&gt;&lt;LI&gt;Censoring time Tc follows an exponential distribution with a mean of 25&lt;/LI&gt;&lt;LI&gt;Generate 500 observations, with censoring flag indicating whether censoring happened before events.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 10 Jun 2020 21:29:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656578#M196893</guid>
      <dc:creator>Buchholz91</dc:creator>
      <dc:date>2020-06-10T21:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656586#M196901</link>
      <description>Did the suggestions not work for you? They should have answered your question, but the code posted just looks like your original code unless I'm missing something.</description>
      <pubDate>Wed, 10 Jun 2020 21:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656586#M196901</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-10T21:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656593#M196908</link>
      <description>I'm still in the process of trying to apply the suggestions that you made.&lt;BR /&gt;Currently trying to reintroduce myself to SAS after some time off and applying it in this way which I have not done before.&lt;BR /&gt;&lt;BR /&gt;The code shown is still the same as before.&lt;BR /&gt;I'm assuming that I change the i = 1 to 100 to become i = 1 to 500 since I want to generate 500 observations.&lt;BR /&gt;Still trying to figure out how to specify a mean of 40.&lt;BR /&gt;I see that the Exponential Distribution is variable = RAND('Exponential', &amp;lt;sigma&amp;gt;).</description>
      <pubDate>Wed, 10 Jun 2020 22:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656593#M196908</guid>
      <dc:creator>Buchholz91</dc:creator>
      <dc:date>2020-06-10T22:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS novice attempting to work with survival analysis</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656621#M196932</link>
      <description>&lt;P&gt;What's the expected value for an exponential distribution in relation to your parameter? That's a statistics question, not a programming question &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 23:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-novice-attempting-to-work-with-survival-analysis/m-p/656621#M196932</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-10T23:11:40Z</dc:date>
    </item>
  </channel>
</rss>

