Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Syntax for labelling or adding a title to a frequency, crosstab, etc. SPSS 15

1,172 views
Skip to first unread message

Amy L

unread,
Mar 22, 2007, 12:18:48 PM3/22/07
to
I've searched and looked through help but can't seem to figure this
out. I want to add a title to the output. For example, I Idenified
Duplicates and I want the title to say something like "Duplicate
Referrals" instead of "Indicator of each first matching case as
Primary".

I'd like to be able to do this for any table.

Thanks.

mcap

unread,
Mar 23, 2007, 8:58:21 PM3/23/07
to

Try this....a little cumbersome but it works. VAR is the variable you
are using for identifying the duplicates.


* Identify Duplicate Cases.
SORT CASES BY VAR(A) .
MATCH FILES /FILE = * /BY VAR
/LAST = duplicates .
VARIABLE LABELS duplicates 'Duplicate Referrals'
.
VALUE LABELS duplicates 0 'Duplicate Case' 1 'Primary Case'.
VARIABLE LEVEL duplicates (ORDINAL).
FREQUENCIES VARIABLES = duplicates .
EXECUTE.

mcap

unread,
Mar 23, 2007, 9:06:27 PM3/23/07
to

For other procedures you will have to use the OMS - I think.

Marc

Art Kendall

unread,
Mar 24, 2007, 8:59:15 AM3/24/07
to
If you mean the VAR LABEL for the variable PrimaryFirst created by the
menu item to find duplicate cases, give the variable a new label.

VAR LABELS PrimaryFirst 'Duplicate Referrals'.

If this is not what you are looking for please give more detail about
what table and "title" you are discussing.

Art Kendall
Social Research Consultants

mcap

unread,
Mar 24, 2007, 10:18:09 AM3/24/07
to
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

I think she wants to label the output table and not the new
variable..........not sure....

Marc

Art Kendall

unread,
Mar 24, 2007, 11:17:09 AM3/24/07
to
Reading between the lines that is what I thought at first. However, the
string she used for the old "title" were exactly the var label
assigned to the variable PrimaryFirst created by the menus.

Art

Elaine

unread,
Mar 24, 2007, 1:38:55 PM3/24/07
to

Have you tried the SUBTITLE command?

In a syntax file
SUBTITLE Duplicate Referrals
will ensure that that label is displatyed at the top of each output,
until tne next SUBTITLE command is encountered.

Or - if you are not into using syntax commands, open the output file
(the viewer window). Then select Page Setup from the File pulldown
menu, click on the Options button and add in whatever title you like
as a page header or footer

Amy L

unread,
Mar 28, 2007, 11:39:18 AM3/28/07
to
I've been away from my work computer for a few days so I'm just
looking at this again. I do "cut and paste" syntax so I often don't
really understand what I'm looking at but after looking more closely I
got part of it figured out. I did want to label the output table. The
variables were already named. Here is what I was originally having
problems with:

SORT CASES BY SS#(A) DateRecd(A) .
MATCH FILES /FILE = * /BY SS#
/FIRST = Duplicate_Referrals /LAST = PrimaryLast.
DO IF (Duplicate_Referrals).
COMPUTE Referral_Number = 1 - PrimaryLast.
ELSE.
COMPUTE Referral_Number = Referral_Number + 1.
END IF.
LEAVE Referral_Number.
FORMAT Referral_Number (f7).
COMPUTE InDupGrp = Referral_Number > 0.
SORT CASES InDupGrp(D).
MATCH FILES /FILE = * /DROP = PrimaryLast InDupGrp.
VARIABLE LABELS Duplicate_Referrals 'Indicator of each first matching
case as'+
' Primary'
Referral_Number 'Duplicate Referrals' .
VALUE LABELS Duplicate_Referrals 0 'Subsequent Referral' 1 'First
Referral'.
VARIABLE LEVEL Duplicate_Referrals (ORDINAL)
/Referral_Number (SCALE).
VALUE LABELS Referral_Number 0 'First & Only' 1 'First' 2 'Second' 3
'Third' 4 'Fourth' 5 'Fifth' 6 'Sixth' 7 'Seventh'.
FREQUENCIES VARIABLES = Duplicate_Referrals Referral_Number .
EXECUTE.

Where it says "Referral_Number" is where I needed to label the output.
It was originally 'Sequential count of matching cases' .

For crosstabs or frequencies I've tried using either TITLE or SUBTITLE
but I can't seem to get it to put it where I want it. This is not such
a big deal because the title is the variables which is understandable.
The title for the following is "ESCounselorName * ESAgency
Crosstabulation". If I wanted to change it, I'm not sure how to do
that. But again, it was the previous one that was more of a problem.

CROSSTABS
/TABLES=ESCounselorName BY ESAgency
/FORMAT= AVALUE TABLES
/CELLS= COUNT
/COUNT ROUND CELL .

0 new messages