So, I would like to randomly assign participants to one of six different treatment groups, which is itself easy (e.g. using set embedded data within a randomizer and than use branches). BUT I would like to assign participants only to treatment groups, which are not "full" yet. Despite participants potentially dropping out of the survey, I want to end up with 30 responses in all treatment groups.
Therefore I try to find a way to randomize the treatment assignment, while controlling for Quotas. One could create separate randomizers within branches for all 2^6 cases (64 possibilities), like only randomize over the 5 remaining treatments if one is already full etc. However, this takes way to long and gets impractical for the next survey using even 12 treatment groups...
Ideally, I am looking for a solution using javascript, for example using a loop such that the randomizer picks a group, if the group is already full, it keeps randomizing until it randomly picked a group which is not full yet.
Does anyone of you could give me tipps on how to do this or has experience in randomly assigning treatment groups (randomly set embedded data) using javascript?
Any help is much appreciated! Thanks!!
Best answer by Samarth
View original