1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
*Select a random sample of n males and females.
* Raynald@spsstools.net

DATA LIST FREE /sex(F8).
BEGIN DATA.
1 2 2 1 2 2 2 2 1 1 1 2 2 1 1 2
END DATA.
LIST.

COMPUTE id=$casenum.
COMPUTE draw=UNIFORM(1).
RANK draw BY sex.
* the following line will select a random number of 5 males and 5 females, change 5 to the number you need.
SELECT IF (rdraw<=5).
LIST.