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;
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).
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).
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.