/******************************************************************/
/*Using DrugNoSwitch, calculate DACON (Daily Average Consumption) */
/* DACON=Total Quantity/Total Days Supply */
/******************************************************************/
data acearb.drugdacon (drop=ds);
set acearb.drugnoswitch;
by personid;
if dayssupply=0 then dayssupply=ds;
if dayssupply<1 then dayssupply=(.z<dayssupply<0);
if quantity<1 then quantity=(.z<quantity<0);
if first.personid
then do;
TQuantity=0;
TDaysSupply=0;
end;
tquantity+quantity;
tdayssupply+dayssupply;
if last.personid;
DACON=round(tquantity/tdayssupply, .01);
run;
/******************************************************************/
/*Generate DACON ratio report */
/******************************************************************/
proc sort data=acearb.drugdacon out=drugdacon;
by personid;
run;
proc means data=drugdacon noprint;
by personid;
id gender;
var bene;
output out=t1
sum=t1member;
run;
proc sort data=drugdacon;
by personid brandname;
run;
proc means data=drugdacon noprint;
by personid;
id brandname;
var dacon;
output out=t2
sum=t2dacon;
run;
data total;
merge t1
t2;
by personid;
if t1member<1 then t1member=0;
if t2dacon<1 then t2dacon=0;
tdacon=t2dacon;
run;
ods html body='c:\DrugDaconRate.html'
style=minimal
rs=none;
proc report data=total headline headskip spacing=2 missing nowd split='*';
column brandname t1member, (gender) _freq_ total1 t2dacon, (gender) tdacon total2;
define brandname/group width=31 'Drug Prescribed';
define t1member/sum width=10 format=comma10. 'Total*Members';
define _freq_/sum noprint;
define tdacon/sum noprint;
define t2dacon/sum width=10 format=comma10.2 'Total*DACON*Rate';
define gender/across width=7 format=$fmtsex. 'Gender';
define total1/computed width=10 format=comma10. 'Total';
define total2/computed width=10 format=comma10.2 'Total';
compute total1;
total1=_freq_.sum;
endcomp;
compute total2;
total2=tdacon.sum;
endcomp;
rbreak after/ol ul skip suppress summarize;
run;
ods html close;
BackToTop BackToDocument HomePage
|