<?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: Simulate data for PHREG Cox Model in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/703893#M34032</link>
    <description>&lt;P&gt;I'm away from my reference materials (in my office), but I believe the answer is that you can run PROC LIFEREG and use the DIST=WEIBULL option to get these values. One of them (possibly lambdat) is estimated by exp(Intercept) and the other (lambdac?) by 1/shape (look for "Weibull Shape" in the output. If 1/shape doesn't work, try just shape.... it depends on how you parameterize the Weibull survival model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
    <pubDate>Sat, 05 Dec 2020 23:25:38 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-12-05T23:25:38Z</dc:date>
    <item>
      <title>Simulate data for PHREG Cox Model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/703854#M34031</link>
      <description>&lt;P&gt;I am trying to do a simple simulation where I create several different replication datasets (replicating a &lt;U&gt;&lt;STRONG&gt;known dataset&lt;/STRONG&gt;&lt;/U&gt; I have). &amp;nbsp;&amp;nbsp;I'm using SAS 9.4 and here is the code I'm trying to use for simulation (found on: &lt;A href="http://sas-and-r.blogspot.com/2010/03/example-730-simulate-censored-survival.html" target="_blank"&gt;http://sas-and-r.blogspot.com/2010/03/example-730-simulate-censored-survival.html&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data simcox;&lt;BR /&gt;  &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;beta1 = 2&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;BR /&gt;  &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;lambdat = 0.002&lt;/STRONG&gt;&lt;/FONT&gt;; *baseline hazard;&lt;BR /&gt;  &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;lambdac = 0.004&lt;/FONT&gt;&lt;/STRONG&gt;; *censoring hazard;&lt;BR /&gt;  do i = 1 to 1000;&lt;BR /&gt;    x1 = rand("Bernoulli",0.5);&lt;BR /&gt;    linpred = exp(-beta1*x1);&lt;BR /&gt;    t = rand("WEIBULL", 1, lambdaT * linpred);&lt;BR /&gt;    * time of event;&lt;BR /&gt;    c = rand("WEIBULL", 1, lambdaC);&lt;BR /&gt;           * time of censoring;&lt;BR /&gt;    time = min(t, c);    * which came first?;&lt;BR /&gt;    censored = (c lt t);&lt;BR /&gt;    output;&lt;BR /&gt;  end;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having trouble figuring out the values to use (&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;bold in red&lt;/STRONG&gt;&lt;/FONT&gt;). &amp;nbsp;How do I know what to specify beta and lambdas as? Is there a way to find estimates of these values by running a Cox model on &lt;U&gt;&lt;STRONG&gt;my known data&lt;/STRONG&gt;&lt;/U&gt;, then using these estimated values of beta and lambdas for my simulation? If so, please explain in detail how to find these.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 15:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/703854#M34031</guid>
      <dc:creator>openatom</dc:creator>
      <dc:date>2020-12-05T15:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate data for PHREG Cox Model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/703893#M34032</link>
      <description>&lt;P&gt;I'm away from my reference materials (in my office), but I believe the answer is that you can run PROC LIFEREG and use the DIST=WEIBULL option to get these values. One of them (possibly lambdat) is estimated by exp(Intercept) and the other (lambdac?) by 1/shape (look for "Weibull Shape" in the output. If 1/shape doesn't work, try just shape.... it depends on how you parameterize the Weibull survival model.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 23:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/703893#M34032</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-12-05T23:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate data for PHREG Cox Model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/704417#M34062</link>
      <description>&lt;P&gt;Thank you, this is helpful. &amp;nbsp;I noticed that LIFEREG will also output something it calls "shape" and "scale," but they appear to be inverses and not directly related to the Weibull PDF in SAS (&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=fedsqlref&amp;amp;docsetTarget=p1q5wrhpvsgt1pn1dswx95zo2i4p.htm&amp;amp;locale=en"&gt;https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=fedsqlref&amp;amp;docsetTarget=p1q5wrhpvsgt1pn1dswx95zo2i4p.htm&amp;amp;locale=en&lt;/A&gt;) where a=shape and lambda=scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In LIFEREG, I assume that the "scale" is lambda?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(shape) a = exp(Intercept) ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(scale) lambda = lambdac ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this seem correct?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 14:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/704417#M34062</guid>
      <dc:creator>openatom</dc:creator>
      <dc:date>2020-12-08T14:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Simulate data for PHREG Cox Model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/704427#M34065</link>
      <description>&lt;P&gt;Yes. I thought it was lambdac = 1/lambda, but I could be wrong. As I said, it depends on the parameterization of the distribution. Some use scale and others use rate (=1/scale).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your goal is a simulation, it should be easy to check. In your simulation, set the scale parameter in your simulation to 4 and generate a large data set (like, 5,000 observations). LIFEREG will either report scale=4 or scale=0.25. If it reports 4, then the formulas in your simulation match those in the PROC. If it reports 0.25, then in your simulation you need to replace the scale parameter by (1/scale) in order to match the parameterization in the PROC. Then rerun to make sure.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 15:46:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Simulate-data-for-PHREG-Cox-Model/m-p/704427#M34065</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-12-08T15:46:59Z</dc:date>
    </item>
  </channel>
</rss>

