<?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: Floating point error in PROC LIFEREG in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787803#M1298</link>
    <description>&lt;P&gt;Please post your PROC LIFEREG code statements.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Dec 2021 16:12:37 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-12-30T16:12:37Z</dc:date>
    <item>
      <title>Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787800#M1297</link>
      <description>&lt;P&gt;Hello SAS users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am running some simulations using PROC LIFEREG with a bayes statement in place. There are instances where the simulations fail to converge, and the proc statement aborts with a floating point error. I am wondering if there is a way to implement a try-catch error - to catch the simulations that fail to converge but move onto the next one instead of aborting the proc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;note: NOTE: The above message was for the following BY group:
note:       SimulID=15
note: NOTE: Algorithm converged.
error: ERROR: Floating Point Zero Divide.
error: ERROR: Termination due to Floating Point Exception
note: NOTE: The SAS System stopped processing this step because of errors.
note: NOTE: Due to ERROR(s) above, SAS set option OBS=0, enabling syntax check mode.
note:       This prevents execution of subsequent data modification statements.
warning: WARNING: The data set WORK.POSTERIORSAMPLE11 may be incomplete.  When this step was stopped there were 37500 observations and 9
title: 58                                                         The SAS System                    Thursday, December 30, 2021 03:08:29 AM
title: 
warning:          variables.&lt;/PRE&gt;
&lt;P&gt;My institute has a license for only SAS 9.4, and I am using SAS Viya for Learners.&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;</description>
      <pubDate>Thu, 30 Dec 2021 16:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787800#M1297</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-12-30T16:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787803#M1298</link>
      <description>&lt;P&gt;Please post your PROC LIFEREG code statements.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787803#M1298</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-30T16:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787805#M1299</link>
      <description>&lt;P&gt;Yes, this is what it looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods output PosteriorSample=PosteriorSample;
proc lifereg data = IGamma;										
	class  arm ;
	model Y*L_evt(0)= arm/dist = Gamma;		
	bayes seed=1729 nmc = 2500 thinning=1 coeffprior=normal(var=1E6)
	scaleprior=gamma(shape=0.001, iscale=0.001) gammashapeprior=normal(mean=0, var=100)
	nbi = 2000;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787805#M1299</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-12-30T16:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787812#M1300</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your original post LIFEREG code had by-groups :&lt;/P&gt;
&lt;PRE&gt;note: NOTE: The above message was for the following BY group:
note:       SimulID=15&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I do not see them (the by-groups) in the above code.&lt;/P&gt;
&lt;P&gt;Instead of working with by-groups, you can also build loops over PROC LIFREG. But that is less performant and may lead to some extra coding to collapse the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787812#M1300</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-12-30T16:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787815#M1301</link>
      <description>&lt;P&gt;You are right. Thank you.&lt;/P&gt;
&lt;P&gt;This is the code that I used to produce that error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods output PosteriorSample=PosteriorSample11;
proc lifereg data = IGamma1 noprint;
by SimulID;
class  arm ;
model Y1*L_evt1(0)= arm/dist = Gamma;
bayes seed=&amp;amp;seed nmc = &amp;amp;mcmc thinning=&amp;amp;thinning  coeffprior=normal(var=1E6)
scaleprior=gamma(shape=&amp;amp;gamma_shape, iscale=&amp;amp;gamma_iscale) gammashapeprior=normal(mean=&amp;amp;gamma_mean, var=&amp;amp;gamma_var)
nbi = &amp;amp;burn;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Dec 2021 16:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787815#M1301</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-12-30T16:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787831#M1302</link>
      <description>&lt;P&gt;It might help to show the current values of all the macro variables. Without the values of the macro variables the code isn't clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or possibly run the code with Options MPRINT set to show the generate code in the log and post the log.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 18:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787831#M1302</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-30T18:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787847#M1303</link>
      <description>&lt;P&gt;Yes, these are the current values for the macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ods output PosteriorSample=PosteriorSample11;
proc lifereg data = IGamma1 noprint;
by SimulID;
class arm ;
model Y1*L_evt1(0)= arm/dist = Gamma;
bayes seed=1729 nmc=2500 thinning=1 coeffprior=normal(var=1E6)
scaleprior=gamma(shape=86.9, iscale=65.4) gammashapeprior=normal(mean=0.49675, var=0.12051)
nbi = 3000;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Dec 2021 21:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787847#M1303</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-12-30T21:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787904#M1304</link>
      <description>&lt;P&gt;This is almost surely a data-dependent problem since it only happens when SimulID=15. We can try to diagnose it here, but I think floating-point errors should be reported to SAS Technical Support so that the developer can address the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the name of your BY-group variable, I assume that you are running a simulation? If so, please provide the code that simulates the data or (if the sample size is small) provide the simulated data for SimulID=15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Dec 2021 12:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787904#M1304</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-31T12:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point error in PROC LIFEREG</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787954#M1305</link>
      <description>We opened up a ticket about this issue with SAS technical support. The underlying distribution is the 3 parameter Generalized Gamma, and technical support wrote back and said that it is not possible to estimate all three parameters at the same time in SAS 9.4, and the only solution was to fix one of them. They also wrote: &lt;BR /&gt;&lt;BR /&gt;"So, you would have to have your site license our SAS Viya product with release cadence of at least 2020.0.3 (like the release number) in order to have the fix that would allow LIFEREG to keep running when it encounters a floating point error in one BY group. The fix will probably also should be available in our next maintenance to SAS9.4 which should be out late this year or early next year according to my manager.  All of our new development work and fixes are all in SAS Viya."&lt;BR /&gt;&lt;BR /&gt;I was excited to see that SAS Viya for Learners is available for students and educators, so I went back to this code at the beginning of December to see if it would run on that platform.&lt;BR /&gt;&lt;BR /&gt;The full code is a clinical trial design and has features for data generation and adaptions such as arms dropping and response adaptive randomization. Right now I'm generating the data in SAS, moving it over to R to complete the Bayesian part with a try-catch error in place, and then moving back to SAS for the post analysis.&lt;BR /&gt;&lt;BR /&gt;The reason I looked at SAS Viya is because I've been trying to see if I could somehow save the code that I wrote in SAS last year.</description>
      <pubDate>Fri, 31 Dec 2021 19:05:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Floating-point-error-in-PROC-LIFEREG/m-p/787954#M1305</guid>
      <dc:creator>thewan</dc:creator>
      <dc:date>2021-12-31T19:05:25Z</dc:date>
    </item>
  </channel>
</rss>

