Task 1b: How to Specify the Survey Design to Obtain Appropriate Variance Estimates Using SAS

The following programming statements are typically used to specify NHANES survey design parameters when using a SAS procedure with NHANES data.  As you will see, any SAS code used for these analyses has four key elements, which are explained below.  Note that the four elements used in SAS are different than those in SUDAAN.

 

 

Template for Specifying the Survey Design in SAS

Code Element
proc <SAS procedure> data = <dataset name>;

Element 1

         strata sdmvstra ;

Element 2

          cluster SDMVPSU ;

Element 3

         weight <appropriate sample weight variable>;

Element 4

         <more SAS procedure syntax>;

 

run;

 

 

The four key elements of this code include:

Element 1

The dataset must be identified when using the SAS survey procedures. However, the dataset does not have to be presorted by the sample design variables as it does in SUDAAN.

 

Element 2

The “strata” statement names the variable that forms the strata.

 

Element 3

The “cluster” statement names the variables that identify the clusters (i.e., PSU), which are nested within the strata.

 

Element 4

The “weight” statement tells SUDAAN which sampling weight variable to use. For more information on sampling weights, see the “Overview of NHANES Survey Design and Weights” and the “Locate Variables” modules.

 

Info iconIMPORTANT NOTE

To calculate the variance appropriately, one of the SAS survey procedures must be used, instead of the standard SAS procedures for simple random samples. The elements in this example identify the most basic statements used in SAS to account for the complex sample design of NHANES (i.e. strata, PSUs and weights). Additional options can be added to these statements to customize the variance estimates, statistics, and the output to suit individual analytic needs. Please consult the SAS manual for specifications on customized options.

 

close window icon Close Window to return to module page.