<?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: Generate survival time using Weibull distribution in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682709#M32829</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289227"&gt;@_MooMoo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My plan was to set lambda as a baseline hazard and V as decreasing rate of hazard (e.g., hazard assumed to be decreased by 10% over time). And plug in those two parameters in the equation that article suggested.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My first interpretation of this description would result in h(t)=lambda*exp(-v*t), which equals lambda for t=0 (in this sense "baseline"), and with v=-log(0.9) this function decreases by 10% per time unit, i.e., h(t+1)/h(t)=0.9 for all t. &lt;EM&gt;However&lt;/EM&gt;, this function does &lt;EM&gt;not&lt;/EM&gt; describe the hazard rate for &lt;EM&gt;any&lt;/EM&gt; distribution of survival times because S(t)=exp(lambda/v*(exp(-v*t)-1)) does not go to zero if t goes to infinity, hence is not a survival function. So,&amp;nbsp;&lt;SPAN&gt;you need to define a hazard function h(t)=... with a precise formula (or characterize it unambiguously by mathematical criteria) which leads to a valid survival function S.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Sep 2020 16:52:36 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-09-09T16:52:36Z</dc:date>
    <item>
      <title>Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682509#M32807</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to generate survival time using Weibull distribution for simulation study. I got the survival time equation for Weibull distribution from Bender:&amp;nbsp;&lt;A href="https://epub.ub.uni-muenchen.de/1716/1/paper_338.pdf" target="_blank"&gt;https://epub.ub.uni-muenchen.de/1716/1/paper_338.pdf&lt;/A&gt;. That is,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_MooMoo_2-1599628457722.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49154i772694BE8DDE6B7A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_MooMoo_2-1599628457722.png" alt="_MooMoo_2-1599628457722.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am trying to confirm survival time calculated from above equation gives the somewhat similar result using RAND('WEIBULL') procedure and the sample SAS code I wrote is below. Here, I am assuming B effect is null so that exp(B'x)=1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_MooMoo_0-1599628242520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49151i9DBAF9EEF998A0A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="_MooMoo_0-1599628242520.png" alt="_MooMoo_0-1599628242520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I am correct, both X and W would give somewhat similar answer. And when I looked at the mean of X and W value, they are quite different. Below is the output...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="_MooMoo_1-1599628357818.png" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49153iA528D226FB069642/image-dimensions/585x79?v=v2" width="585" height="79" role="button" title="_MooMoo_1-1599628357818.png" alt="_MooMoo_1-1599628357818.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am unsure why this is happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any kinds of advice are welcomed! Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 05:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682509#M32807</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-09T05:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682578#M32811</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289227"&gt;@_MooMoo&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason for the discrepancy is that the formula for the Weibull PDF implemented in the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p0fpeei0opypg8n1b06qe4r040lv.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n19580hvf4btekn18x8fi9wts8l2" target="_blank" rel="noopener"&gt;RAND function&lt;/A&gt; uses a different parameterization than the article. Your definition of W should read&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4"&gt;W=rand('WEIBULL',0.9,&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;0.035&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;**(-1/0.9)&lt;/FONT&gt;&lt;/STRONG&gt;);&lt;/FONT&gt;&lt;/PRE&gt;
