Task 4: How to Recode variables Based on Alternate Definitions

This task reviews how to recode variables so they are appropriate for your analytic needs and how to check your derived variables.

 

Step 1: Recode based on alternate definitions

Recoding is an important step for preparing an analytical dataset.  In this step, you will view programs that recode variables using different techniques for each of the scenarios listed on the Clean & Recode Data: Key Concepts about Recoding Variables in NHANES III page. In the summary table below, each statement required for recoding is listed on the left with explanations on the right. 

 

Program to Recode as Necessary Based on Alternate Definitions
Statements Explanation

data demo4_nh3;

      set demo3_nh3;

Use the data and set statements to refer to your analytic dataset.

if hfa8r>= 0