Task 2a: How to Use SUDAAN Code to Specify Sampling Parameters in NHANES

Once data are sorted in SAS, SUDAAN can be used to specify the sampling design parameters.  In this example, the SUDAAN procedure, proc descript, is used and the name of the dataset is BP_analysis_Data.  Proc descript is being used as a generic example, but these statements apply to all SUDAAN procedures.

 

Step 1: Sorting in SAS

To carry out the appropriate SUDAAN design option for NHANES data, the data from BP_analysis_Data must be sorted by strata first and then PSU (unless the data have already been sorted by PSU within strata). The SAS proc sort statement must precede the SUDAAN statements.

warning iconWARNING

Data must always be sorted in SAS before doing analyses in SUDAAN.

 

Step 2: Use proc statement in SUDAAN

This statement immediately follows the sort statement. In this example, the proc descript statement is used.  In addition, the data option specifies BP_analysis_Data as the SAS dataset being used and the design option specifies with replacement (WR) as the design.

 

 

Step 3: Use nest statement in SUDAAN

The nest statement lists the variables that identify the strata and the PSU.  The nest statement is required for the appropriate design option for NHANES to be used.