Dear Kobo team,
I’d like to see if there is a way to be able to use a formula which can:
Randomly choose an option amongst 3 options with an equal probability of 1/3 to be selected
Calculating a winning and loosing decisiob based on (1 draws, 1 as probability of winning loosing, chance as a percentage) for example binomial (1,1, 0.5)
Your help is appriciated
@myriamdagher1, maybe this post discussed previously should give you some clue to your query:
@arif_1234, you could do it as outlined in the image shared below. But note that this is an approach where you are randomly selecting one group where you have shuffled the questions beforehand. Also please be informed that this approach will solve your issue but it will be a bit tedious to manage and analyze your data.
Note: Since the workaround has three groups I have used 3 within the calculation. If you have more or less group you could change the number accordingly. Say if you have 5 groups…
Thank you Kal. Can you please share the image? I am not able to find it in your reply.
Please can you share the image you reffered to?
random testing.xlsx (17.9 KB)
I created the attached sheet and I appreciate your feedback on the below:
Does the following expression: int(random() * 3) + 1 randomly choose between three options/groups (1, 2, 3) with equal probability for each option to be selected (1/3 probability for each)?
Does this expression if(random() <= 0.5, ‘Win’, ‘Loss’) calculate the winning/losing based on 1 drawing, same probability for winning and losing, and a specific chance?
Hint: random() as any calculation will be activated/updated any time you open/edit the case. Otherwise, you would need to pack the calculation with once(…).
If you want to simply randomize choices you can use the randomize=true appearance for the select. See (
Question Types - ODK Docs).
Don’t forget, please, to always check your form with the
Online validator,, during development and before deployment. It will for ex. show you that you should add the 2-letter language codes in the columns. See
Adding Another Language to your XLSForm — KoboToolbox documentation.
I copied your redundant new posting here. You can delete it there. Please, avoid posting for the same issue in more than one thread.
Duplicate posting on the same issue, see
https://community.kobotoolbox.org/t/randomizations-and-probability-calculations/47137. Please, keep in one main thread, also for following aspects on the same topic. You can edit your posts (pencil icon) or add new postings there to enhance/change your thread.
Thank you so much I used once(…) and the value generated did not change after loading the form!
Hello Kobo team,
I’m seeking a formula to randomly select among 3 options with equal 1/3 probabilities. Additionally, I aim to calculate outcomes based on a binomial model (1 draw, 1 win/loss probability) like binomial (1, 1, 0.5). Any guidance on achieving this would be greatly appreciated. Thank you.