Search code examples
saslogistic-regression

In SAS: Specifying a reference level within PROC LOGISTIC


I am running a PROC LOGISTIC statement, defining the reference level under the class as:

proc logistic data=data1 
class Var1 (param=ref ref=first);
model Var2=Var1 ;
run;

My contingency table looks like:

           Var1  
Var2     | 1      2   
---------------------- 
   0     | 1240   218
   1     | 924    224 

Where I state the reference level of Var1 to be first, I mean it to be 1. This after all is the first level of variable Var1. The odds ratio that is given however, is 0.725. That would imply the second level, 2, is taken as reference group.

odds ratio given:

(924/1240)/(224/218)= 0.725

intended:

(224/218)/(924/1240)= 1.379

Is this a matter of definition of reference group, or am I not defining the level as intended?


Solution

  • This does appear to be happening, which does appear incorrect. Please contact SAS tech support.

    data have;
    input var1 var2 freq;
    cards;
    0 1 1240
    1 1 924
    0 2 218
    1 2 224
    ;;;;
    
    proc logistic data=have;
    class var1 (param=ref ref='1');
    model var2 = var1 / expb;
    freq freq;
    run;