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

Dear all,

 

I need to run tonnes of cox model. I want to get the hazard ratio for expo_&var. below. Ideally i would like to output the hazard ratios into a dataset. Do correct me if i am wrong:  I read the guide for PROC SURVEYPHREG, the keyword for output statement is quite limited and there are no options to save the hazard ratios into a dataset?  Any input would be greatly appreciated.

 

Here are the codes:

PROC SURVEYPHREG DATA = new2;
       CLUSTER clus;
        STRATA str;
        WEIGHT &weight;        
        MODEL (start,stop)*censor_&var.(0)      =      &country    
                                                age18_29      age30_44        age45_59
                                                sexf
                                                expo_&var./ RISKLIMIT TIES = EFRON;
RUN;

 

      
 

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
Opal | Level 21

Add this statement before you run the PROC step:

 

ods trace on;

 

This will name all the pieces of output that could be available if you choose to capture them.  Whichever one looks right, use an ODS OUTPUT statement to transfer the values to a SAS data set.  It may take some fiddling, but all pieces of output are available and can be captured in a SAS data set if you use ODS.  (You will need to re-run the program, once you have added the proper ODS OUTPUT statement.)

View solution in original post

2 REPLIES 2
Astounding
Opal | Level 21

Add this statement before you run the PROC step:

 

ods trace on;

 

This will name all the pieces of output that could be available if you choose to capture them.  Whichever one looks right, use an ODS OUTPUT statement to transfer the values to a SAS data set.  It may take some fiddling, but all pieces of output are available and can be captured in a SAS data set if you use ODS.  (You will need to re-run the program, once you have added the proper ODS OUTPUT statement.)

clim072
Fluorite | Level 6
Thanks it works now. 🙂

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 557 views
  • 1 like
  • 2 in conversation