Recently i had to use Proc Phreg and being a non stats programmer, I have some doubts which I'm sharing here so I can get some help from experts: A variable ABC has 2 categorical values 0 and 1 sorted in ascending order within the treatment (TRT). I wanted to understand how PHREG decides the Reference among these 2 values (0 & 1) for the Hazard Ratio in following cases when used in class statement: I understand that by default it considers LAST level. So REF= is used to explicitly tell the SAS the reference value and not decide by its own(correct me if i'm wrong). So here what I want to understand is: A) Does prior sorting of class variable matters even if REF= is used (as in ex. 1) B) Does / DESC option makes difference if used along with REF= (as in ex 2) C) If no CLASS statement is used, does PHREG sorts abc variable internally and consider LAST ordered value as reference (ex. 3)? Please let me know if my question is not clear. 1) Proc phreg data = test; BY trt; CLASS abc(ref=’0’) ; MODEL time*censor(1) = abc /ties=exact rl; STRATA s1 s2; Run; 2) Proc phreg data = test; By TRT; CLASS abc(ref=’0’) /DESC; MODEL time*censor(1) = abc /ties=exact rl; STRATA s1 s2; RUN; 3) *Without CLASS Statement ; Proc phreg data = test; By TRT; MODEL time*censor(1) = abc /ties=exact rl; STRATA s1 s2; RUN;
... View more