## Selecting arms for Hazard Ratio in Proc PHREG

Solved
Super Contributor
Posts: 328

# Selecting arms for Hazard Ratio in Proc PHREG

I have 4 treatment arms, and arm 1 is the active treatment group, and arms 2, 3 and 4 are three control groups.

How to get Hazard Ratios and 95% CIs of Arm1 vs Arm2, Arm1 vs Arm3, and Arm1 vs Arm4?

using the code below (Ref='1') I can get HR of Arm2 vs Arm1, Arm3 vs Arm1 and Arm4 vs Arm1, and the 95% CIs.

To convert to HR of Arm1 vs the others, I can take Reciprocal of the original HRs, but how to get the 95% CI of the Reciprocal?

```ods listing close;
ods output  ParameterEstimates  =__str_ParameterEstimates0
GlobalTests         =__str_GlobalTests0;
proc phreg data=endpoint;
class ARM (ref='1');
strata Agegrn ;
model aval * cnsr(1) = ARM / risklimits;
quit;
ods output close;
ods listing;```

Accepted Solutions
Solution
‎01-05-2018 03:07 PM
Super Contributor
Posts: 328

## Re: Selecting arms for Hazard Ratio in Proc PHREG

[ Edited ]

I figured it out, by using

``hazardratio 'Group comparisons ' ARM / diff=all;``

All Replies
Solution
‎01-05-2018 03:07 PM
Super Contributor
Posts: 328

## Re: Selecting arms for Hazard Ratio in Proc PHREG

[ Edited ]

I figured it out, by using

``hazardratio 'Group comparisons ' ARM / diff=all;``
Super User
Posts: 23,700

## Re: Selecting arms for Hazard Ratio in Proc PHREG

You may also want to set PARAM=REF on your CLASS statement.

Review the design matrix (top of the SAS output) to ensure it's what you're expected. Otherwise you'll likely interpret your parameters incorrectly, and/or your next question will be why are the ratios from the parameter estimates different than the ones from HazardRatio statement.

Super Contributor
Posts: 328

## Re: Selecting arms for Hazard Ratio in Proc PHREG

Thank you Reeza.

I have compared the output using Hazardratio statement and the one I got before, so I know I got the right numbers.

I will also look at the PARAM=REF option. Thanks.

Super User
Posts: 23,700

## Re: Selecting arms for Hazard Ratio in Proc PHREG

The hazard ratio will be correct, the parameter estimate may not be what you expect however.

Super Contributor
Posts: 328

## Re: Selecting arms for Hazard Ratio in Proc PHREG

Oh, I did not realize that. So, is the code below right? Do I need to use the contrast statement ?

``````ods listing close;
ods output  ParameterEstimates  =__str_ParameterEstimates0
GlobalTests         =__str_GlobalTests0;
proc phreg data=endpoint;
class ARM (ref='1')  / param=ref;
strata Agegrn ;
model aval * cnsr(1) = ARM / risklimits;
quit;
ods output close;
ods listing;``````
☑ This topic is solved.