Help using Base SAS procedures

Selecting arms for Hazard Ratio in Proc PHREG

Accepted Solution Solved
Reply
Super Contributor
Posts: 328
Accepted Solution

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 ]
Posted in reply to fengyuwuzu

I figured it out, by using 

hazardratio 'Group comparisons ' ARM / diff=all;

View solution in original post


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

Re: Selecting arms for Hazard Ratio in Proc PHREG

[ Edited ]
Posted in reply to fengyuwuzu

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

Posted in reply to fengyuwuzu

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

Posted in reply to fengyuwuzu

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.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 218 views
  • 0 likes
  • 2 in conversation