I need to create a computer program for randomizing subjects using stratified randomization with permuted-block randomization, so I want to make sure my thinking is correct:
Suppose that in an experiment, there are two groups (control and treatment), and we want to block on two factors: gender (male, female) and race (white, non-white, and asian). Thus, there are $2times3=6$ strata:
Stratum 1: Male/White Stratum 2: Male/Non-White Stratum 3: Male/Asian Stratum 4: Female/White Stratum 5: Female/Non-White Stratum 6: Female/Asian
We are using fixed block sizes of four and an allocation ratio of 1:1, so the six possible allocation sequences are:
AABB, ABAB, ABBA, BBAA, BABA, and BAAB
Now, for every subject, since the subjects are enrolled into the study iteratively (we are expecting $n = 180$), we use the following procedure. Let's say the first subject is female and white.
- Assign subject to one of six strata. In this example, the subject would be assigned to Stratum 4.
- Pick a random allocation sequence, e.g., AABB
- Assign subject to group. If A = control and B = treatment, then the subject is assigned to the control group. The 2nd, 3rd, and 4th subject assigned to Stratum 4 will be assigned to groups A, B, and B, respectively. When the 5th subject is assigned to this stratum, another random block will be chosen, and so on.
The above procedure will be entirely hidden from the user carrying out the data entry, who will only see which group the subject is assigned to.
Is my understanding correct?
Your understanding looks correct to me.
If you are willing to use existing tools rather than writing your own program then the blockrand package for R was written to do exacly these types of randomizations.
- Solved – Difference between one-way ANOVA with randomised blocks and nested ANOVA
- Solved – Interpretation of multiple dumthe variables based on one categorical variable in a regression
- Solved – Interpretation of betas when there are multiple categorical variables
- Solved – Multiple Regression – Minimum Observations Per Dumthe Variable
- Solved – Post hoc chi-square test