The following programming statements are typically used to specify NHANES survey design parameters when using a SUDAAN procedure with NHANES data. As you will see, SUDAAN code used for these analyses has four key elements, which are explained below.
Code | Element |
---|---|
proc sort; by sdmvstra sdmvpsu ; run; |
Element 1 |
proc <SUDAAN procedure> design=WR ; |
Element 2 |
nest sdmvstra sdmvpsu ; |
Element 3 |
weight <appropriate sample weight variable>; |
Element 4 |
<more SUDAAN procedure syntax>; |
|
run; |
|
The four key elements of this code include:
This input data set must always be sorted in SAS (or some other data management software) by the special sampling design variables, SDMVSTRA and SDMVPSU, before conducting an analysis in SUDAAN. The data need to be sorted by stratum first (SDMVSTRA) and then by PSU (SDMVPSU).
The “design=WR” syntax tells SUDAAN to use the “with replacement (WR)” option as the design. The WR option is recommended when analyzing NHANES data.
The “nest SDMVSTRA SDMVPSU” statement tells SUDAAN the hierarchy of the sampling units – that is, PSU within strata. The nest statement is required to analyze NHANES data with the appropriate design option. As in the sort statement, the nest statement must list the stratum variable (SDMVSTRA) first followed by the PSU variable (SDMVPSU).
The “weight” statement tells SUDAAN which sampling weight variable to use. NHANES has a number of sample weights, each which is used for specific variables or subsets of data. For more information on sampling weights, see the “Overview of NHANES Survey Design and Weights” and the “Locate Variables” modules.
The elements in this example identify the most basic statements used in SUDAAN 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 SUDAAN manual for specifications on customized options.