1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
* How to put 4 variables in increasing order in the same FREQ table.

* Posted to usenet on 2001/04/04.
* rlevesque@videotron.ca.

DATA LIST LIST /id sigaret sigar pipe shag.
BEGIN DATA
1 1 1 0 1
2 0 1 0 1
3 0 1 0 0 
4 0 1 0 0 
END DATA.
LIST.
VALUE LABELS sigaret TO shag 0 'No' 1 'Yes'.
* Basic Tables.



VECTOR v=sigaret TO shag.
LOOP #cnt=1 TO 4.
COMPUTE smoke=v(#cnt)*#cnt.
XSAVE OUTFILE='c:\\temp\\temp.sav' /KEEP=id smoke.
END LOOP.
EXECUTE.
GET FILE='c:\\temp\\temp.sav'.
VALUE LABEL smoke 1 'sigaret' 2 'sigar' 3 'pipe' 4 'shag'.

TEMPORARY.
SELECT IF smoke<>0.
FREQUENCIES
  VARIABLES=smoke
  /FORMAT=DFREQ
  /ORDER=  ANALYSIS .