1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
* Expand Crosstab Data into Original Data File.
* This can be useful if for instance you have printed tabulated data but the Chi square stats are not available.
* Assume the crosstab it is a 2 x 2 table (same approach works for n x n tables).
* Ray.

DATA LIST LIST /var1(A8) var2(A8) nb(F8.0).
BEGIN DATA
a c 3
a d 4 
b c 4
b d 2
END DATA.
LIST.

* Method 1: Create the cases.
LOOP cnt=1 TO nb.
XSAVE OUTFILE='c:\\temp\\temp.sav' /KEEP=var1 TO var2.
END LOOP.
EXECUTE.
GET FILE='c:\\temp\\temp.sav'.
LIST.

* Method 2: if you do not need the actual cases.
WEIGHT BY nb.