Hello,
I ran a Qualtrics loop and merge study, in which participants select a set of fields in the first question. They are then looped through questions about each fields. A simple example from Qualtrics is "A clothing company wants to ask a set of questions about each of its clothing departments. Rather than taking the time to create new questions for men’s clothing, women’s clothing, and children’s clothing, the questions could be created once. Loop & Merge could then automatically repeat the set of questions once for each clothing department the respondent indicated they visited."
In my study, I had teaching assistant select which teams they supervised, and then answer questions about each team. Unfortunately the way that Qualtrics labels variables in the ensuing dataset isn't user-friendly. Here's a data example. This shows just one record, so there are a lot of variables you don't see here. In this case the TA chose teams1 and 4, indicated by the value of 1 in the variables teams_1 and teams_4.
They then answered many questions about each team. I just exported two for the sake of this example. Qualtrics added the prefix A1_ to the answers about team 1 and A4_ to the questions about team 4.
Is there an way to use syntax to transform this into a long file where there's a variable team that has the team number and then variables inc1w1 inc2w1 with the corresponding values? I'm familiar with using reshape for variable where there's a suffix, but unsure how to deal with prefixes.
I ran a Qualtrics loop and merge study, in which participants select a set of fields in the first question. They are then looped through questions about each fields. A simple example from Qualtrics is "A clothing company wants to ask a set of questions about each of its clothing departments. Rather than taking the time to create new questions for men’s clothing, women’s clothing, and children’s clothing, the questions could be created once. Loop & Merge could then automatically repeat the set of questions once for each clothing department the respondent indicated they visited."
In my study, I had teaching assistant select which teams they supervised, and then answer questions about each team. Unfortunately the way that Qualtrics labels variables in the ensuing dataset isn't user-friendly. Here's a data example. This shows just one record, so there are a lot of variables you don't see here. In this case the TA chose teams1 and 4, indicated by the value of 1 in the variables teams_1 and teams_4.
They then answered many questions about each team. I just exported two for the sake of this example. Qualtrics added the prefix A1_ to the answers about team 1 and A4_ to the questions about team 4.
Code:
clear input byte(teams_1 teams_4 A1_inc1w1 A1_inc2w1 A4_inc1w1 A4_inc2w1) 1 1 4 5 5 5 end label values A1_inc1w1 labels32 label def labels32 4 "Neutral (neither accurate nor inaccurate)", modify label values A1_inc2w1 labels33 label def labels33 5 "A little accurate", modify label values A4_inc1w1 labels77 label def labels77 5 "A little accurate", modify label values A4_inc2w1 labels78 label def labels78 5 "A little accurate", modify
Is there an way to use syntax to transform this into a long file where there's a variable team that has the team number and then variables inc1w1 inc2w1 with the corresponding values? I'm familiar with using reshape for variable where there's a suffix, but unsure how to deal with prefixes.
Comment