* QUESTION: I am trying to calculate frequency of responses for the same value for multiple variables using 'string' category. Specifically, using ICD-9 codes as the primary cause for hospitalization in a population of 200 patients that has multiple hospitalizations and multiple reasons for hospitalization. Example: patientA has been hospitalized 8 times: 2x 'heart attack', 1x 'kidney stone', 4x 'dehydration', 1x 'stroke'. PatientB : 1x 'pneumonia', 1x 'stroke', 1x 'stomach ulcer'. PatientC: 1x 'dehyration', 1x 'heart attack'..etc How do I create frequency of response for the entire population? * SOLUTION posted to SPSSX-L list by rlevesque@videotron.ca on 2001/06/04. DATA LIST LIST /id(A8) cause1(A12) cause2(A12) cause3(A12) cause4(A12). BEGIN DATA 'patientA' 'heart attack''heart attack' 'kidney stone''dehydration' 'patientB' 'pneumonia' 'stroke' 'stomach ulcer' 'patientC' 'dehyration' 'heart attack' END DATA. LIST. * Reformat data. VECTOR cause=cause1 TO cause4. STRING cause(A12). LOOP cnt=1 TO 4. COMPUTE cause=cause(cnt). XSAVE OUTFILE='c:\\temp\\temp.sav' /KEEP=id cause. END LOOP. EXECUTE. GET FILE='c:\\temp\\temp.sav'. SELECT IF LENGTH(RTRIM(cause))>0. AUTORECODE cause /INTO cause1. FREQUENCIES VARIABLES=cause1 /ORDER= ANALYSIS .