crd

crd(treat_sizes, *, control=False, rng=None)[source]

Draw a completely randomized design.

Parameters:
  • treat_sizes (Sequence[int]) – Size of each group; with control=True the first entry is the control group.

  • control (bool) – Label groups 0, 1, …, g-1 instead of 1, 2, …, g.

  • rng (np.random.Generator | None) – Random generator.

Returns:

A group label per unit, uniformly over all assignments with these group sizes.

Return type:

np.ndarray