Reference coding in SAS Proc Logistics

#1
I am doing reference coding and this confuses me. All my variables are dummy variables coded 1 and 0.

This is the code
PROC LOGISTIC DATA=WORK.SORTTempTableSorted
PLOTS(ONLY)=ALL
;
CLASS pd2 (PARAM=REF) pd1 (PARAM=REF) pd3 .....;
MODEL DVD (Event = '1')=pd1 pd2 pd3 pd4 pd5 pd6 pd7 pd8 pd9 pd10 pd11 pd12 pd13 pd15 pd16 pd17 pd18 pd19 pd20 pd21 pd22 pd23 pd24 pd25 pd26 pd27 pd28 pd29 pd30 pd31 pd14 /
SELECTION=NONE
LINK=LOGIT
;
RUN;
QUIT;

For the odds ratio the results are

1631639981616.png


So 1 has a greater impact on the DV taking on a value of 1. I am just not sure what 1 means here. Is is the way I coded it in my raw data or did sas change this by creating new design variables?

It says this, Is this effectively reversing the way I code the variables in the raw data?

1631640139578.png
 

hlsmith

Less is more. Stay pure. Stay poor.
#2
The odds of the outcome equaling 1 for subjects with pd1 = 0 are 0.65 times the odds of subjects with pd1 = 1.

If you don't like this, make CLASS pd2 (PARAM=REF) pd1 (PARAM=REF) pd3 .....,/ ref='0'; Right?
 
#3
I knew how to interpret it. I did not know how the 0 in the results corresponded to what is 0 in my raw data. That is, is sas leaving my 0 in the data as 0 or changing it to 1 when it builds variables.

If I do this /ref='0' the reference level will be what is 0 in my raw data right? So if 0 is male in the raw data using your example

The odds of the outcome equaling 1 for subjects with pd1 = male are 0.65 times the odds of subjects with pd1 = female.
 
#4
I get an error message when I do that hlsmith. I am looking for the right way to set the reference to 0. It does not like the ref='0'
 
#5
This should work, but does not.

Code:
PROC LOGISTIC DATA=WORK.SORTTempTableSorted
        PLOTS(ONLY)=ALL
    ;
    CLASS pd2     (REF='0') pd1     (REF='0') / param=ref;
    MODEL DVD (Event = '1')=pd1 pd2      
        SELECTION=NONE
        LINK=LOGIT
    ;
RUN;
QUIT;
 

hlsmith

Less is more. Stay pure. Stay poor.
#6
If I can't figure out the coding scheme or estimates in a model - I simply it down to one IV and run it via the logistic and as a frequency table and compare the output as a quality check. Have you done anything like this?
 
#7
If I can't figure out the coding scheme or estimates in a model - I simply it down to one IV and run it via the logistic and as a frequency table and compare the output as a quality check. Have you done anything like this?
I am not sure what that means. I figured out the error, although it baffles me.

Code:
PROC LOGISTIC DATA=WORK.SORTTempTableSorted
        PLOTS(ONLY)=ALL
    ;
    CLASS pd2     (REF='0') pd1     (REF='0')/ param=ref;
    MODEL DVD (Event = '1')=pd1 pd2        
        /*SELECTION=NONE
        LINK=LOGIT */
    ;
RUN;
QUIT;
Runs fine. I don't understand why that default coding I commented out matters. But it messes up the code.
 

hlsmith

Less is more. Stay pure. Stay poor.
#9
What I meant was I will run a simple logistic model and proc freq / odds ratio and confirm they are kicking out similar results if I have a reference group concern.