&lt;P&gt;to take this into account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(As you noted correctly, the minus sign in the last term of the article's formula must be inside the parentheses. Also the term after the first equals sign is incorrect: The factor 1/&lt;FONT size="4"&gt;&lt;FONT face="symbol"&gt;l&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;must be inside the square brackets.)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 11:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682578#M32811</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-09T11:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682633#M32820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aha, that explains why. Thank you for your clarification!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another question... If I want to generate survival time that baseline hazard rate is 0.035 and its monotone decrease rate is at 0.1, then can I set the scale parameter (lambda) as 0.035 and shape parameter (v) as 1-0.1=0.9 and plug those numbers into Bender's equation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The point I am missing is that how to set parameters in Weibull distribution and which procedure (Bender's equation or RAND function) to use in order to generate survival time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 13:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682633#M32820</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-09T13:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682659#M32824</link>
      <description>&lt;P&gt;The hazard function of a Weibull random variable with scale parameter lambda and shape parameter v (using the article's parameterization) is h(t)=v*lambda*t**(v-1). As you can see, with 0&amp;lt;v&amp;lt;1 the hazard rate goes to infinity for t → 0. In particular, with lambda=0.035 and v=0.9, it's monotonically decreasing and drops below 0.035 at t=0.3486784...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want a different hazard function, maybe one with h(0)=0.035, you need to define it and then go on and derive the survival function from that (by integration and exponentiation). As with the Weibull distribution chances are that we can simulate suitable survival times using SAS functions and don't need the technique suggested in the article.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 14:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682659#M32824</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-09T14:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682665#M32825</link>
      <description>&lt;P&gt;Thank you for your response once again&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain further how can we use SAS functions to simulate suitable survival time?&amp;nbsp;&lt;/P&gt;&lt;P&gt;My plan was to set lambda as a baseline hazard and V as decreasing rate of hazard (e.g., hazard assumed to be decreased by 10% over time). And plug in those two parameters in the equation that article suggested.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 15:04:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682665#M32825</guid>
      <dc:creator>_MooMoo</dc:creator>
      <dc:date>2020-09-09T15:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682709#M32829</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289227"&gt;@_MooMoo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My plan was to set lambda as a baseline hazard and V as decreasing rate of hazard (e.g., hazard assumed to be decreased by 10% over time). And plug in those two parameters in the equation that article suggested.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;My first interpretation of this description would result in h(t)=lambda*exp(-v*t), which equals lambda for t=0 (in this sense "baseline"), and with v=-log(0.9) this function decreases by 10% per time unit, i.e., h(t+1)/h(t)=0.9 for all t. &lt;EM&gt;However&lt;/EM&gt;, this function does &lt;EM&gt;not&lt;/EM&gt; describe the hazard rate for &lt;EM&gt;any&lt;/EM&gt; distribution of survival times because S(t)=exp(lambda/v*(exp(-v*t)-1)) does not go to zero if t goes to infinity, hence is not a survival function. So,&amp;nbsp;&lt;SPAN&gt;you need to define a hazard function h(t)=... with a precise formula (or characterize it unambiguously by mathematical criteria) which leads to a valid survival function S.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 16:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/682709#M32829</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-09-09T16:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706738#M34244</link>
      <description>&lt;P&gt;May I ask how you got the parameter values 0.9 and 0.035?&amp;nbsp; I am trying to simulate survival time (time to first event, in days)&amp;nbsp; but I am unclear what parameters to specify.&amp;nbsp; Any guidance would help.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 18:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706738#M34244</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-12-17T18:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706772#M34245</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/340602"&gt;@MichelleR0&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These values were from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289227"&gt;@_MooMoo&lt;/a&gt;'s initial post. I don't know more about them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a realistic simulation I would probably look at studies or books from the same subject area to find out what kind of parametric models are commonly used there. Let's say, most of them use the Weibull distribution. Then I would think of suitable characteristics, e.g., the expected lifetime or quantiles of the distribution (typically as many as there are parameters to be determined: two in the Weibull case), set them to realistic values and solve the resulting equations for the distribution (here: Weibull) parameters. From the simulated data using these parameters I would compute the same characteristics and expect that, on average, they would tend to be close to the arbitrary values that I started with.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 19:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706772#M34245</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-12-17T19:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706776#M34246</link>
      <description>Thank you for your reply. I simulating data informed by data from a clinical trial. I cannot use the real data but I can based the simulated data on the real parameters of the dataset. I've read the SAS documentation on data simulation using rand function and have done so successfully for continuous variables with normal distribution and binary and categorical data. However, I cannot figure out how to determine what distribution the time to event data is and when I searched, it described that survival data falls under a log-weibull distribution.</description>
      <pubDate>Thu, 17 Dec 2020 20:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706776#M34246</guid>
      <dc:creator>MichelleR0</dc:creator>
      <dc:date>2020-12-17T20:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Generate survival time using Weibull distribution</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706803#M34247</link>
      <description>&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;(...) it described that survival data falls under a log-weibull distribution.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, according to&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Gumbel_distribution" target="_blank"&gt;https://en.wikipedia.org/wiki/Gumbel_distribution&lt;/A&gt;, the survival times can be simulated using the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0fpeei0opypg8n1b06qe4r040lv.htm&amp;amp;locale=en#p1a6sal985zec5n1n4u8g3ssci94" target="_blank" rel="noopener"&gt;RAND('GUMBEL',&amp;nbsp;&lt;FONT face="symbol"&gt;m&lt;/FONT&gt;,&amp;nbsp;&lt;FONT face="symbol"&gt;s&lt;/FONT&gt;)&lt;/A&gt; function and explicit formulas exist for several characteristics including mean, median and standard deviation. Hence, the two unknown parameters &lt;FONT face="symbol"&gt;m&lt;/FONT&gt; and &lt;FONT face="symbol"&gt;s&lt;/FONT&gt;&amp;nbsp;can be determined as outlined in my previous post. For example, starting with suitable values for mean and median, the parameters would be simply obtained as the solution of two linear equations.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2020 21:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Generate-survival-time-using-Weibull-distribution/m-p/706803#M34247</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-12-17T21:45:17Z</dc:date>
    </item>
  </channel>
</rss>

