BookmarkSubscribeRSS Feed
Lulu09
Calcite | Level 5

There are 3 groups. And I want to get the hazard ratio for group 1 vs group 3, and group 2 vs group 3. The results that are generated from below 2 methods are not the same. So should I better put all 3 groups into PHREG, and set group 3 as reference level, Or should I select 2 groups each time when I execute PHREG procedure ? Thank you very much.

 

Method 1

proc phreg data = xx alpha=0.05;
    class trt (ref="3");
    model aval*cnsr(1)=trt /ties=exact;
    hazardratio trt / diff=all;
run;

Method 2

proc phreg data = xx(where=(trt in (1,3) )) alpha=0.05;
    class trt (ref="3");
    model aval*cnsr(1)=trt /ties=exact;
    hazardratio trt ;
run;

proc phreg data = xx(where=(trt in (2,3) )) alpha=0.05;
    class trt (ref="3");
    model aval*cnsr(1)=trt /ties=exact;
    hazardratio trt ;
run;

1 REPLY 1
OsoGris
SAS Employee

I think it is advisable to keep all three treatments in one model. If you want the differences with the reference category you can use the option DIFF=REF on the HAZARDRATIO statement. 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1366 views
  • 0 likes
  • 2 in conversation