Sdlentertd

2010-01-22 17:19:25 UTC

Have this dataset

DeathDT DatePurch DAYSUPPLY QTYPurch PriceUnit

12/02/2009 11/15/2009 30 60

1.00

I am trying to find a way to figure out how much money is lost due to

death:

if a person purchased 60units at $1.00, but died after 16 days of

taking that medication, we have 14 days left (need to calculated the

days left) and need to figure out how much that 14 days is worth

Need to do this in sas:

if death is after datePurchased then do;

Death date minus DatePurch = x;

QTY / DAYSUPPLY =qtyPerDay;

count how many days left after death until DatePurch+Daysupply (to

figure out when the supply expires) = y;

y (days left after death) * qtyPerDay = z; (QTY left after death)

then z* PriceUnit to figure out the final $ left on medicine after a

person died.

So in my example: 14 days after death, 0.5 medicine per day = 7qty *

$1.00 = $7.00 loss

Thank you

DeathDT DatePurch DAYSUPPLY QTYPurch PriceUnit

12/02/2009 11/15/2009 30 60

1.00

I am trying to find a way to figure out how much money is lost due to

death:

if a person purchased 60units at $1.00, but died after 16 days of

taking that medication, we have 14 days left (need to calculated the

days left) and need to figure out how much that 14 days is worth

Need to do this in sas:

if death is after datePurchased then do;

Death date minus DatePurch = x;

QTY / DAYSUPPLY =qtyPerDay;

count how many days left after death until DatePurch+Daysupply (to

figure out when the supply expires) = y;

y (days left after death) * qtyPerDay = z; (QTY left after death)

then z* PriceUnit to figure out the final $ left on medicine after a

person died.

So in my example: 14 days after death, 0.5 medicine per day = 7qty *

$1.00 = $7.00 loss

Thank you