I am having trouble understanding why " OR " is used instead of " AND " for Step 3. The Question Asked: Step 1: create a temporary data set, cleandata36. In this data set, convert all group values to upper case. Then keep only observations with group equal to 'A' or 'B'. Step 2: Determine the MEDIAN value for the Kilograms variable for each group (A,B) in the cleandata36 data set. Round MEDIAN to the nearest whole number. Step 3: create results.output36 from cleandata36 Ensure that all values for variable Kilograms are between 40 and 200, inclusively. If the value is missing or out of range, replace the value with the MEDIAN Kilograms value for the respective group (A,B) calculated in step 2. Step 1: data work.cleandata36;
set cert.input36;
group=upcase(group);
if upcase(group) in ('A','B');
run;
Step 2: proc means data=work.cleandata36 median;
class group;
var kilograms;
run;
Step 3: data results.output36;
set cleandata36;
if Kilograms < 40 OR Kilograms > 200 then do;
if group='A' then kilograms=79;
else kilograms=89;
end;
run;
... View more