Date: Fri, 21 Apr 2006 18:24:41 -0500
Reply-To: "Oliver, Richard" <roliver@SPSS.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Oliver, Richard" <roliver@SPSS.COM>
Subject: Re: Combining categories with Recode
Content-Type: text/plain; charset="iso-8859-1"
Minor clarification (since the dreaded Appendix A might not be clear on this point):
The Value Labels command takes effect immediately. The command doesn't read the data, but it doesn't require some other command to read the data either, since all it does is alter the dictionary. But even if its behavior was similar to that of Recode, its results would still be available for the subsequent Crosstabs command. For example:
recode var1 (lo thru 5 = 1) (lo thru 10 = 2) (else=sysmis).
recode var2 (lo thru 10 = 1) (lo thru 20 = 2) (else=sysmis).
value labels var1 var2 1 "Low" 2 "High".
crosstabs tables=var1 by var2.
This should produce a 2x2 table, and assuming value labels are displayed, both the rows and columns will be labeled "Low" and "High".
Another command that alters the dictionary and takes effect immediately is Missing Values, which can sometimes lead to results you perhaps did not expect.
-----Original Message-----
From: SPSSX(r) Discussion on behalf of Peck, Jon
Sent: Fri 4/21/2006 4:23 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: Combining categories with Recode
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Bob Schacht
Sent: Friday, April 21, 2006 2:34 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: [SPSSX-L] Combining categories with Recode
[snip]
[>>>Peck, Jon] Value Labels is not a procedure. It does not pass the data. This is spelled out in the dreaded Appendix A of the Command Syntax Reference.
Thanks. This is, in essence, what I wound up doing.
BTW, is the "value labels" command considered as a procedure? In other
words, can I slip in a value labels command between the Recode and the
Crosstab so that the Crosstab procedure will be processed using both Recode
and Value labels modifications?
------------
[>>>Peck, Jon] The power for this already exists in Ctables. You would use the Hiding Subtotal feature, which allows you to subtotal specified categories (and label it as you wish) and hide the subtotaled categories. Ctables also gives you full control over the order and inclusion of categories on an individual basis.
While I'm at it, can I dream a little and suggest that SPSS add an optional
category list following the name of a variable in the CROSSTAB procedure?
So, for example, instead of having to recode as above, one could simply
stipulate
CROSSTABS ED_LEVL(2+3, 4+5, 6+7+8) BY ...
/STATISTICS = CHISQ
This would pool the categories as stipulated, and use labels consisting of
the original labels strung together (e.g., the label for category 3 would
simply be added on to the end of the label for category 2).
Bob
Robert M. Schacht, Ph.D. <schacht@hawaii.edu>
Pacific Basin Rehabilitation Research & Training Center
1268 Young Street, Suite #204
Research Center, University of Hawaii
Honolulu, HI 96814