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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
*Question.

>How do I put a question like this example into a Graph?
>
>What language do you speak?
>a. [ ] English
>b. [ ] Dutch
>c. [ ] French
>
>results are:
>survey    A        B      C
>1            0        1       1
>2            1        0       1
>3            0        1       0
>4            0        0       1
>5            1        1        1
>
>

* Answer: rlevesque@videotron.ca.

DATA LIST LIST /survey(F8) a(F8) b(F8) c(F8).
BEGIN DATA.
1 0 1 1
2 1 0 1
3 0 1 0
4 0 0 1
5 1 1 1
END DATA.
LIST.

* First method.
GRAPH
  /BAR(SIMPLE)= SUM(a) SUM(b) SUM(c)
  /MISSING=VARIABLEWISE .

* 2nd method.
DO IF (a=1)&(b=1).
COMPUTE ab=1.
COMPUTE a=0.
COMPUTE b=0.
ELSE IF (a=1)&(c=1).
COMPUTE ac=1.
COMPUTE a=0.
COMPUTE c=0.
ELSE IF (b=1)&(c=1).
COMPUTE bc=1.
COMPUTE b=0.
COMPUTE c=0.
ELSE IF (a=1)&(b=1)&(c=1).
COMPUTE abc=1.
COMPUTE a=0.
COMPUTE b=0.
COMPUTE c=0.
END IF.
GRAPH
  /BAR(SIMPLE)= SUM(a) SUM(b) SUM(c) SUM(ab) SUM(ac) SUM(bc) SUM(abc) 
  /MISSING=VARIABLEWISE .