Thursday, April 5, 2007

Correspondence between genmod and logistic

I have been exploring this for my work. I found some guidance here. I am including some details here.
data drug;
input drug$ x r n;
cards;
A .1 1 10
A .23 2 12
A .67 1 9
B .2 3 13
B .3 4 15
B .45 5 16
B .78 5 13
C .04 0 10
C .15 0 11
C .56 1 12
C .7 2 12
D .34 5 10
D .6 5 9
D .7 8 10
E .2 12 20
E .34 15 20
E .56 13 15
E .8 17 20
;

proc genmod data=drug;
class drug;
model r/n=x drug / dist=binomial link=logit;
estimate 'A vs E' drug 1 0 0 0 -1/exp;
run;

proc logistic data=drug;
class drug/param=ref;
model r/n=x drug;
run;


/* generates dummy variables coded as follows
drug A 1 0 0 0
B 0 1 0 0
C 0 0 1 0
D 0 0 0 1
E 0 0 0 0 */


proc logistic data=drug;
class drug;
model r/n=x drug;
run;


/* generates dummy variables coded as follows

Class Value Design Variables

drug A 1 0 0 0
B 0 1 0 0
C 0 0 1 0
D 0 0 0 1
E -1 -1 -1 -1
*/



However, the results (Odds ratio) are going to be the same. Accessible help on writing contrast statements is here.

No comments: