Dear Listserv,
I would like your thoughts on an issue I am having with a dataset. Column A lists the admitting diagnoses of all people in my dataset by it's ICD-9 code (numerical code that is unique for every disease). Column B: I have a separate list of 20 specific diseases and their ICD-9 codes. I would like to create a new variable in this column that tells me if any of the diagnoses in Column A are found in this list of 20 diseases. Any help would be much appreciated. Thanks in advance! |
see if something like one of the snippets of untested syntax is what you
need. If not please ask a more detailed question. compute haveanyof20= any(columna, 'a111111111', 'b2222222', 'ccca11111' . . .'zzzaaa123'). numeric heart lungs gastro, nervous, . . . psychiatric(n1) do repeat code = 'a111111111', 'b2222222', 'ccca11111' . . .'zzzaaa123' / diagnosis = heart to psychiatric. compute diagnosis = columna eq code . end repeat. Art Kendall Social Research Consultants Anthony Santella wrote: >Dear Listserv, > >I would like your thoughts on an issue I am having with a dataset. > >Column A lists the admitting diagnoses of all people in my dataset by it's >ICD-9 code (numerical code that is unique for every disease). > >Column B: I have a separate list of 20 specific diseases and their ICD-9 >codes. I would like to create a new variable in this column that tells me >if any of the diagnoses in Column A are found in this list of 20 diseases. > >Any help would be much appreciated. > >Thanks in advance! > > > >
Art Kendall
Social Research Consultants |
In reply to this post by Anthony Santella
Anthony,
You say: Column A lists the admitting diagnoses of all people in my dataset by it's ICD-9 code (numerical code that is unique for every disease). Column B: I have a separate list of 20 specific diseases and their ICD-9 codes. I would like to create a new variable in this column that tells me if any of the diagnoses in Column A are found in this list of 20 diseases. Does this mean that each person has 20 records with the first having the admitting dx and the first of the 20 specific disease codes and each of the remaining 19 records having missing data for the admit dx and one of the remaining 19 disease codes? So if your sample had 100 persons in it, your dataset would have 2000 records. Could this be true? Or, do you mean that columns B1 thru B20 carry the 20 preset disease codes? Thus one record per case rather than 20. Gene Maguin |
In reply to this post by Anthony Santella
COMPUTE colB = ANY(colA,'788.2','E111').
You will need to supply the list of ICD-9 codes into the any statement. --jim -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Anthony Santella Sent: Saturday, November 11, 2006 1:22 PM To: [hidden email] Subject: categorical Dear Listserv, I would like your thoughts on an issue I am having with a dataset. Column A lists the admitting diagnoses of all people in my dataset by it's ICD-9 code (numerical code that is unique for every disease). Column B: I have a separate list of 20 specific diseases and their ICD-9 codes. I would like to create a new variable in this column that tells me if any of the diagnoses in Column A are found in this list of 20 diseases. Any help would be much appreciated. Thanks in advance! |
Free forum by Nabble | Edit this page |