Let's say I have data that look like this:
DATA temp;
INPUT id a1 b2 d1 f8;
DATALINES;
1 2.3 2.1 4.2 1.2
2 5.3 2.3 1.5 3.2
3 1.2 5.4 6.6 6.6
;
run;
What I want to do is use the data and set statements to say that if the values in a1 and f8 are less than the means of a1 and f8 (respectively), then those values are missing. So the resulting dataset would look like:
id a1 b2 d1 f8
1 . 2.1 4.2 .
2 5.3 2.3 1.5 .
3 . 5.4 6.6 6.6
Any tips for how I would start on this? I'm new to SAS and the examples in the manuals have not been very helpful. I had been thinking of something like this (but it doesn't work):
DATA temp2;
SET temp;
IF a1 < mean(a1) THEN a1=.;
IF f8 < mean(f8) THEN f8=.;
RUN;