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 DS1. Proc descript is being used as a generic example, but the following statements apply to all SUDAAN procedures.
To carry out the appropriate SUDAAN design option for NHANES data, the data from DS1 must first be sorted by strata and then by PSU (i.e., sdmvstra first, followed by sdmvpsu, unless the data have already been sorted by PSU within strata). The proc sort procedure must be conducted in SAS before SUDAAN is used to run the analyses.
Data must always be sorted in SAS before doing analyses in SUDAAN. SDMVSTRA and SDMVPSU are found on the NHANES Demographic File.
The proc statement immediately follows the proc sort statement. In this example, the proc descript statement is used. In addition, the data option specifies DS1 as the SAS dataset being used and the design option specifies with replacement (WR) as the design.
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. See the Sample Design module for further explanation of design options in SUDAAN.
As in the sort statement, the nest statement lists the stratum variable (i.e., sdmvstra) first, followed by the PSU variable (i.e., sdmvpsu).
The following table shows how to combine the statements described above to properly calculate variance estimates. In this example, the proc descript procedure is used to calculate variance. However, the design and nest statements shown below can be used in a similar 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.
Statements | Explanation |
---|---|
proc sort data=DS1; run; |
Use the SAS procedure, proc sort, to sort the data by the design parameters, strata (sdmvstra) and primary sampling units (sdmvpsu), before running the procedure in SUDAAN |
Proc descript data=DS1 design=WR; |
Use the proc statement to specify the SUDAAN procedure being used (proc descript here), the data set (DS1), and the sample design (with replacement — WR). |
nest sdmvstra sdmvpsu; |
Use the nest statement to specify the strata (sdmvstra) and PSU (sdmvpsu) variables to account for the sample design. |
Reference: RTI (2004). SUDAAN User's Manual, Release 9.0 Research Triangle Park , NC: Research Triangle Institute
Close Window to return to module page.