<?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 Simulating survival time from Weibull dist in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/755554#M36792</link>
    <description>&lt;P&gt;I need some help with a problem related to a previous post. Here's the situation:&lt;/P&gt;&lt;P&gt;I have a huge dataset&amp;nbsp;(N=10000) that contains simulated event times (with right censored data) and I would like to generate a similar simulated dataset by using the estimated Weibull parameters&amp;nbsp;from that dataset. First I ran PROC LIFEREG with the following&amp;nbsp;model statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODEL day*cnsr(1)= / dist=Weibull;&lt;/P&gt;&lt;P&gt;This generated the following ML estimates:&lt;/P&gt;&lt;P&gt;Intercept=7.7, Scale=4.5, Weibull_Scale=2300, Weibull_Shape=0.22.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, to&amp;nbsp;simulate time values in a new&amp;nbsp;huge dataset, I used the SAS statements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call streaminit(72131);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day=rand("Weibull", 0.22, 2300);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;But the distribution of times on this new dataset&amp;nbsp;is very different.&amp;nbsp;For example, the proportion with day&amp;lt;=365 in this new dataset is 48%, as compared to 58% in the original dataset. This discrepancy persists, even if I change the randomization seed or increase the number of simulated records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found the documentation for PROC LIFEREG and the RAND function&amp;nbsp;too confusing to help me reconcile this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can offer me&amp;nbsp;any help, I&amp;nbsp;would greatly appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jul 2021 04:54:31 GMT</pubDate>
    <dc:creator>Arick</dc:creator>
    <dc:date>2021-07-21T04:54:31Z</dc:date>
    <item>
      <title>Simulating survival time from Weibull dist</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/755554#M36792</link>
      <description>&lt;P&gt;I need some help with a problem related to a previous post. Here's the situation:&lt;/P&gt;&lt;P&gt;I have a huge dataset&amp;nbsp;(N=10000) that contains simulated event times (with right censored data) and I would like to generate a similar simulated dataset by using the estimated Weibull parameters&amp;nbsp;from that dataset. First I ran PROC LIFEREG with the following&amp;nbsp;model statement:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODEL day*cnsr(1)= / dist=Weibull;&lt;/P&gt;&lt;P&gt;This generated the following ML estimates:&lt;/P&gt;&lt;P&gt;Intercept=7.7, Scale=4.5, Weibull_Scale=2300, Weibull_Shape=0.22.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then, to&amp;nbsp;simulate time values in a new&amp;nbsp;huge dataset, I used the SAS statements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call streaminit(72131);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day=rand("Weibull", 0.22, 2300);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;But the distribution of times on this new dataset&amp;nbsp;is very different.&amp;nbsp;For example, the proportion with day&amp;lt;=365 in this new dataset is 48%, as compared to 58% in the original dataset. This discrepancy persists, even if I change the randomization seed or increase the number of simulated records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I found the documentation for PROC LIFEREG and the RAND function&amp;nbsp;too confusing to help me reconcile this problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If anyone can offer me&amp;nbsp;any help, I&amp;nbsp;would greatly appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 04:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/755554#M36792</guid>
      <dc:creator>Arick</dc:creator>
      <dc:date>2021-07-21T04:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating survival time from Weibull dist</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/755559#M36793</link>
      <description>&lt;P&gt;How did you incorporate the Intercept term?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a minimum you should show the entire code of from Proc Lifereg as well as how you applied that result to your data.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2021 05:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/755559#M36793</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-21T05:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating survival time from Weibull dist</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/756154#M36818</link>
      <description>&lt;P&gt;Dear ballardw,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I didn't do anything with the intercept. Apologies for the ambiguity of my previous post. The SAS code attached (with comments) should provide clarity on what I am struggling to understand. In a nutshell, the PROC LIFEREG estimates for Weibull shape and scale do not seem consistent with those from PROC UNIVARIATE, which can be used to generate simulated data using the rand('Weibull', a, b) function. In other words, the Weibull parameter estimates from PROC LIFEREG don't seem to be of any use. But I suspect that I am misunderstanding or misusing the LIFEREG estimates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Please note that the attached code is different that I used before, so please ignore the estimates that I quoted in my previous post. Indeed, I think you can ignore that post entirely.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;U&gt;Summary of attached SAS code&lt;/U&gt;: I generate a dataset, Q0, with given Weibull shape and scale. I verify that the time distribution is what I wanted. I calculated the Weibull shape and scale from Q0 in 2 ways: PROC UNIVARIATE and PROC LIFEREG. I use the latter estimates to generate a new dataset to see if the time distribution is consistent with Q0.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 09:40:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/756154#M36818</guid>
      <dc:creator>Arick</dc:creator>
      <dc:date>2021-07-23T09:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simulating survival time from Weibull dist</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/756346#M36833</link>
      <description>&lt;P&gt;I&amp;nbsp;have been informed&amp;nbsp;that I must remove the censor term from my PROC LIFEREG statements. i.e., use&lt;/P&gt;&lt;P&gt;model Time = / Weibull;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; instead of&lt;/P&gt;&lt;P&gt;model Time*Cnsr(1) = / Weibull;&lt;/P&gt;&lt;P&gt;Although this does seem&amp;nbsp;to work (i.e. it gives same estimates as PROC UNIVARIATE), it does surprise me that the doesn't automatically account for the censoring. At any rate, my mystery solved.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jul 2021 01:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulating-survival-time-from-Weibull-dist/m-p/756346#M36833</guid>
      <dc:creator>Arick</dc:creator>
      <dc:date>2021-07-24T01:01:15Z</dc:date>
    </item>
  </channel>
</rss>

