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

I have simulated 10,000 data set and wants to use them to perform 10,000 proc phreg.  I would then have 10,000 Hazard Ratios and I want to compute their mean. The only way I  know how is to ods output the 10,000 Hazard Ratio, combine them together then calculate the mean. I am wondering if there is any better ways of doing without outputting every single one of them?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Yes. Instead of 10,000 data sets, use one data set with 10,000 values of an ID variable. Use BY group analysis in PROC PHREG and a single ODS OUTPUT statement. Details in the article

Simulation in SAS: The slow way or the BY way

When you so this, be sure to suppress the output tables to the screen. Just save the ones you need to a data set.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Yes. Instead of 10,000 data sets, use one data set with 10,000 values of an ID variable. Use BY group analysis in PROC PHREG and a single ODS OUTPUT statement. Details in the article

Simulation in SAS: The slow way or the BY way

When you so this, be sure to suppress the output tables to the screen. Just save the ones you need to a data set.

CHELS
Obsidian | Level 7
Thank you! You are the hero!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 957 views
  • 4 likes
  • 2 in conversation