Hi All,
I have a dataset with several drugs. The dataset has NDCNUM to identify drugs (One drug can have several NDC numbers), patid, date, cost, hospital visits and other variables.
a) I would like to see how many patients switched from drug A to drug B to drug C..... and vice versa.
b) Create a dataset for patients that are on Drug A to calculate the annual cost, hospital visits etc and similarly have datasets for other drugs.
Sample data set
Data have;
input patid svcdate ndcnum cost Drugtype $5. ;
format svcdate mmddyy8. ;
datalines;
1 11022009 944302602 1500 A 1 11052009 944302802 1580 A 1 11122009 944303002 1590 A 1 11162009 944303202 1600 A 1 11252009 944303402 1554 A 1 12012009 64406091101 3500 B 1 12052009 64406092201 3589 B 1 12102009 64406093301 3691 B 1 12182009 64406094401 3541 B 1 12242009 64406096601 3580 B 1 12262009 64406097701 3661 B 2 11022009 944302602 1500 A 2 11052009 944302802 1580 A 2 11122009 944303002 1590 A 2 11162009 944303202 1600 A 2 11252009 944303402 1554 A 2 12012009 71104091101 3500 C 2 12052009 71104092201 3589 C 2 12102009 71104093301 3691 C 2 12182009 71104094401 3541 C 2 12242009 71104096601 3580 C 2 12262009 71104097701 3661 C 2 11012010 53270027005 4125 D 2 11052010 53270027105 4785 D 2 11102010 53270027106 4321 D
2 11052010 53270027105 4785 D 2 11152010 71104097701 4321 C
2 11252010 71104097701 4785 C 2 11262010 71104097701 4321 C;
run;
For patient 1, the first 5 rows contain NDC code for Drug A the 6 to 11th row has NDC for Drug B. Similarly for patient 2, 12-17th row represent Drug A, 18-23rd row represents Drug C, 24-27th represent Drug D and row 28-30th represent switching back to Drug C.
... View more