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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 992 views
  • 0 likes
  • 2 in conversation