Task 2b: How to Use Taylor Linearization Procedures to Calculate Variance in NHANES Using SAS Survey Procedures

The code needed to calculate variance estimates 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 Continuous NHANES, the variable that identifies the sample strata is named sdmvstra.


Step 3: Use cluster statement

The cluster statement names the variables that identify the clusters in a clustered sample design such as NHANES.  Clusters are nested within the strata.

In NHANES, the variable that represents the sample clusters is named sdmvpsu (masked PSUs).


Summary: Sample SAS Survey Procedure code specifying sampling design parameters

The following table shows how to combine the statements described above to properly specify the sample design parameters using SAS Survey procedures. In this example, the proc surveymeans procedure is used to calculate variance.  However, the strata and cluster statements can be used in a similar 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. 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 proc surveymeans Procedure
Statements Explanation
proc surveymeans data= BP_analysis_Data;

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

stratum sdmvstra;

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

cluster sdmvpsu;

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

Reference: SAS Institute Inc., SAS/STAT User's Guide, Version 9.1; see: Survey Means Procedure


close window icon Close Window