The question :
- 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.
The answer is :
data results.output36;
set cleandata36;
if Kilograms < 40 or Kilograms > 200 then do;
if group='A' then kilograms=79;
else kilograms=89;
end;
run;
My question is that:
if Kilograms <40 or Kilograms > 200 then do;
else group='A' then kilograms=79;
didn't work.
My question is why I should not use 'else' in red. It is hard to understand. Thank you so much for your help.