1
 2
 3
 4
 5
 6
 7
 8
 9
10
* Question: I need a new variable which will equal 1 for cases whose value of 
salary is in the top 95%.

* Answer posted to SPSSX-L by rlevesque@videotron.ca on 2001/06/14.

GET FILE='C:\\Program Files\\SPSS\\employee data.sav'.
RANK
  VARIABLES=salary /PERCENT INTO pctest /TIES=MEAN .
COMPUTE group1=pctest>=95.
FREQ VAR=group1.