stochatreat
Stratified random treatment assignment using pandas.
Got an RCT with unequal strata sizes? stochatreat handles the messiness for you: it maximizes balance within every stratum and handles the leftover units (misfits) so your treatment groups stay as equal as possible.
Why stochatreat?
- Works with any number of strata
- Supports unequal treatment probabilities
- Three misfit strategies:
"stratum","global", or"none" - Reproducible via
random_state - Returns a clean pandas DataFrame — just merge and go