BookmarkSubscribeRSS Feed
Jack_Smitherson
Fluorite | Level 6

Hi everyone, 

 

I am trying to use proc stdrate to calculate age-standardized rates. I am however getting the following error message: 

"WARNING: The stratum in the REFDATA= data set, Age_Group_5=10- gender=F, does not have a matched stratum in the DATA= data set."

 

Does the order of variables or sorting in the relevant data files matter? Perhaps counts for specific stratum is missing and it should be zero? If so, how do I go about addressing this issue?

 

Can someone please help?! I would really appreciate it! 

 

Below is my code: 

PROC STDRATE data=data_set
refdata=stdpop 
method=direct 
stat=rate (mult=1000) 
CL=gamma ;

*BY X; 
POPULATION event=counts=pop_denominator;
REFERENCE total=weight; 
STRATA Age_Group_5 gender; 
RUN;

1 REPLY 1
Reeza
Super User
> Perhaps counts for specific stratum is missing and it should be zero? If so, how do I go about addressing this issue?

Yes, you need to have an entry for each group if it's 0. Make sure that each X has every strata, you cannot have missing categories. You can use PROC FREQ and the sparse option. I think the following works:

proc freq data=data_set;
table age_group_5*gender / out=want sparse;
weight pop_denominator;
run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 631 views
  • 0 likes
  • 2 in conversation