Hello, I have a dataset that ressembles the one below (table A): each person (id) could tick to which ethnicity they identified themselves, so they could answer yes to multiple ones (each ethnicity was a variable with the answer being yes, no, or not stated). I am looking to have ONE variable that tells me the ethnicity for each id (if people answered yes to multiple ethnicities, they would be reclassified into ''multiple ethnicities'' and if a value was missing or not stated, it would be reclassified as ''not stated'' in ethnicities or deleted from the dataset. See example below of result wanted (table B). I wanted to use the ARRAY function, but not sure how to do this specifically. Thanks! Table A ID Ethnicity_2 Ethnicity_2 Ethnicity_3 Ethnicity_4 Ethnicity_5 1 0 0 0 0 1 2 0 1 0 0 0 3 0 1 1 0 0 4 1 0 0 0 0 5 99 0 0 1 1 6 0 0 0 0 1 7 0 1 0 1 0 8 0 1 0 0 0 9 0 0 1 0 0 10 0 0 0 1 0 1= YES 0= NO 99= NOT STATED Table B ID Ethnicity_1 Ethnicity_2 Ethnicity_3 Ethnicity_4 Ethnicity_5 Ethnicity_final 1 0 0 0 0 1 Ethnicity_5 2 0 1 0 0 0 Ethnicity_2 3 0 1 1 0 0 Mutiple ethnicities 4 1 0 0 0 0 Ethnicity_1 5 99 0 0 1 1 Not stated 6 0 0 0 0 1 Ethnicity_5 7 0 1 0 1 0 Mutiple ethnicities 8 0 1 0 0 0 Ethnicity_2 9 0 0 1 0 0 Ethnicity_3 10 0 0 0 1 0 Ethnicity_4 * Ethnicity_final could also be numeric to make it easier: 1-5 and 6 = 'multiple ethnicities' and 7= 'not stated' for example
... View more