Hello all, I'm working on a project using NHANES and trying to merge datasets. One dataset (MEDS) lists medications patients are taking as individual observations, all with a common variable SEQN that is a unique identifier for individual patients. In order to merge the datasets I must convert this drug-level data to patient-level data using the SEQN variable in a format that retains the variables RXDDRGID, RXDDRUG, and RXDUSE from the MEDS dataset without having redundant observations in my combined dataset merged by SEQN. I encountered this document which appears to have the right information but frankly it's way over my head. So far, I have read that the proc summary procedure may be the best way and this is what I have: proc summary nway data=NHANES.MEDS; class SEQN RXDDRGID RXDDRUG RXDUSE; id SEQN RXDDRGID RXDDRUG RXDUSE; output out=NHANES.FIXEDMEDS; run; but this is returning a dataset with the right variables but too many observations. I am very new to SAS so any help would be greatly appreciated!
... View more