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 allgroupvalues to upper case.
Then keep only observations withgroupequal to 'A' or 'B'.
Step 2:
Determine the MEDIAN value for theKilogramsvariable for eachgroup (A,B) in thecleandata36data set. Round MEDIAN to the nearest whole number.
Step 3:
createresults.output36fromcleandata36
Ensure that all values for variable Kilogramsare between 40 and 200, inclusively.
If the value is missing or out of range, replace the value with the MEDIANKilogramsvalue for the respectivegroup(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;
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.