Creating a roster from a random sub-set of a list

Hello everyone,

I am hoping to ask our participants to list all the young adults they know within their village (capped at 20). I then want to create a roster based on a random sub-set of this list. Specifically, I want to ask more questions about 5 randomly selected people from this list.

The public example demo for random selection (https://designer.mysurvey.solutions/questionnaire/details/7e6f99e3744e4ed9b56879482d99be04/chapter/8ae67f9587324f00bd24d35a71526833/variable/5f3b17a370b64f4eb3a52c14dafcea12) appears similar to this but not quite. Rather than ask questions about a single randomly selected person, I want to create a roster that cycles through 5 randomly selected people.

Please can anyone advise on the Syntax for this? I imagine the answer is something along the lines of creating a new list that samples from the original list without replacement, until the cap (5 people) is met. But I’m not sure how to implement this in Designer.

Many thanks,

Adam

1 Like

Hi everyone,

I am still struggling with this – if anyone has any advice, it would be much appreciated!

Adam

You can’t create a new list to be used as a roster source (actually you can’t create any new list).
As soon as you have the indices of the 5 randomly selected people in your List question, point the roster towards that List and restrict the roster rows to these 5 people by adding an appropriate enabling condition to the roster.

How you get the 5 random indices is another story. I once did it by preloading random combinations of letters into hidden Text questions, one for each possible size of the list, e.g. “FEBJHAGICD” for a list of size 10. To convert this to indices I used the ASCII codes of the letters.
This way you generate the random selection before the interview (by preloading).
Of course eah interview gets different letter combinations preloaded.

1 Like

Dear Klaus,

Thank you for getting back to me. I had thought about doing the randomisation in Stata and then preloading, but I’m not sure it will work in this case. The reason being is that the indices we’ll want to randomly sample will depend on the length of the list respondents give. For example, if a respondent knows 17 people, we’ll want to randomly sample numbers without replacement from 1-17, whereas if someone only knows 8 people, we’ll just want to sample 1-8. And we obviously won’t know the length of the list we want to sample from until we get to the interview itself.

I will let you know if I think of anything!

Adam

Adam,

My situation was exactly like yours. So I preloaded 15 random combinations of 5 letters each (speaking in your problem’s dimensions), for list sizes 6 to 20.

Klaus

1 Like

This makes sense - thank you!