r/spss•
simanimos

Random assigning

Hi all,

I need to find a way to randomly assign 2 people each into x=(n/2) groups. So if I have 500 people, I need to assign two people to each of 250 groups. The allotment needs to be random. I have other constraints but can work around them if I can figure the above issue out. Thanks in advance.

Posted Oct 3, 2019, 6:04 PM UTC

12
hoppyfrog•

One way would be to assign everyone a random number - for example:

COMPUTE newvar = UNIFORM(1,500) .

Then:

SORT CASES BY newvar .

to mix the order up.

Then do something like assign the first x people into a group then the next x

or

do something clever using a MOD(row#,x) function to assign people into groups.

Good luck!

1
simanimosOP•

Thanks for the insight! I'll let you know what I come up with

1