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 (February 2000)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Feb 2000 17:19:01 +0100
Reply-To:     NASSAR NAJI <nassar@CYBERCABLE.FR>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         NASSAR NAJI <nassar@CYBERCABLE.FR>
In-Reply-To:  <20000203150431.YKUQ1148.mta05.onebox.com@onebox.com>
Content-Type: text/plain; charset="iso-8859-1"

Kevin,

I hope this will help:

- If only complaint 1 interests you, this syntaxe should give you what needed sort cases by casenum(A) complaint (A). compute cplt1=(complaint=1). if (casenum=lag(casenum)) cplt1=lag(cplt1). execute. You can encounter some problems in case of missing values or 0 for complaint variable (in such case record those values to higher value, for ex 999 and 1000).

- You want to do this for many complaint values (say A, B, C,..), I think you'll have to dichotomize complaint variable.

Define the macro developped by Fabrizio Arosio (September 15, 99) DEFINE Macro(OutVar=!TOKENS(1) /InVar=!ENCLOSE('(',')') /Values=!ENCLOSE('(',')')). Count !LET !SEP=!NULL !DO !I !IN (!Values) !CONCAT(!SEP,!OutVar,!I,"=",!InVar,"(",!I,")") !LET !SEP="/" !DOEND !ENDDEFINE

Macro OutVar=cplt InVar=(complaint) Values=(A B C ...). execute. AGGREGATE /OUTFILE='c:\countcplt.sav' /BREAK=casenum /cplt1 to cpltx=SUM(cplt1 to cpltx). @x= max(A,B,C...) @this file -countcplt.sav- contains one observation for each case and the frequency for each complaint sort cases by casenum (A). MATCH FILES /FILE=* /TABLE='c:\countcplt.sav' /BY casenum. - now you can use the count as variable or recode them as filter RECODE cplt1 to cpltx (0=SYSMIS) (ELSE=1) . EXECUTE . You can now use cplt1 to cpltx as Multi response variable and use it in general tables..

Alert : I didn't test it... Regards Naji

> -----Message d'origine----- > De: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]De la part de > Kevin Borders > Date: jeudi 3 février 2000 16:05 > À: SPSSX-L@LISTSERV.UGA.EDU > Objet: > > > Hello. I'm a doctoral student in social work with a record selection > question. I have a database made up of cases and complaint information. > Each case may have more than one complaint associated with it. The data > file looks something like this: > > case number complaint > 001 1 > 001 45 > 002 17 > 002 87 > 003 1 > 003 22 > 003 129 > 004 1 > 004 36 > 005 77 > 005 110 > > While I know how to select the case numbers where the complaint is 1, > what I now need is to be able to also select all of the other complaints > that are associated with that case number. What I get now is all of > the case numbers where complaint = 1, and the rest of the complaints > are left out. Does anybody have any suggestions? Thanks very much. > -- > Kevin Borders, MSSW University of Louisville > greenhiker@zdnetonebox.com > > > ___________________________________________________________________ > To get your own FREE ZDNet onebox - FREE voicemail, email, and fax, > all in one place - sign up today at http://www.zdnetonebox.com >


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