Using Median and Standard Deviation in syntax


New Member

I'm quite new to SPSS and am looking to code my data records by whether or not they are within 1 standard deviation of the median for that variable.

So far I have been doing this for each variable:

DO IF (HumanIL21Normalised GE -1.6336 AND HumanIL21Normalised LE 0.3664).
COMPUTE OutsideSD = 1.
COMPUTE InsideSD = 0.
Here, (Median of HumanIL21Normalised - 1 Standard Deviation of HumanIL21Normalised) = '-1.6336' and the other value is + 1 Standard Deviation.

I want to have the syntax be able to calculate the values here without me having to manually work out the median and standard deviation. Is there a way to do this?

The purpose of this is so that I can split data into high and low groups after removing records within one standard deviation of the median.