<?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: Weibull parameters in the RAND function not the same as estimates from PROC LIFEREG in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745149#M36271</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/383846"&gt;@Arick&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's easier to estimate the Weibull parameters with PROC UNIVARIATE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ParameterEstimates;
proc univariate data=X;
var T;
histogram / weibull;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;The UNIVARIATE Procedure
Fitted Weibull Distribution for T

Parameters for Weibull Distribution

Parameter   Symbol   Estimate

Threshold   Theta           0
&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Scale       Sigma    4.000363
Shape       C        1.604449&lt;/STRONG&gt;&lt;/FONT&gt;
Mean                 3.585712
Std Dev              2.288696&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&amp;nbsp;It appears that your &lt;EM&gt;censoring scheme&lt;/EM&gt; impairs the estimation of the Weibull scale parameter by PROC LIFEREG. Without censoring, i.e., with &lt;FONT face="courier new,courier"&gt;Event=1&lt;/FONT&gt; it works:&lt;/P&gt;
&lt;PRE&gt;          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr &amp;gt; ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     &amp;lt;.0001
TRT            0   0.0000    .        .        .         .        .
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229&lt;/PRE&gt;
&lt;P&gt;Note that the &lt;EM&gt;Weibull&lt;/EM&gt; scale estimate is &lt;FONT face="courier new,courier"&gt;exp(Intercept)≈4.0239&lt;/FONT&gt;, whereas the "&lt;FONT face="courier new,courier"&gt;Scale&lt;/FONT&gt;" in the output (&lt;FONT face="symbol"&gt;s&lt;/FONT&gt; in the documentation) equals &lt;FONT face="courier new,courier"&gt;1/(Weibull Shape)&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify this by omitting the covariate in the MODEL statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc lifereg data=X;
model T*Event(0)= / dist=Weibull;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr &amp;gt; ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     &amp;lt;.0001
Scale          1   0.6257   0.0049   0.6162   0.6353
&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Weibull Scale  1   4.0239   0.0265   3.9722   4.0761
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jun 2021 21:30:44 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2021-06-02T21:30:44Z</dc:date>
    <item>
      <title>Weibull parameters in the RAND function not the same as estimates from PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745067#M36259</link>
      <description>&lt;P&gt;Why doesn't PROC LIFREG Weibull parameter estimates match those that I used in the RAND function?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Below is SAS code that generates subject survival data from a Weibull distribution using the RAND function. I then analyze the survival data with PROC LIFEREG, which outputs an estimate of the shape and scale parameters. Although the estimated shape parameter from PROC LIFEREG is approximately the same as used to generate the subject data, the scale parameter is not even close. So what exactly is “scale” estimate from PROC LIFEREG? Is there a way to estimate the Weibull parameters from PROC LIFEREG (or another SAS procedure)? Any help is appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data X;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call streaminit(2468);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; a=1.6; *Shape;&lt;/P&gt;&lt;P&gt;&amp;nbsp; b=4.0; *Scale;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; TRT=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do Subject=1 to 10000;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; T=rand("Weibull", a, b);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Event=(rand("Uniform")&amp;lt;0.20);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc lifereg data=X;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model T*Event(0)=TRT / dist=Weibull;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 01:35:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745067#M36259</guid>
      <dc:creator>Arick</dc:creator>
      <dc:date>2021-06-02T01:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Weibull parameters in the RAND function not the same as estimates from PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745149#M36271</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/383846"&gt;@Arick&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's easier to estimate the Weibull parameters with PROC UNIVARIATE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ParameterEstimates;
proc univariate data=X;
var T;
histogram / weibull;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;The UNIVARIATE Procedure
Fitted Weibull Distribution for T

Parameters for Weibull Distribution

Parameter   Symbol   Estimate

Threshold   Theta           0
&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Scale       Sigma    4.000363
Shape       C        1.604449&lt;/STRONG&gt;&lt;/FONT&gt;
Mean                 3.585712
Std Dev              2.288696&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;EDIT:&lt;/STRONG&gt;&amp;nbsp;It appears that your &lt;EM&gt;censoring scheme&lt;/EM&gt; impairs the estimation of the Weibull scale parameter by PROC LIFEREG. Without censoring, i.e., with &lt;FONT face="courier new,courier"&gt;Event=1&lt;/FONT&gt; it works:&lt;/P&gt;
&lt;PRE&gt;          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr &amp;gt; ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     &amp;lt;.0001
TRT            0   0.0000    .        .        .         .        .
Scale          1   0.6257   0.0049   0.6162   0.6353
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229&lt;/PRE&gt;
&lt;P&gt;Note that the &lt;EM&gt;Weibull&lt;/EM&gt; scale estimate is &lt;FONT face="courier new,courier"&gt;exp(Intercept)≈4.0239&lt;/FONT&gt;, whereas the "&lt;FONT face="courier new,courier"&gt;Scale&lt;/FONT&gt;" in the output (&lt;FONT face="symbol"&gt;s&lt;/FONT&gt; in the documentation) equals &lt;FONT face="courier new,courier"&gt;1/(Weibull Shape)&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify this by omitting the covariate in the MODEL statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc lifereg data=X;
model T*Event(0)= / dist=Weibull;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;          Analysis of Maximum Likelihood Parameter Estimates

                          Standard   95% Confidence     Chi-
Parameter     DF Estimate    Error       Limits       Square Pr &amp;gt; ChiSq

Intercept      1   1.3922   0.0066   1.3793   1.4052 44678.9     &amp;lt;.0001
Scale          1   0.6257   0.0049   0.6162   0.6353
&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Weibull Scale  1   4.0239   0.0265   3.9722   4.0761
Weibull Shape  1   1.5983   0.0125   1.5740   1.6229&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 21:30:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745149#M36271</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-06-02T21:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Weibull parameters in the RAND function not the same as estimates from PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745373#M36311</link>
      <description>&lt;P&gt;Thank you so much for the easy and thorough explanation, FreelanceReinhard! This makes perfect sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 01:20:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weibull-parameters-in-the-RAND-function-not-the-same-as/m-p/745373#M36311</guid>
      <dc:creator>Arick</dc:creator>
      <dc:date>2021-06-03T01:20:27Z</dc:date>
    </item>
  </channel>
</rss>

