Task 2B: How to Use SAS Survey Procedures Code to Specify Sampling Parameters in NHANES I

The code needed to specify sampling design parameters using SAS Survey procedures is described below. In this example, the SAS Survey procedure, proc surveymeans, is used and the name of the dataset is BP_analysis_Data. Proc surveymeans is being used as a generic example, but the strata, cluster and weight statements apply to all SAS Survey procedures.


Step 1: Use data statement

When using SAS Survey procedures, the input dataset must be identified. However, the dataset does not have to be presorted by the sample design variables as it does in SUDAAN. Rather, the design variables — strata and PSU — are specified in subsequent steps.   


Step 2: Use strata statement

The strata statement names the variables that form the strata. For the NHANES I exercise, the variable that identifies the sample strata is named N1BM0194.


Step 3: Use cluster statement

The cluster statement names the variables that identify the clusters in a clustered sample design such as NHANES I. Since there is also a strata statement needed in NHANES I, clusters are nested within the strata by SAS Survey procedures.

In NHANES I the variable that represents the sample clusters is named N1BM0196 (primary sampling units or PSUs).


Step 4: Use weight statement

In this NHANES I exercise, 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 SAS Survey procedures is required for all NHANES analyses. It identifies the sample weight. In this example, the weight for all sample persons in stands 1-65 (N1BM0176) is used.


Summary: Sample SAS Survey procedures code for sorting and specifying sampling design parameters

The following table shows how to combine the statements described above to properly specify the sample design parameters and sample weights using SAS Survey procedures. The procedure, proc surveymeans, is used as an example, but the strata, cluster and weight statements can be used in the same manner for all SAS Survey procedures. The steps in this task identify the most basic statements used in SAS Survey procedures to account for the complex sample design of NHANES I. Additional procedure options can be added to these statements to customize the variance estimates, statistics and the output from your procedure to suit individual analytic needs. Please consult the SAS/STAT manual for specifications on the options for each SAS Survey procedure.


SAS surveymeans Procedure
Statements Explanation

proc surveymeans data=BP_analysis_Data;

by N1BM0194 N1BM0196;

Use the SAS Survey procedure, proc surveymeans, to calculate means and standard errors, and specify the data set (BP_analysis_Data).

stratum >=N1BM0194;

Use the stratum statement to specify the strata (N1BM0194) — this accounts for the design effects of stratification.

cluster N1BM0196 ;

Use the cluster statement to specify primary sampling unit (N1BM0196) — this accounts for the design effects of clustering.

weight N1BM0176;

Use the weight statement to account for the unequal probability of sampling, survey non-response and adjustments to population control totals. In this example, the weight for all sample persons in stands 1-65 is used (N1BM0176).

Reference: RTI (2004). SUDAAN User's Manual, Release 9.0 Research Triangle Park , NC: Research Triangle Institute



close window icon Close Window