...
- Determine the SubGroup the subject belongs in.
- The SubGroup is selected based on values for any Stratification Factors defined and based on Site if "Is Site Specific" is checked.
- For each Treatment, get a count of subjects that are also in the same SubGroup as the subject.
- For the SubGroup, get a list of the Block Sizes Blocks used.
- Determine which Block Size to use.
- For each Treatment, create a list that contains a Target Size for each Block Size already used.
- The Target Size is basically the proportion of the Block Size's size allocated to a treatment Treatment.
Code Block Target Size = (Block Size / Sum(All Treatment Weights)) * Treatment Weight
- The Target Size is basically the proportion of the Block Size's size allocated to a treatment Treatment.
- For each Treatment, allocate the subjects with that treatment to the Treatment's list of Target Sizes. If any past Block Size or the current Block Size has room in its Target Size, select the corresponding Block Size as the one to use.
- If there are no slots available in any existing Block Size, randomly select a new Block Size from the list of Block Sizes Blocks.
- For each Treatment, create a list that contains a Target Size for each Block Size already used.
- Create a list of available Treatments.
- Each Treatment will be in the list a Weighted Count number of times.
- Weighted Count for a Treatment is determined by taking the Target Size and subtract the number of subjects with that Treatment that are assigned to the current Block Size.
- Randomly select a Treatment from the list of Treatments.