Task 4a: How to Recode Variables Based on Alternate Definitions Using SAS

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 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 demo_BP3;

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