Merging Hierarchical and Rectangular Data

Hi,

I am trying to match Diagnosis codes from MEPS (hierarchical data) with limited demographic information (age and sex). The listed IDs in the hierarchical files do no match the IDs in the rectangular. Is there a way to merge these? Am I erring in someway?

Thank you!

It sounds like you are trying to merge data on the condition record (condition codes ICD10CODE/ICD9CODE) with demographic data on the person record. These two record types can be linked using the unique person-level identifier MEPSID and MEPSIDX, the same person-level identifier as reported on the condition record.

Note that it is possible to include both person-level and condition-level records in a single file from IPUMS MEPS by selecting a hierarchical file type and adding variables from these record types. For instance, if you request an extract with the variables AGE, SEX, and the above condition codes, your extract will include all of these in a single data file, where the condition record will be nested under the corresponding person record. In the screenshot below (copied from the extract structures note from our user guide), the hierarchical data file nests the condition records (RECTYPE = X), event records, and round records under the person record that they correspond to.