Task 1: How to Identify and Recode Missing Data

In this task, you will use the PROC MEANS procedure to check for missing, minimum, and maximum values of continuous variables, and the PROC FREQ procedure to look at the frequency distribution of categorical variables in your analytic dataset. The output from these procedures provides the number and frequency of missing values for each variable listed in the procedure statement. In this example, you will check for missing values as well as minimum and maximum values for the urinary phthalate metabolite and urinary creatinine variables.

Warning iconThe steps below assume that you are already familiar with the SAS code used to identify and recode missing data in NHANES datasets. If you need more detailed instructions, please review the Clean & Recode Data module in the Continuous NHANES Web Tutorial before continuing.

 

Phthalate Data (1999–2004):

Step 1: Identify Missing Values for Continuous Variables Using PROC MEANS

Program to Identify Missing Values Using PROC MEANS

proc means data =Phthalate N Nmiss min max maxdec = 2;

      where WTSPH6YR> 0;

      var URDMHPLC URXMHP;

run ;

 

Step 2: Identify Missing Values for Categorical Variables Using PROC FREQ

Program to Identify Missing Values Using PROC FREQ

proc freq data =Phthalate;

      where WTSPH6YR> 0;

      table URDMHPLC/ missing ;

 

proc freq data =Phthalate;

      where WTSPH6YR> 0;

      table SDDSRVYR*URDMHPLC/ missing list ;

run ;

 

Additional Resources

 

 

 

close window icon Close Window