Programming the statistical procedures from SAS

homogeneous distribution

New Contributor
Posts: 2

homogeneous distribution



I need help Smiley Happy, have to make a random homogeneous distribution of the observations on the basis of the amount of a given variable.

I have a set of records that must be assigned to specific entities based on certain percentages.


Example (basetable):


1   1        300

2   1        150

3   2        500

4   1        200

5   3        700


entities and percentages 


A       20%        

B       70%       

C       10%


how can I assign the correct values ​​of COUNT and AMOUNT entities A, B and C in relation to their proportion in the most consistent and fair as possible ?


you may kindly direct me some examples?


Thank you so much , Isabel

Super User
Posts: 10,205

Re: homogeneous distribution

Your post is ambiguous . What output would you like to see ?
New Contributor
Posts: 2

Re: homogeneous distribution



for example:
A 20% COUNT: 1.6 AMOUNT: 370
B 70% COUNT: 5.6 AMOUNT:1295
C 10% COUNT: 0.8 AMOUNT: 185
1   1        300  => A 
2   1        150  => A
3   2        500  => B
4   1        200  => C 
5   3        700  => B
A =>COUNT: 2 AMOUNT: 450
B =>COUNT: 5 AMOUNT: 1200
C =>COUNT: 1 AMOUNT: 200
Frequent Contributor
Posts: 95

Re: homogeneous distribution

[ Edited ]

Hi Isabel.


Is there a rule that determines the assignment of data to groups A, B and C? Or do you want this to be random, ending up with the proportions indicated (20% of obervations in group A, etc.)?


If the latter, then AnnMaria might have the solution:

SAS 9.4 (TS1M4) X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation

Super User
Posts: 10,205

Re: homogeneous distribution

Ou God. I understand something now. It is more like a SAS/OR problem. Is there any OBJECT function ? I believe there are lots of combination suited your requirement . Whether you want the minimize number of each GROUP or want the minimize difference of each GROUP ?
Super User
Posts: 20,716

Re: homogeneous distribution

Proc SurveySelect is generally used for sample selection and you can specify proportions but I can't see how A/B/C tie back to your original data. Otherwise it seems a bit like three samples just stacked together. 

Ask a Question
Discussion stats
  • 5 replies
  • 4 in conversation