I am trying to follow the instructions for linking the medication round fill records with condition records for MEPS. The first step is as follows:
IPUMS MEPS staff encourage users to first either 1) summarize medication-round fill records to the medication-round level or 2) reshape medication-round fill records from long to wide so that each prescribed medicine fill associated with a given medication-round record (MEPSLINKIDM) is on the same record line. This is because multiple medication-round fill records can be associated with multiple condition records, resulting in a many-to-many merge when linking these records together.
I am attempting to do the second option. I have set up the medication-record fill data by filtering my hierarchical dataset to the RECTYPE == F in R and removed any of the columns where all the values are NA. When I do this, it removes the MEPSLINKIDM column. How then am I supposed to reshape my data from long to wide so that 'each prescribed medicine fill associated with a given medication-round record (MEPSLINKIDM) is on the same record line? " Is there something I’m missing here? It’s also unclear how I might approach the first option, since the MEPSLINKIDM column seems important for summarizing up to the medication-round level.