LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2008)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 15 Jul 2008 09:46:56 -0400
Reply-To:   Gene Maguin <emaguin@buffalo.edu>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Gene Maguin <emaguin@buffalo.edu>
Subject:   Re: Search for a value in all variables?
In-Reply-To:   <p06240810c4a19dde873c@[146.244.244.64]>
Content-Type:   text/plain; charset="us-ascii"

Dennis,

>>I'd like to do two things: 1) identify the case and variable for each instance of a -8, and 2) create a new variable that simply flags the presence of at least one -8 on the case with a dichotomous (0/1) variable.

>>Oh, and to complicate it just a bit more, a small number of the variables are string.

Task 1) Use a recode statement to create a set of corresponding indicator variables. Like this

Recode x1 to x500(-8=1)(else=0) into n8_1 to n8_500. Recode s501 to s508('-8'=1)(else=0) into n8_501 to n8_508.

Now task 2) is easy. I like a count command but you might also be able to use an ANY function.

Count n8s=n8_1 to n8_508(1).

Gene Maguin

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD


Back to: Top of message | Previous page | Main SPSSX-L page