Random selection within ODK

Dear Collegues,
Am Sam from Uganda and currently working on a project where i need to randomly select 3 persons from a household roster using ODK. So i add people to a household and from that list of household members; i have to randomly select 3 persons (specific criteria needed for these people). Any Ideas!


I have been able to put all my eligible household members into one pool eg {1 2 3 4 5 6 7 8 9}
Am thinking of 2 possible ideas moving forward;
1: Randomly sort that list and then select the first 3 items in the list--Still not sure how to implement
2: Randomly select the 3 members directly from the list-- the code i have for can randomly select only 1 person (once(int(random()*count-selected(${pool})))) which may need to be customized to allow for 3 persons.

Still need help Please!

Hi Sam,
I am having similar issue. My I ask how did you put the eligible household members in a pool please. I need to select one and don't know exactly how to go about it.
Aizik form Nigeria

Hi Sam,
Sorry that am seeing this late. But I think I have a solution which may help others. What you've described is complete to pick a member with simple random sampling (SRS). To select other members, they're statistically many other ways - but the easiest is to base on the selected member and then select for instance every 2nd in order to add the other 2 members and have the list of three

I can see that you had generated a list to pick from, say if the random member is one in position 2; then additionally pick 4 and 6 in case its every 2nd; or pick 4 and 7 in case its every 3rd. That way, the one you pick first provides the random start and thus every other systematic pick remains at random in the list.

To achieve this in the form, include calculate fields that contain the names of members depending on their position - each member a variable. Ounce its the selected position, then call the respective member.

Hope it helps