Date: Thu, 24 Feb 2005 14:07:48 +0200
Reply-To: Hillel Vardi <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Hillel Vardi <email@example.com>
Subject: Re: select cases with Multiple variables in a range
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I also work on hospital data .
In past year a case use to have 3-10 diagnosis (icd codes) per
admission . to day some cases may have 20-60 codes per admission and
the number of cases may by
huge , therefor most hospitals store there data base in a relational
database . one of the tables in this database is usely diagnosis and
it is stricture as many lines per case .
Keeping the data as long ( many line per case)
have many advantage over keeping them as one line with many icd line
id icd1 icd2 icd3 icd4
Here is a way to do it with your data
LOOP id=1 TO 10.
numeric icd1 to icd11 (f3) .
do repeat icd= icd1 to icd11 .
COMPUTE icd=200 + UNIFORM(1) * 100 .
end repeat .
END INPUT PROGRAM.
VARSTOCASES /MAKE dig FROM icd1 icd2 icd3 icd4 icd5 icd6 icd7 icd8
icd9 icd10 icd11
/INDEX = Index(11)
/KEEP = id
/NULL = KEEP.
recode dig(250 thru 260=1) into keep .
select if keep eq 1.
SORT CASES BY id .
/ID = id
/GROUPBY = VARIABLE .
Ben Gurion U
Sri Pasupulati wrote:
>I have a Data (hospital) in which there are cases which have more than one
>variable (primary, secondary diagnosis ...) of the same type (have ICD 9
>codes). I need to select the cases which have the code '250 - 260' in
>atleast one of those variables. What syntax do I need to use in the 'Select
>cases' function? Please help me.
>Thanks in advance, Sri