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

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 Demo4_nh2, a dataset created in the Clean and Recode module. Proc descript is being used as a generic example, but these sampling design 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 Demo4_nh2 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 statements in SUDAAN

This statement immediately follows the sort statement. In this example, the proc descript statement is used.  In addition, the data option specifies Demo4_nh2 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 II to be used.   

As in the sort statement, the nest statement lists the stratum variable (N2AH0324) first, followed by the PSU variable (N2AH0326).

 

 

Step 4: Use weight statement in SUDAAN

In NHANES II, a sample weight is assigned to each sample participant.  The sample weight is a measure of the number of individuals in the target population that the sampled individual represents. Sample weights are needed to obtain unbiased estimates of population parameters when the sample participants are chosen with unequal probabilities (see module on Weighting for more details).

The weight statement in SUDAAN Survey procedures is required for all NHANES analyses. It identifies the sample weight. In this example, the examined sample weight (N2AH0282) is used.

 

Summary: Sample SUDAAN code for sorting and specifying sampling design parameters

The following table shows how to combine the statements described above to properly sort the data, and specify the sample design, design parameters, and sample weights. The procedure proc descript is being used as an example, but the design, nest and weight statements can be used in the same manner for all SUDAAN procedures. Additionally, other procedure options can be added to these statements to customize the analysis and output. Consult the SUDAAN manual for specifications on the options for each SUDAAN procedure.

 

Use the nest statement to specify the strata (N2AH0324) and PSU (N2AH0326) variables to account for the sample design.

SUDAAN descript Procedure
Statements Explanation

proc sort data=Demo4_nh2;

by n2ah0324 n2ah0326;

run ;

Use the SAS procedure, proc sort, to sort the data by the design parameters, strata (N2AH0324) and primary sampling units (N2AH0326), before running the procedure in SUDAAN.

proc descript data =Demo4_nh2 design= WR;

Use the proc statement to specify the SUDAAN procedure being used (proc descript here), the dataset (Demo4_nh2), and the sample design (with replacement — WR).

nest nh2ah0324 nhah0326;