stratify_data function

Split data by stratum