SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi Folks:

 

In PROC PHREG below where METHOD is binary variable (1,0) does SAS take 1 over 0 or 0 over 1 to calculate the hazard ratio reported in the annotated output shown below? 

 

PROC PHREG DATA=MYDATA; 
MODEL DURATION*DEATH(0)=METHOD;      
RUN;

PROC PHREG.png

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Cruise,

 

Without a CLASS statement, METHOD is treated as a continuous variable, in which case the hazard ratio refers to an increase by one unit. For a binary variable, of course, this is equivalent to a hazard ratio of level 1 vs. level 0. Categorical explanatory variables are usually named in a CLASS statement where you can use the REF= option to specify the reference level explicitly and thus avoid any ambiguities.

 

Your sample output shows one of the rare cases where the "direction" (1 vs. 0 or 0 vs. 1) has no impact on the results (hazard ratio 1).

View solution in original post

5 REPLIES 5
FreelanceReinh
Jade | Level 19

Hi @Cruise,

 

Without a CLASS statement, METHOD is treated as a continuous variable, in which case the hazard ratio refers to an increase by one unit. For a binary variable, of course, this is equivalent to a hazard ratio of level 1 vs. level 0. Categorical explanatory variables are usually named in a CLASS statement where you can use the REF= option to specify the reference level explicitly and thus avoid any ambiguities.

 

Your sample output shows one of the rare cases where the "direction" (1 vs. 0 or 0 vs. 1) has no impact on the results (hazard ratio 1).

Cruise
Ammonite | Level 13
Can you please elaborate what made the case one of the rare cases where the "direction" (1 vs. 0 or 0 vs. 1) ?
FreelanceReinh
Jade | Level 19

When you switch the two levels of a dichotomous explanatory variable (used in a CLASS statement), the original hazard ratio h becomes 1/h. Similarly, the confidence limits (CL) of h are inverted: The new lower CL is 1/(old upper CL) and the new upper CL is 1/(old lower CL). Also, the sign of the parameter estimate, if positive or negative, changes (but not its absolute value, standard error, Chi-Square statistic and p-value).

 

However, in your example h=1 (as a consequence, the upper CL is 1/(lower CL)) and the parameter estimate is 0 so that none of the changes described above is visible.

Cruise
Ammonite | Level 13
Thanks for your explanation. This helped!
Reeza
Super User
I always recommend using HazardRatio statements to interpret your HR so that you know exactly what comparisons it's making.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 5 replies
  • 2425 views
  • 7 likes
  • 3 in conversation