I really need help regarding random sampling.
say, I have a population of 10,000 people made up of 3 different sub groups categorised by age range: 1-10 (5000 people), 11-20 (2000 people), 21-30 (3000 people) each normally distributed with its own respective mean salary and standard deviation. how then can I obtain a random sample of size 50 and estimate the sample median salary using python simulation. also, the age group composition of the sample must be same or close to the age group composition of the population. e.g.: 1-10 age group constitutes 5000/10000 = 50% of the population. hence in the sample, 25 persons should come from the 1-10 age group.
heres what I did:
population = 10000
samplesize = 50
samplesize_list = [25, 10, 15]
label_list = ['1-10', '11-20', '21-30']
std_list = [7459, 18207, 37225]
mean_list = [17487, 32481, 47044]
Aucun commentaire:
Enregistrer un commentaire