Randomly allocating observations into groups