SPSS Numeric Functions
Apart from arithmetic operators, SPSS also offers a library of built-in numeric functions.
Contents
Range
the RANGE function takes a variable and 1 or more pairs of low-high value pairs. It returns 1 for all cases with a value within the inclusive range of low to high.
data list free / ID (F2) Score (F2). begin data 1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80, 9, 90 end data. compute InRange=range(Score,30,40,70,80). list all.
ID |
Score |
|
1 |
10 |
0 |
2 |
20 |
0 |
3 |
30 |
1 |
4 |
40 |
1 |
5 |
50 |
0 |
6 |
60 |
0 |
7 |
70 |
1 |
8 |
80 |
1 |
9 |
90 |
0 |