2

I am working on a clinical research project using a large dataset of nationwide hospital discharges. We are using SPSS for statistical analysis.

The dataset contains 25 diagnoses variables (DX1-DX25) which capture up to 25 diagnoses per discharge. A patient could have multiple diagnoses, so DX1 would be the primary diagnosis, DX2 is the secondary, etc.

The DXn variables are string variables that contain ICD-9 codes. ICD-9 is a system of diagnostic codes for classifying diseases.

We would like to know the 10 most common diagnoses (ICD-9 codes) across all 25 diagnoses variables. Is there a way to run a frequency analysis across all 25 diagnoses variables in SPSS? In other words, I would like one frequency table that shows the combined frequency/occurrence of each ICD-9 code.

Thanks!

2 Answers2

2

If you have access to the Custom Tables (CTABLES) procedure, you can define a multiple category set (Analyze > Tables > Multiple Response Sets and use the Custom Tables procedure to tabulate across all the variables in the set. This works whether the variables are string or numeric.

JKP
  • 5,419
  • 13
  • 5
1

You could restructure (to get all the diagnoses in one variable) and then use a simple frequency analysis:

varstocases /make DX from DX1 to DX25.
freq DX.

You should do this in a separate dataset and keep your original dataset structure. For example:

dataset name OrigData.
dataset copy ForRestr.
dataset activate ForRestr.
varstocases .....
freq ....
dataset activate OrigData.
eli-k
  • 10,898
  • 11
  • 40
  • 44
  • 2
    If the DX variables are numeric with the associated value label, you can use mutliple response groups. Something like `MULT RESPONSE GROUPS=$DX (DX1 TO DX25 (1,100)) \FREQUENCIES $DX.` If they are strings, you can use `MRSETS`, but then you need to use `CTABLES` instead of `FREQUENCIES`. – Andy W Apr 24 '17 at 14:28
  • @AndyW, why not post this as an answer? BTW according to the question "The DXn variables are string variables". – eli-k Apr 24 '17 at 16:05