<?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: The Weibull accelerated failure time model parameters estimated but how to use them for predicti in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927694#M46169</link>
    <description>&lt;P&gt;What you &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;CANNOT do&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;use PROC SCORE&lt;/LI&gt;
&lt;LI&gt;use the STORE statement (PROC LIFEREG) to store the fitted model in an item store. Then use PROC PLM to create predictions on new data. I think the PLM scoring possibility is disabled for models coming from LIFEREG. If not, don't trust the predictions (they are wrong).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What you &lt;FONT color="#00FF00"&gt;&lt;STRONG&gt;CAN do&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;specify a missing value for the response variable for each observation that you want to score but not use for fitting the model.&amp;nbsp;&amp;nbsp;Since such observations are not used to fit the model, it does not matter whether those observations contain a non-zero weight.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;specify a weight of 0 for observations that you want score but not use for fitting the model. (PROC LIFEREG has a WEIGHT statement)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;I agree it's not optimal since every time you want to score another set of data ... you need to fit your model again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;See also this blog:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The missing value trick for scoring a regression model &lt;BR /&gt;By Rick Wicklin on The DO Loop February 17, 2014&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The below blog does not contain a solution to your question, but I want you to know about it anyway:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Interpret estimates for a Weibull regression model in SAS &lt;BR /&gt;By Rick Wicklin on The DO Loop October 27, 2021&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2021/10/27/weibull-regression-model-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2021/10/27/weibull-regression-model-sas.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2024 14:05:54 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2024-05-09T14:05:54Z</dc:date>
    <item>
      <title>The Weibull accelerated failure time model parameters estimated but how to use them for predicting?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927680#M46167</link>
      <description>&lt;P&gt;Hello, everyone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I managed to estimate the parameters for a Weibull accelerated failure time model from the PROC LIFEREG procedure. I have the point and interval estimations for predictor coefficients. In addition, I have the estimations for the Weibull shape parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After I get these estimations, I would like to simulate the cumulative incidence curve/survival curve. I know I should use the point estimation of these coefficients and the shape parameter in the prediction model. But I am not sure whether to use the interval estimation of coefficients, or the shape parameter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You answer is much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 11:50:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927680#M46167</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-05-09T11:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: The Weibull accelerated failure time model parameters estimated but how to use them for predicti</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927690#M46168</link>
      <description>Tom: You can get the survival probability in this manner:  use the OUTPUT statement to request the CDF= keyword and post-process this as Survival = 1 - CDF in a subsequent DATA step.  I'm not sure how to get a cumulative incidence value since PROC LIFEREG doesn't model any competing risks scenario for which the CIF is appropriate.&lt;BR /&gt;</description>
      <pubDate>Thu, 09 May 2024 13:56:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927690#M46168</guid>
      <dc:creator>OsoGris</dc:creator>
      <dc:date>2024-05-09T13:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: The Weibull accelerated failure time model parameters estimated but how to use them for predicti</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927694#M46169</link>
      <description>&lt;P&gt;What you &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;CANNOT do&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;UL class="lia-list-style-type-square"&gt;
