Hello,

I have a dataset with different groups of variables that actually represent the same questions asked in a survey. The reason for this is that in order to observe drop-outs based on questions we randomized the order that participants viewed sections in based on their month of birth. Essentially, the dataset ends up looking like the table below. v1 is the same question as v6, v2 is the same as v7, and so on. Participants only saw each question once, so there is never a case where an individual has a nonmissing in v1-v5 if they answered v6-v10.

Code:
  
ID v1 v2 v3 v4 v5 v6 v7 v8 v9 v10
1 1 3 2 5 1
2 1 4 5 2 2
3 4 5 3 2 2
4 3 4 1 2 3
5 1 3 4 5 4
6 2 5 5 2 3
7 4 5 1 4 1
8 2 2 1 5 2
9 1 2 4 2 2
So my question is, is there a quick way to combine all the variables that correspond to the same question? My problem is that I have several sections to do this with, and that results in more than 100 questions. So while I could easily generate a new variable for each question that combines the two corresponding variable, or just replace one of the variables with the contents of the matching variable if missing, this will take a long time if I do it one by one. Can somebody think of a quick loop to do this with? If it helps, questions within the sections are always in the same order. So the order of questions in v1-v5 is the same order of questions in v6-v10.