Something like this (untested)? data HAVE;
do UTI ='Y','N';
do SEPSIS ='Y','N';
do BMI = 0.05 to 0.95 by 0.05;
NBCASES=round(ranuni(0)*100);
output;
end;
end;
end;
run;
proc sql;
create table RATES as
select BMI
, sum(NBCASES*(UTI ='Y')) /sum(NBCASES) as RATE_UTI
, sum(NBCASES*(SEPSIS ='Y')) /sum(NBCASES) as RATE_SEPSIS
, sum(NBCASES*(SEPSIS ='Y')*(UTI='Y'))/sum(NBCASES) as RATE_COMPLIC
from HAVE
group by BMI;
quit;
proc plot data=RATES;
plot (RATE_UTI RATE_SEPSIS RATE_COMPLIC)*BMI / overlay ;
format RATE: percent.;
run;
quit;
... View more