proc format;
value $Namefmt
"Age"          ="Age"
"BMI"          ="BMI"
"Sex_num"      ="Sex (Male)"
"CABG_i"       ="CABG isolated"
"Valve_i"      ="Valve isolated"     
"CABG_V"       ="CABG / Valve"      
"OHT"          ="Orthotopic Heart Transplant"
"Redo1"        ="Redo"   
"IABP_ever1"   ="Hx of IABP"      
"Hyperlip"     ="Hyperlipidemia" 
"NIDDM1"       ="NIDDM" 
"COPD"         ="COPD" 
"CHF"          ="CHF" 
"Afib"         ="Afib" 
"CM"           ="Cardiomyopathy" 
"CAD"          ="CAD" 
"MI"           ="Hx of MI" 
"AICD"         ="AICD" 
"CRF"          ="Renal Failure" 
"PVD"          ="PVD" 
"ASA"          ="Aspirin" 
"BB"           ="Beta Blockers" 
"Steroids"     ="Steroids"
"Amio"         ="Amiodarone" 
"LMWH"         ="LMWH" 
"Digoxin"      ="Digoxin" 
"AA1"          ="Alpha Antagonists" 
"Statin1"      ="Statins"
"Nitrates1"     ="Nitrates " 
"Diurectics1"  ="Diuretics" 
"pre_Na"       ="preop Na" 
"pre_BUN"      ="preop BUN" 
"pre_Cr"       ="preop Cr" 
"pre_Gluc"     ="preop Gluc" 
"pre_Neutro"   ="preop Neutrophils" 
"pre_Lymph"    ="preop Lymphocytes" 
"pre_Hgb"      ="preop Hb" 
"pRBC"         ="PRBC"
"FFP" 		   ="FFP"
"PLT"          ="Platelets"
"Cryo"         ="Cryoprecipitate"
"CPBmin"       ="Bypass time"
"AoXCmin"      ="Cross Clamp time"
"Ind_Temp1"    ="induction Temp(C)"
"Ind_HR1"      ="induction HR"
"Ind_SBP1"     ="induction SBP"
"Ind_MAP1"     ="induction MAP"   
"Ind_DBP1"     ="induction DBP"  
"Ind_PAS1"     ="induction PAS"  
"Ind_mPAP1"    ="induction mPAP"  
"Ind_PAD1"     ="induction PAD"   
"pulse_p"      ="induction pulse pressure"
"A" ="."
"B" ="."
"C" ="."
;
run;

proc template;
   define style mystyle;
   parent=styles.sasweb;
      class graphwalls / 
            frameborder=off;
      class graphbackground / 
            color=white;
   end;
run;

ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=800 height=900;

proc sgplot data = HEERDT.New1  nowall noborder ;
Title "OR (95% CI) for covariates across Vasoplegia Severity" ;
styleattrs datacontrastcolors=(CX18577A CX30CC6E  ) ;
scatter x=sdOR y=Name / xerrorupper=sdUCL xerrorlower=sdLCL noerrorcaps markerattrs=(symbol=circlefilled size =5 ) 
group=Severity groupdisplay=cluster clusterwidth=0.6;
yaxis DISCRETEORDER= DATA reverse valueformat= $Namefmt.;
xaxis display =(noticks  nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal)type =log logbase =10;
yaxis display =(noticks nolabel noline) VALUEATTRS=(Color=Black Family=Arial Size=8 Style=Normal Weight=Normal)
valueshalign=left colorbands=odd colorbandsattrs=(transparency=0.7);
refline 1.0 / axis=x discretethickness=1 lineattrs=(color=cxd0e0f0);

yaxistable pdp2_char sdORCI /class =Severity classdisplay =stack position=right location=outside 
VALUEATTRS=(Color=Black Family=Arial Size=8  Weight=Normal ) VALUEHALIGN=CENTER VALUEJUSTIFY= CENTER CLASSORDER=DATA 
COLORGROUP=Severity; 
 xaxis display=(nolabel) values=(0.4 1.0 1.5 2.0 2.5 5 6);
run;