Hello. I have a long list of countries (220), each coded 0 (not visited) or 1 (visited). For each case (respondent) only three countries are coded as 1 (visited) but those countries are not the same for every respondent. How do I create three variables (Visited country_1, Visited country_2, Visited country_3) from this list of countries? In In other words, I have the following data (e.g.)
id c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
1 0 1 0 1 0 0 0 1 0 0
2 1 1 1 0 0 0 0 0 0 0
I need the following:
id vc_1 vc_2 vc_3
1 c2 (code) c4 c8
2 c1 c2 c3
Thanks for your help!
id c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
1 0 1 0 1 0 0 0 1 0 0
2 1 1 1 0 0 0 0 0 0 0
I need the following:
id vc_1 vc_2 vc_3
1 c2 (code) c4 c8
2 c1 c2 c3
Thanks for your help!