I am trying to design a survey where people are assigned questions from one of three pools of questions. For simplicity let's call them P1, P2, and P3 for pools one, two, and three respectively. In the control condition, every time participants are asked a question, that question will be drawn randomly from each pool with equal probability (i.e., 33%). In the experimental condition they will draw from the pools with different probability. I think I more or less have a handle on that part of things.
The way I have approached the problem is that every time I want to ask participants a question I use the survey flow randomizer to call one of my three blocks (P1, P2, P3) then within each block I use the advanced randomization options for questions to select one question from a random set of all questions in the block any time the block is called. The issue I'm having with my current approach is that participants can see the same question more than once. What I would like to have happen instead is for the survey flow randomizer to randomly select one of my pools each time participants are asked a question (this part currently works properly) and then have the question block display one of its questions randomly excluding questions participants have already seen.
How Can I set up randomization without replacement?
Best answer by TomG
https://www.qualtrics.com/community/discussion/comment/29173#Comment_29173You could use JS to do randomization without replacement.
At the beginning of the survey (maybe your intro question). Add JS to randomize all the P questions and save them as comma separated values in embedded data fields (e.g. P1list, P2list, P3list). For example, let's say your P1 questions are p1.1, p1.2, p1.3 and p1.4. Put the values in an array, shuffle the array, then save it to an embedded data field as a comma separated list.
Put all your P questions in separate blocks, then use a randomizer, groups, and branches to randomly show one of the P questions from one of the P groups. You would get the question to show by adding a block the beginning of a P group that gets the first question from the list, sets an embedded variable, updates the embedded data field that contains the randomized list, and clicks the next button. Survey flow would look something like:
Randomizer (1 of 3)
P1 Group
Block: JS to set p1display as next random P1 question
Branch: If p1display = p1.1
Block p1.1
Branch: If p1display = p1.2
Block p1.2
...etc...
P2 Group
...etc...
P3 Group
...etc....
You could duplicate the flow above as many times as needed.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.