Suppose I have a list of items with the same response format (e.g., 1:
Strongly Agree to 5; Strongly Disagree). What I need a frequency table
with items (variables) as the rows, and responses (1 to 5) as the
columns, and the cells being the frequency counts.
I can construct the table in Excel from tables from other procedures
(e.g., frequency tables, crosstab tables, etc.). However, I wonder
whether I can generate this as one single table in SPSS.
I tried OMS, and these are the commands:
DATASET DECLARE Test.
OMS
/SELECT TABLES
/IF COMMANDS=['Frequencies'] SUBTYPES=['Frequencies']
/DESTINATION FORMAT=SAV NUMBERED=TableNumber_ OUTFILE='Test'
/COLUMNS SEQUENCE =[R1].
Freq Q1 Q2 Q3.
OMSEND.
All items have the same values labels. If I have only one column for
each response for all items, then I can simply select rows with Var1 =
"Frequency" and get what I need. However, in the generated data file,
one set of response is generated for each item. In other words, I have
five columns for Q1's five responses, five columns for Q2's five
responses, and five columns for Q3's five responses.
How should I modify the commands? Or is there any existing SPSS
command that can generate what I need?
Thanks. ^_^
--
Shu Fai
If you do this in the custom tables dialogue, under 'category
position', just click 'row labels in column'.
Unfortunately, it seems that the university I work at does not have
the license for the Tables add-on.
Therefore, I need to rely on Base module and OMS.
I now remember that I might have done the task using the Report
command. I'll check tonight.
-- Shu Fai
>Thanks. :)
>
>Unfortunately, it seems that the university I work at does not have
>the license for the Tables add-on.
>
>Therefore, I need to rely on Base module and OMS.
>
>I now remember that I might have done the task using the Report
>command. I'll check tonight.
>
>-- Shu Fai
>
>On 10?20?, ??5?03?, Kenny M <no...@nowhere.com> wrote:
>>
>> If you do this in the custom tables dialogue, under 'category
>> position', just click 'row labels in column'.
I posted a macro routine for doing similar tabulations about
10 years ago. This used Flip and Count in the macro.
I Googled < coltab ulrich > (without even going to Groups),
and the first hit was a post that included the routine. Try
http://listserv.uga.edu/cgi-bin/wa?A2=ind9810&L=spssx-l&D=0&P=6745
- if you want to see if it is something you could use or adapt.
--
Rich Ulrich
--
Shu Fai
Basically, the frequency tables are output to a SAV file "as is", and
then use CASETOVARS
to restructure this SAV file.
---
DATASET DECLARE Test.
* In this OMS, instead of listing frequencies in columns, the format
like the original frequency tables is used.
OMS
/SELECT TABLES
/IF COMMANDS=['Frequencies'] SUBTYPES=['Frequencies']
/DESTINATION FORMAT=SAV NUMBERED=TableNumber_ OUTFILE='Test'
/COLUMNS SEQUENCE =[C1].
Freq Q01 Q02.
OMSEND.
* The following command removes the first three variables, having the
same value for all rows.
Delete variables TableNumber_ Command_ Subtype_.
* This command is necessary to convert blank in Var2 for the last row
of total frequency to something else.
If (Var2 = '') Var2 = 'Grand'.
SORT CASES BY Label_ .
CASESTOVARS
/ID=Label_
/INDEX=Var1 Var2
/GROUPBY=VARIABLE.
---
The resulting data file will have one row for each table (item). I can
then select those columns I need easily.
The above commands assume that the values or value labels in the
frequency tables can be converted to
SPSS variable names. This should not be a problem if SPSS is set to
display numeric values instead of
value labels in pivot tables.
Best Regards,
Shu Fai