Odds ratio using PROC MEANS and a data step

proc means data=amy stackodsoutput mean min max n;
class A B;
var X ;
ods output summary=kaz_mean;
run;

proc transpose data=kaz_mean out=amyt;
by B;
var Mean;run;

data amyt2;
set amyt;
/*http://en.wikipedia.org/wiki/Odds_ratio
test using the set values. This should return odds ratio of 36
col1=0.9;
col2=0.2;
*/

odds_ratio= ( col2/(1-col2)) /(col1/(1-col1)) ;

run;

Leave a Reply