Hello, I have a dataset with 60 clusters that can be divided into 14 stratum. I would like to randomly allocate these 60 clusters into 2 groups - 30 intervention and 30 control. I would like to ensure balance between the two groups across 14 geographic sectors- hence, why I am choosing to do stratified sampling.

However, the number of clusters in each strata varies, with 8 out of the 14 stratum having an odd number of clusters. I would like to do proportional allocation, where the clusters within each strata have a 50% chance of being allocated to the two groups, but also maintain an equal number in the 2 groups - 30 clusters in each.

I have tried the following:

sample 50, by(sector)

This samples 34 clusters because there are 8 stratum that have an odd number of clusters. The sample to be chosen is being rounded up, giving me 4 extra clusters in my desired sample of 30.

The only solution I can think of is randomly selecting 4 of the 8 stratum with odd observations and having those stratum round up the selected clusters and the remaining stratum round down. This would give me my desired sample size of 30 in each group, but would require some manual calculations.

Is there a code that could make this simpler?

Thank you for your support - I'm a first time Statalist user.