Hi, I am trying to calculate the Hazard ratio from the dataset using PROC PHREG.
The data have 3 treatment groups
trtc trtn
Trt1 0
Trt2 1
Trt3 2
I am running following the code, But I would like to know what each procure results represents
*********************************************
Code 1:
proc phreg data=treat;
model aval*cnsr(1)= trtn/ rl alpha = 0.05 ;
ods output ParameterEstimates = hzratio ;
run;
This code generates one Hazarad ratio and other stats: Is this represents overall HAZARD Ratio?
***********************************************
Code 2:
proc phreg data=treat;
class trtn(ref="0");
model aval*cnsr(1)= trtn/ rl alpha = 0.05 ;
ods output ParameterEstimates = class_hratio ;
run;
it generates two Hazard ratios: each one represents hazard ratios in comparison/reference to Trt1 ( trtn=0)?
***************************************************
Please let me know your thoughts thanks.
Hi @SASuserlot,
Your "Code 2" is the correct approach. As you wrote, it computes the hazard ratios "Trt2 vs. Trt1" and "Trt3 vs. Trt1."
Without the CLASS statement ("Code 1"), variable TRTN is treated as a continuous explanatory variable, which would hardly ever make sense. The single hazard ratio calculated describes the change in the hazard for any increase of one "unit" of TRTN. But even if there was a continuous factor underlying the treatment groups -- e.g., the dose of the same drug: Trt1=10 mg, Trt2=20 mg, Trt3=30 mg --, would you really want to assume that an increase from 10 to 20 mg has the same effect on survival as an increase from 20 to 30 mg?
With only two treatment groups (TRTN=0, TRTN=1) the two approaches would be equivalent, though.
Hi @SASuserlot,
Your "Code 2" is the correct approach. As you wrote, it computes the hazard ratios "Trt2 vs. Trt1" and "Trt3 vs. Trt1."
Without the CLASS statement ("Code 1"), variable TRTN is treated as a continuous explanatory variable, which would hardly ever make sense. The single hazard ratio calculated describes the change in the hazard for any increase of one "unit" of TRTN. But even if there was a continuous factor underlying the treatment groups -- e.g., the dose of the same drug: Trt1=10 mg, Trt2=20 mg, Trt3=30 mg --, would you really want to assume that an increase from 10 to 20 mg has the same effect on survival as an increase from 20 to 30 mg?
With only two treatment groups (TRTN=0, TRTN=1) the two approaches would be equivalent, though.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.