The larger your sample size the more effective simple randomization will be in avoiding systematic differences in confounding variables existing between groups, and the more trivial any numerical differences in group size will be. If your sample size is smaller, then you might like to consider so called restricted random allocation techniques to get numerically-balanced groups and/or ones that most effectively avoid systematic differences in potential confounding factors.
One such technique is block allocation (sometimes called permuted block random allocation or block randomization). Imagine we have 80 people in our sample that we want to allocate between four treatment groups (A, B, C, and D). In block allocation we might split these 80 into 20 blocks of four. We label the four individuals in each block 1, 2, 3, and 4 randomly then generate a random permutation of the four groups (either by computer or by drawing lots). Let’s say for one block the random permutation is DBAC; we allocate the first individual in that block to treatment D, the second to B, and so on. We repeat this for each block. This technique will guarantee us a balanced design of 20 people in each treatment group.
Imagine we have 40 males and 40 females in our sample. If it is the case that we expect that the treatments might have quite different effects on the two sexes, and/or that the trait we ultimately want to measure on our sample individuals will be different between the two sexes, then we would like to have a 50:50 balance of males and females in each of the four treatment groups. We are more likely to get closer to this if we first stratify our sample by sex and then carry block allocation on males and females separately. That is, we construct 10 all-male blocks and 10 all-female blocks then carry out our block allocation as before. This will ensure that not only are our four treatment groups all the same size but they all have the same sex-ratio. Of course (as with stratified sampling) we could carry out stratified allocation not just on sex but on any trait that we can measure on individuals on our sample. Imagine that it was not a simple dichotomous variable like sex we wanted to stratify on, but something continuous like body mass which we have measured on each subject. We could rank the individuals in terms of body mass and form blocks from this ranking, so the first block contains the four heaviest individuals and so on. This approach of using stratification and blocks in our allocation is called stratified block allocation. If we stratify on a variable in our allocation procedure then this means that we have to complicate our statistical analysis a little and use that variable as a covariate in our analysis. This use of blocks is so effective and commonly used that we dedicate Chapter 9 to looking at it more closely.
In our example above, the numbers worked out perfectly so that every subject fitted neatly into a block of four. We don’t need this for blocked allocation to work. Imagine we had 41 women in our study, we will end up with one ‘block’ that just has a single individual in it. We can still use our system to allocate that individual. We obviously label them the first individual in our block, we generate our random permutation of the four groups, and if that permutation is DCBA then we allocate that individual to group D. This means that our groups won’t be perfectly balanced, but blocking is still worthwhile because groups are guaranteed to be almost balanced. The smaller our blocks the less this problem of incomplete blocks will be, so having the block size as the number of groups that we want to allocate between is probably a good rule of thumb. Block allocation might be particularly attractive to you if you recruit individuals into the sample sequentially and do not know when the flow of recruits will dry up (or how many you will have when you have to stop recruiting), since no matter when you stop sampling you will have roughly balanced allocation across treatments.