Task 3: How to Merge and Append NHANES Data for PAXRAW Analyses

To merge and append NHANES data for the PAX analysis, you will need to:

Sort Data Files by a Unique Identifier

The first step in merging data is to sort each data file by a unique identifier. Each study participant is assigned a unique identifier, represented by the variable SEQN. Use the PROC SORT procedure to sort the DEMO and PAXRAW files by the SEQN variable. In this segment of code, we use the “out” statement to store the sorted dataset to the SAS temporary library titled ‘WORK’. You can explore the WORK library by accessing the SAS Explorer and navigating to “Libraries”.

Sample Code

proc sort data = demo_c.demo_c out = demo_c;
by seqn;
run ;

proc sort data = paxraw_c.paxraw_c out = paxraw_c;
by

seqn;