PROC MEANS DATA=BIO.PULSE_STEP3 N MAX MIN;
VAR BMI;
RUN;
/* The dataset has the formats below permanently assigned to certain variables.
We do NOT need to rerun the DATA step used to assign the formats however
we DO need to resubmit the PROC FORMAT so SAS will know the translations used */
PROC FORMAT;
VALUE GDR 1 = "Male"
2 = "Female";
VALUE YN 1 = "Yes"
2 = "No";
VALUE EXER 1 = "High"
2 = "Moderate"
3 = "Low";
VALUE TREAT 1 = "Ran"
2 = "Sat";
/* Added in THIS tutorial */
VALUE BMI_TWO 1 = "< 25"
2 = "25+";
VALUE BMI_FOUR 1 = "< 18.5"
2 = "[18.5, 25)"
3 = "[25, 30)"
4 = "30+";
RUN;
DATA BIO.PULSE_STEP4;
SET BIO.PULSE_STEP3;
/* BINARY BMI */
IF 15 <= BMI < 25 THEN BinaryBMI = 1;
IF 25 <= BMI <= 33 THEN BinaryBMI = 2;
/* Multi-level BMI */
IF 0 < BMI < 18.5 THEN BMIGroups = 1;
IF 18.5 <= BMI < 25 THEN BMIGroups = 2;
IF 25 <= BMI < 30 THEN BMIGroups = 3;
IF 30 <= BMI <= 33 THEN BMIGroups = 4;
LABEL BinaryBMI = "Binary Body Mass Index"
BMIGroups = "Body Mass Index Categories";
FORMAT BinaryBMI BMI_TWO.
BMIGroups BMI_FOUR.;
RUN;
PROC PRINT DATA=BIO.PULSE_STEP4(OBS=10);
RUN;
PROC FREQ DATA=BIO.PULSE_STEP4;
TABLES BinaryBMI BMIGroups;
RUN;