Dear Community.
I have about five million observations(men, age 40s).
I'd like to classify these 5 million people into 10 groups (randomly) according to the distribution below.
In other words, each observation should be allocated from group 1 to 10, but should be matched overall proportion of the group.
group proportion
1 0.07
2 0.19
3 0.16
4 0.12
5 0.21
6 0.01
7 0.05
8 0.04
9 0.1
10 0.05
(total 1.00)
In addition, I have an overall observation of about 20 million people, and the above tasks should be performed by gender*age groups.
Thanks in advance.
Best regards,
Yunsun
Related Posts with Random allocation of observations
How to transfer my string variable to date variable? Code: * Example generated by -dataex-. To install: ssc install dataex clear input str10 week float …
How to drop specific columns and rows in matrix?I created a matrix named "m" with the following commands. Is there a simple way to remove all the r…
Optimization does not convergeDear All, I have a black-box data generation routine, which depends on three parameters A,B,C. I ge…
How to add R-squared in -esttab- regression? Code: sysuse auto, clear eststo: regress price weight mpg eststo: regress price weight…
Regression interpretation coefficientsI am conducting a logit regression where i interpret the coefficients because it is a correlational …
Subscribe to:
Post Comments (Atom)
0 Response to Random allocation of observations
Post a Comment