I'm preparing a report that shows % susceptibilities for different drug-bugs combinations, histogram, IQR for % susceptibles, number of hospitals, number of isolates (ns_n) and number of susceptibles (ps_n) and I'm using the following: proc sort data= drugbug_combined out=drugbug; by drug_bug; run; data 2018_drugbug; set drugbug; if ns_n='.' then delete; if ns_n =0 then delete; run; data final_drugbug; set 2018_drugbug; if it_n='.' then do; it_n=isolates_hospital_n; end; run; proc univariate data=final_drugbug; by drug_bug; var ps_n; where drug_bug='Drug1 bug 1'; histogram; run; data Ami_ab; set final_drugbug; where drug_bug='Drug1 bug 1'; run; proc sql noprint;; select mean (ps_n) into: mean from Ami_ab; select std (ps_n) into : std from Ami_ab; quit; data Ami_abQC; set Ami_ab; where drug_bug='Drug 1 bug 1' AND ps_n< &mean-2*&std OR ps_n > &mean+2*&std; proc print noobs; var hospital drug_bug drug bug isolates_hospital_n it_n ps_n ns_n; run; proc print data=Ami_ab; sum it_n ps_n ns_n; var hospital drug_bug drug bug isolates_hospital_n it_n ps_n ns_n; run; I would like to use a macro since I have more than 25 different drug bug combinations. Thank you
... View more