I am trying to see if I got a handle on how positional syntax works and I get conflicting answers when I use sex coded as a character M/F vs sex coded as a character variable 0/1. The positional numbers seem to be different based on how sex is coded using numbers or alphabets for character variable. I seem to be missing somthing. Here is a sample code. The only change is I have recoded sex as character var with '0'/'1' and the results don't match.
**SEX AS CHARACTER VAR(M,F);
proc phreg data=sashelp.class;
class sex(ref="F")/param=ref;
model age=sex;
estimate 'sex=M' sex [1,2]/ e exp cl;
estimate 'sex=F' sex [1,1] / e exp cl;
estimate 'M Vs F' sex [1,2][-1,1] / e exp cl;
run;
**SEX AS CHARACTER VAR('1','2');
data have;set sashelp.class; IF sex='M' THEN sex='1'; ELSE sex='2';run;
proc phreg data=have;
class sex(ref="2")/param=ref;
model age=sex;*htS|sex;
estimate 'sex=1(M)' sex [1,2] / e exp cl;
estimate 'sex=2(F)' sex [1,1]/ e exp cl;
estimate 'M Vs F' sex [1,2][-1,1] / e exp cl;
run;
... View more