Date: Wed, 7 Jul 2004 17:56:38 -0400
Reply-To: Richard Ristow <wrristow@mindspring.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <wrristow@mindspring.com>
Subject: Variable Label Length
In-Reply-To: <06F4FFE29EF3454D86A2E43487DC287B046F9016@hqemail1.spss.com >
Content-Type: text/plain; charset="us-ascii"; format=flowed
Our story so far:
At 09:12 AM 7/6/2004, Ja Bower wrote:
>Can the variable label size be increased from the default 256 characters?
>If so, how is this accomplished?
To which, at 09:43 AM 7/6/2004, Hector Maletta added:
>What is really needed in SPSS is not exactly longer labels, [...] but
>complete variable documentation, i.e. [a] record for each variable where
>one can put details about the way the variable was defined or computed.
>[Currently] one is forced to keep the [computations] elsewhere (normally
>buried in some syntax file).
Even 256 characters is unwieldy in the output listing. (Have you looked at
CROSSTABS output lately? 40 characters is unwieldy, and 20 is marginal.)
Long labels would work better with meta-syntax for line-break points:
VARIABLE LABELS TGT_BWGT 'Target infant%birth weight,%grams'.
Variable label:
Target infant
birth weight,
grams
Myself, I'd like *shorter* variable labels. (Can't you define them as short
as you want already?) I mean short forms, with long ones for the same
variables; the short forms would label, e.g., CROSSTAB rows. Suggested
syntax: if the label starts with a non-alphanumeric character, e.g. "/",
it's a delimiter and everything following is part of the long variable
label; everything up to the next "/" is the short variable label. If,
instead, there following delimiter is doubled ("//"), the short label is
up to the doubled delimiter and the full label is only what follows.
Example:
VARIABLE LABELS TGT_BWGT '/Birth wt./ of target infant, grams'.
Full label: Birth wt. of target infant, grams
Short label: Birth wt.
VARIABLE LABELS TGT_BWGT '/Tgt brth wt//Birth wt. of target infant, grams'
Full label: Birth wt. of target infant, grams
Short label: Tgt brth wt
Saving syntax that defines variables
------------------------------------
Not easy. It could be done,
. MANUALLY: Store the syntax either in DOCUMENT or in a DOCUMENT-like
area that's an attribute of the variable
- Ouch! Nothing would be easier than to copy the syntax wrong; easier
still, to change the syntax that is executed,
. AUTOMATICALLY:
- How can SPSS identify "the way the variable was defined or computed"? A
variable can be computed in widely separated places in the syntax; it can
be computed in one place, changed in another. It can be computed based on
other computed variables which may be dropped from the output file, or
based on scratch variables. I suppose you'd want the whole path back to the
input (DATA LIST or GET FILE). In a 'functional' or 'single-assignment'
transformation language, this might work; in a procedural one like SPSS, I
don't think so.
. SEMI-AUTOMATICALLY: This might work: have syntax commands (VARIABLE
CODE/END VARIABLE CODE) to identify the syntax one determines is relevant
to a variable. Only one such block per variable, which would encourage
locality in coding! However, one VARIABLE CODE should be able to name
several variables, for, DO IF, DO REPEAT, or LOOP structures that compute
several variables inextricably.
It's not bad to have code "buried in some syntax file", *IF* the syntax
file is identified. To start with, the syntax and .SAV file can, and
should, have the same name. And DOCUMENT is good for this. Here's from one
of mine (I'm not always this careful):
display document.
File Information
DOCUMENT CohBase.SAV is a base or "anchor" dataset for the
Healthy Families, Indiana, study cohort. Main source is
- 'CRFA DATA before select ifs and additional recodes.sav'
- (created 08 Apr 2001 12:03:36 by HFI);
Earliest and latest family [service] levels are from
- 'C_FL Feb 23.sav' (created 23 Feb 2001 13:04:29)
-
Program: c:\B_Client\HFI\JM01\CohBase.SPS
Program and file by W. R. Ristow, 21 Nov 2002.
(Entered 21 Nov 02)
REMARKS:
A. It can be useful to add address, etc. of the programmer, and name and
address of the investigator
B. I use leading "-" characters to 'indent' lines, and insert 'blank'
lines. (Do *NOT* end any line but the last with a period; use a trailing
"-", or something, if necessary.)
C. I give no description of the logic (which would be lengthy and
error-prone), but refer to the syntax file, including version date. (When I
revise the syntax file, I do a global change for the version date, covering
headers, DOCUMENT, etc.)
However, if one were clicking up a simple set of transformations, it would
make sense to then select the syntax from the journal file and paste it
into a DOCUMENT statement before saving the file.
FILE LABEL
----------
I recommend FILE LABELS, but this file doesn't have one. I don't know why,
me as there's one in the syntax:
[...]
COMPUTE FAMKEY = COUNTY*1000000+ #NUM_PGM*100000 + FAMILY#.
FILE LABEL 'CohBase.SAV: HFI cohort base data'.
DOCUMENT CohBase.SAV is a base or "anchor" dataset for the
[...]
|