In this example, we save the XTAB output into a SAV file:
* Created data for example.
data list free /row col n.
begin data.
1 1 23
1 2 13
1 3 21
2 1 35
2 2 31
2 3 15
3 1 37
3 2 43
3 3 21
end data.
weight by n.
* Use OMS to get cells.
OMS SELECT TABLES /IF SUBTYPES='Crosstabulation'
/DESTINATION FORMAT=SAV OUTFILE='/Users/rick/tmp/test.sav'.
CROSSTABS
/TABLES=row BY col /FORMAT=AVALUE TABLES /CELLS=COUNT
/COUNT ROUND CELL.
OMSEND.
* Get that file and keep only what is needed.
GET FILE '/Users/rick/tmp/test.sav' /drop Command_ to Label_ Var3.
SELECT IF Var2 ne ''.
EXECUTE.
* If you want the cells all in one observation...
CASESTOVARS /ID=Var1 /GROUPBY=VARIABLE.
------------------------------
Rick Marcantonio
Quality Assurance
IBM
------------------------------
Original Message:
Sent: Wed December 15, 2021 06:26 PM
From: Michael Sytsma
Subject: Crosstab cells as variables
I have run a 3x3 crosstab on two of my variables with each subject landing in one of the 9 cells. What is the quickest way to assign their cell as a variable so I can group them by cell and compare mean differences of other variables for those in each cell?
Thanks so much in advance.
------------------------------
Michael Sytsma
------------------------------
#SPSSStatistics