I would like to create a table with selected data only. I have tried 3 approaches, with issues on each:
(1) Case summaries
I am using SPSS>Analyze>Reports>Case Summaries to create an
output that shows specific variables (listed here as VAR1, VAR2, VAR3)
by ID (listed as ID). However, I cannot get the output to show the data
with the ID on the same row as the value for the variables. ID is
printed one row higher than the data that corresponds to that ID for all
variables (but all the variables are on the same row). This creates a
lot of extra work to cut/paste/align the output, which I will have to do
repeatedly given the nature of the analysis.
The syntax I am using is:
SORT CASES BY ID (A).
Report
/FORMAT=CHWRAP(ON) PREVIEW(ON) CHALIGN(TOP) UNDERSCORE(OFF)
ONEBREAKCOLUMN(OFF) CHDSPACE(1)SUMSPACE(0) AUTOMATIC LIST BRKSPACE(0)
PAGE(1) MISSING'.' LENGTH(1, 39) ALIGN(CENTER) TSPACE(1) FTSPACE(10)
MARGINS(1,185)
/TITLE=RIGHT 'Page )PAGE'
/VARIABLES
VAR1 (VALUES) (RIGHT) (OFFSET(0)) (8)
VAR2 (VALUES) (RIGHT) (OFFSET(0)) (8)
VAR3 (VALUES) (RIGHT) (OFFSET(0)) (8)
/BREAK ID (LABELS) (RIGHT) (OFFSET(0)) (8).
(2) Export
I know I could export the entire dataset and then keep the variables of interest, but I need the labels rather than the variable names printed and the export only seems to
output variable names).
(3) OMS
The syntax below does not record the table (just notes, but there is no other option when selecting 'Report').
* OMS.
DATASET DECLARE test.
OMS
/SELECT TABLES
/IF COMMANDS=['Summarize'] SUBTYPES=['Case Processing Summary']
/DESTINATION FORMAT=SAV NUMBERED=TableNumber_
OUTFILE='test' VIEWER=YES
/TAG='ID'.
SORT CASES BY ID (A).
Report
/FORMAT=CHWRAP(ON) PREVIEW(ON) CHALIGN(TOP) UNDERSCORE(OFF) ONEBREAKCOLUMN(OFF) CHDSPACE(1)
SUMSPACE(0) AUTOMATIC LIST BRKSPACE(0) PAGE(1) MISSING'.' LENGTH(1, 39) ALIGN(CENTER) TSPACE(1)
FTSPACE(10) MARGINS(1,185)
/TITLE=RIGHT 'Page )PAGE'
/VARIABLES
VAR1 (VALUES) (RIGHT) (OFFSET(0)) (8)
VAR2 (VALUES) (RIGHT) (OFFSET(0)) (8)
VAR3 (VALUES) (RIGHT) (OFFSET(0)) (8)
/BREAK ID (LABELS) (RIGHT) (OFFSET(0)) (8).
omsend tag = ['ID'].
**Is there a way to output data from SPSS showing IDs and corresponding variable values in the same row?**
#SPSSStatistics#Support#SupportMigration