jeudi 17 mars 2022

If one knows the population size by age range and mean and std for each range , how does one get the random sample out of it in python?

I have googled and read up on random sampling from a given population , both in probability and in python , but each of the examples have data then extraction of random samples out of population data generated.

But if I don't have the population data but just the mean and std ?

For example

Age Size Mean (of Salary) Std Mean (of Salary)
20-25 15000 5000 600
25-30 20000 6000 700

From the data above , how can I extract out the random sample of 200 with python ?

What I been seeing is something like "rs.append(np.random.choice(X, 5))" but I have no X , or population to choose from.

Thanks in advanced.




Aucun commentaire:

Enregistrer un commentaire