BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Adam_Black
Obsidian | Level 7

I would like to reproduce this simple example using PROC STDRATE. I do not see any way to specify a group option when using the indirect standardization method.

 

http://www.dartmouthatlas.org/downloads/methods/indirect_adjustment.pdf

 

Here is my code so far. 

 

data counts;
input area $ age $ death  denom ;
datalines;
Area1 65-69 6 500
Area1 70-74 15 300
Area1 75-79 20 200
Area2 65-69 3 300
Area2 70-74 12 300
Area2 75-79  36 400
;
run; proc sql; create table aggregate as select age, sum(death) as death, sum(denom) as denom from counts group by age; quit; /* I need an option to group by area */ proc stdrate data=counts refdata=aggregate method=indirect stat=rate(mult=100) ; population event=death total=denom; reference event=death total=denom; strata Age; run;

Thanks for your help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
If I understand correctly, you're looking for a BY statement.

proc stdrate data=counts refdata=aggregate
method=indirect
stat=rate(mult=100)
;
BY area;
population event=death total=denom;
reference event=death total=denom;
strata Age;
run;

View solution in original post

2 REPLIES 2
Reeza
Super User
If I understand correctly, you're looking for a BY statement.

proc stdrate data=counts refdata=aggregate
method=indirect
stat=rate(mult=100)
;
BY area;
population event=death total=denom;
reference event=death total=denom;
strata Age;
run;
Adam_Black
Obsidian | Level 7

For future reference, in case anyone else has the same issue, the solution below is what I was really after. Its output is a single table with statistics for each area. This is very helpful if you have many areas. I'm gradually learning how to use the ODS!

 

ods exclude all;
proc stdrate data=counts refdata=aggregate
			method=indirect
			stat=rate(mult=100)
			plots=smr
			;
population event=death total=denom;
reference event=death total=denom;
strata Age;
by area;
ods output smr=Smr_Cs;
run;
ods exclude none;

proc print data=Smr_Cs; 
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 1618 views
  • 4 likes
  • 2 in conversation