Question: Use a DATA step to create a permanent working SAS data set of nhanes1718_sub called nhanes. Within this DATA step, use a series of
Use a DATA step to create a permanent working SAS data set of "nhanes1718_sub" called "nhanes". Within this DATA step, use a series of IF-THEN-ELSE-IF statements (IF-THEN logic) to create the following new variables: 1. Recode all invalid values (ie., 77, 99) to numeric ". " missing for the variables DMDBORN4, and DMDMARTL. 2. Create a new categorical variable called "age_cat" for age (RIDAGEYR) with the following 5 categories: 1 = 0-19, 2 = 20-39, 3 = 40-59, 4 = 60-79, 5=80+. This new variable should be of the numeric type. (6 pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
