BookmarkSubscribeRSS Feed
Jsvane
Fluorite | Level 6

Hi,

I am doing a nationwide study on causes of death among persons with a certain disease. In this study I would like to report age standardized mortality rates. To do this I am using proc stdrate (please see my coding below)

 

 

data disease;
disease='Disease_yes';
input Age $ death personyear;
datalines;
01-05 0 456
06-10 2 4438
11-15 5 1238
16-20 18 10343
21-25 12 11911
26-30 59 22243
31-35 99 30461
36-40 73 14149
41-45 152 20922
46-49 211 22523;
run;
 
data non_disease;
disease='Disease_no';
input Age $ death personyear;
datalines;
01-05 425 3221118
06-10 321 3437579
11-15 435 3284323
16-20 1196 3006596
21-25 1434 3143418
26-30 1118 3562167
31-35 2631 3890100
36-40 1059 1166712
41-45 1922 1243489
46-49 2250 875898;
run;
 
data background;
input Age $ personyear;
datalines;
01-05 1332464
06-10 3431737
11-15 3293241
16-20 3004924
21-25 3159532
26-30 3584413
31-35 3920561
36-40 1180861
41-45 1264411
46-49 903471;
run;
 
data two_groups;
length disease $ 11.;
set disease non_disease;
run;
 
 
ods graphics on;
proc stdrate data=two_groups
refdata=background
method=direct
stat=rate(mult=100000)
effect=ratio
plots(only)=effect;
population group=disease event=Death total=PersonYear; reference total=PersonYear; strata Age / effect; run; ods graphics off;

 

 

However when I do this, SAS gives me the ever beloved

‘ERROR: Floating Point Zero Divide.

ERROR: Termination due to Floating Point Exception’

I know the sinner is the ‘0’ in the disease group age 01-05. However, what do I do to avoid this?

Thanks in advance.

 

/Jesper

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

This may sound daft, and I will move the post to the stats section as that will get you better coverage, but if you have data that is not useful in the procedure, or causes, then why not filter that data out?  Or if it needs to be in the formula then you could just add 0.00001 to the value so its no longer a zero, but so small it wouldn't affect the outcome.  

Jsvane
Fluorite | Level 6

Hi RW9

 

Thanks for your answer - much appreciated! The post is now also posted in stats section (didn't know how to relocate it).

The data needs to be there, as if I remove it will falsely increase the age standardized mortality rate.

I already tried the trick with 0.00001 however it is still messing with the MR in some of my causes of death. As you can see in the attached screen shot the MR isn't 0 in the groups where I used 0.00001 (and not even close to 0 in the first groups). Is this due to a also very low PersonYears in these groups?

SAS eksempel.png

Jsvane
Fluorite | Level 6

UPDATE: So far I solved it by falsely changing the personyears in the age-groups with 0 deaths, to a infinite high number. Then SAS will calculate the 0.00001 deaths as a MR in that age group of 0.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Mmm, can't really think of any other "fixes" other than making the 0 missing, tht should then be ignored by computations, but not sure if it would affect outcomes.  Maybe send tech support a mail.  Couldnt find any information about this error other than a couple of other procedures:

http://support.sas.com/kb/34/545.html

What version are you running, just thinking maybe its been fixed in more recent versions?

Otherwise I have no ideas, sorry.

StatDave
SAS Super FREQ

The zero divide problem only exists in SAS 9.4 TS1M2 and earlier releases.  It is fixed in the two releases since.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2436 views
  • 4 likes
  • 3 in conversation