If randomly allocating objects to 1 of 3 people, how do I ensure equality?

update: just found this

library(randomizr) Z <- complete_ra(N = 500, num_arms = 3) 

Say I have 500 objects total. Once a month for several years I will allocate 8-12 of them to one of three people. I could tell R to randomly choose a number between 1 and 3, 500 times.

set.seed(1000) x <- sample.int(3, 500, replace = TRUE) table(x) > 1 2 3 153 157 190 

But yikes! The third person got way more than 1 and 2. Do I just try different set.seeds until I get one that’s more equal, or is there a quick way to ensure equality among the 3 people?

submitted by /u/problydroppingout
[link] [comments]

Published by

Nevin Manimala

Nevin Manimala is interested in blogging and finding new blogs https://nevinmanimala.com

Leave a Reply

Your email address will not be published. Required fields are marked *