&lt;LI&gt;use PROC SCORE&lt;/LI&gt;
&lt;LI&gt;use the STORE statement (PROC LIFEREG) to store the fitted model in an item store. Then use PROC PLM to create predictions on new data. I think the PLM scoring possibility is disabled for models coming from LIFEREG. If not, don't trust the predictions (they are wrong).&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;What you &lt;FONT color="#00FF00"&gt;&lt;STRONG&gt;CAN do&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN&gt;specify a missing value for the response variable for each observation that you want to score but not use for fitting the model.&amp;nbsp;&amp;nbsp;Since such observations are not used to fit the model, it does not matter whether those observations contain a non-zero weight.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;specify a weight of 0 for observations that you want score but not use for fitting the model. (PROC LIFEREG has a WEIGHT statement)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;I agree it's not optimal since every time you want to score another set of data ... you need to fit your model again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;See also this blog:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The missing value trick for scoring a regression model &lt;BR /&gt;By Rick Wicklin on The DO Loop February 17, 2014&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2014/02/17/the-missing-value-trick-for-scoring-a-regression-model.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The below blog does not contain a solution to your question, but I want you to know about it anyway:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Interpret estimates for a Weibull regression model in SAS &lt;BR /&gt;By Rick Wicklin on The DO Loop October 27, 2021&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2021/10/27/weibull-regression-model-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2021/10/27/weibull-regression-model-sas.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 14:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927694#M46169</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-09T14:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: The Weibull accelerated failure time model parameters estimated but how to use them for predicti</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927712#M46170</link>
      <description>&lt;P&gt;You can also use this formula to get predictions on new data (use a data step where t_value is your input-&lt;EM&gt;time&lt;/EM&gt;-value to be scored):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;predicted_target = 1/(1+exp(-((t_value - intercept) / scale_parameter)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please verify by scoring the training data and comparing with proc lifereg predictions.&lt;/P&gt;
&lt;P&gt;I won't put my hand up to it, but I think that's the right formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 14:27:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927712#M46170</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2024-05-09T14:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: The Weibull accelerated failure time model parameters estimated but how to use them for predicti</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927819#M46181</link>
      <description>&lt;P&gt;Hi, Gris&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for the suggestion. I see, and I think I should paste part of my code below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After the PROC LIFEREG procedure, I got the estimation of parameters. Then, I used PROC DATA to simulate projections before I used these data to plot the CDF.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The shape parameter is rho, along with its confidence interval of rho_l and rho_u.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see in the PROC DATA procedure, I did not use the confidence interval of model coefficients to simulate, instead, I only used that of the shape parameter. I don't know if this is the standard of art, or if I should have used the confidence interval of coefficients too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data hazard;
	do t = 0 to 14 by 0.01; /* Adjust the range and increment as appropriate for your data */
        lambda = exp( - 0.0105*65 + 0.49*1.75 + 0.04*45 + 0.29*0 + 0.70*0 + 0.29*1); /* Replace `intercept` with your actual intercept value */
        rho = 2.3531; /* Shape parameter from PROC LIFEREG output */
        rho_l = 2.0850;
        rho_u = 2.6557;
        h_t = rho/lambda * ((t/lambda)**(rho - 1)); /* Calculate hazard */
       loght = log(rho/lambda * ((t/lambda)**(rho - 1)));
       lower_h_t = rho_u/lambda * ((t/lambda)**(rho_u - 1)); 
       upper_h_t = rho_l/lambda * ((t/lambda)**(rho_l - 1));
       suriv = 1 - exp(-(t/lambda) ** rho);
       suriv_u = 1 - exp(-(t/lambda) ** rho_u);
       suriv_l = 1 - exp(-(t/lambda) ** rho_l);
        output;
    end;
    *drop lambda rho rho_l rho_u;
run;

data hazard2;
	do t = 0 to 14 by 0.01; /* Adjust the range and increment as appropriate for your data */
        lambda = exp( - 0.0105*65 + 0.49*1.75 + 0.04*45 + 0.29*0 + 0.70*0 + 0.29*0); /* Replace `intercept` with your actual intercept value */
        rho = 2.3531; /* Shape parameter from PROC LIFEREG output */
        rho_l = 2.0850;
        rho_u = 2.6557;
        h_t = rho/lambda * ((t/lambda)**(rho - 1)); /* Calculate hazard */
       loght = log(rho/lambda * ((t/lambda)**(rho - 1)));
       lower_h_t = rho_u/lambda * ((t/lambda)**(rho_u - 1)); 
       upper_h_t = rho_l/lambda * ((t/lambda)**(rho_l - 1));
       suriv = 1 - exp(-(t/lambda) ** rho);
       suriv_u = 1 - exp(-(t/lambda) ** rho_u);
       suriv_l =  1 - exp(-(t/lambda) ** rho_l);
        output;
    end;
    *drop lambda rho rho_l rho_u;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 May 2024 08:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/The-Weibull-accelerated-failure-time-model-parameters-estimated/m-p/927819#M46181</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2024-05-10T08:57:25Z</dc:date>
    </item>
  </channel>
</rss>

