The process of assigning subjects to different groups in an experiment to avoid bias and obtain a representative sample.