I have a large population of vouchers. I need to stratify the random sample according to dollar amounts. There are four categories of dollar amounts with percentage of population to be 1%, 2%, 3%, 4%. $0-$500, $500-$2000, $2000-$5000, and greater than $5000.
In Python: How do I
- Create code that can identify which category the voucher amount belongs
- Return/print selected samples from each of those categories reflective of the required percentage of population.
I searched for "Stratified random sample" or something like that and have not found what would work.
Aucun commentaire:
Enregistrer un commentaire