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: 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!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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