|
第一种方法,在logistic过程里实现data ex;
input
age sex opt;
cards;
51.00 1.00 .00
57.00 1.00 .00
46.00 1.00 .00
20.00 1.00 1.00
50.00 .00 .00
22.00 1.00 .00
40.00 1.00 .00
29.00 .00 1.00
68.00 1.00 .00
66.00 .00 .00
28.00 1.00 1.00
43.00 .00 1.00
43.00 .00 .00
53.00 .00 1.00
69.00 1.00 .00
63.00 .00 1.00
47.00 .00 1.00
67.00 .00 .00
65.00 .00 .00
66.00 1.00 .00
24.00 .00 .00
38.00 .00 1.00
24.00 1.00 .00
40.00 1.00 1.00
33.00 1.00 1.00
36.00 1.00 1.00
68.00 1.00 .00
28.00 .00 1.00
43.00 .00 1.00
58.00 1.00 1.00
28.00 .00 1.00
27.00 .00 1.00
38.00 .00 .00
;
run;
ods graphics on;
proc logistic data=ex plots(only)=(oddsratio(type=vertical));
model opt=age sex;
oddsratio 'age' age;
oddsratio 'sex' sex;
run;
第二种方法 ,使用ods output oddsratios =oddsratio;
将OR值保存到数据集种,使用gplot实现,
data anno;
length function style color $8;
retain xsys ysys '2' when 'a';
set oddsratio;
function='move'; xsys='2'; ysys='2'; yc=effect; x=lowercl; color='black'; output;
function='draw'; x=uppercl; color='black'; size=1;output;
function='move';xsys='2'; ysys='2';yc=effect; x=lowercl; color='black'; output;
function='draw';x=lowercl; ysys='9'; y=1; size=1; output;
function='draw';x=lowercl; y=-2; size=1;output;
function='move';xsys='2'; ysys='2'; yc=effect; x=uppercl; color='black'; output;
function='draw';x=uppercl; ysys='9'; y=1; size=1; output;
function='draw';x=uppercl; y=-2; size=1; output;
run;
axis1 label=none
minor=none
offset=(5,5);
axis2 order=(0 to 15 by 2.5)
label=('Odds Ratio')
minor=none;
title "plot of odds ratio";
symbol1 i=none color=black value=dot height=1;
proc gplot data=oddsratio;
plot effect*OddsRatioEst / annotate=anno
nolegend
vaxis=axis1
haxis=axis2;
run;
quit;
|