Hello,

I have a peer review assignment in a class I teach and want to develop some code that will randomly assign three papers to each student to review. I have randomly assigned each student a number so that their papers will be anonymous....no problem there. Where I'm getting hung up and would be interested in some help is how to randomly assign three papers to each of the students. What I'm having a hard time figuring out is how to do this so that a student doesn't get assigned...
  1. their own paper
  2. the same paper more than once.
I've never tried anything like this in Stata and can't think of any set of commands or approaches that even seems like it would work to me. I've thought of resorting the data based on a new random number and using _n to make the assignments but this, of course, isn't sensitive to my two conditions, nor do I know how to make it sensitive to them. I've looked on the forum for things that might produce pieces of a process that I could put together but I either haven't found them or haven't the imagination to recognize them.

Although the data setup is trivial, some sample data are below in case anyone is inclined to help.

Thanks,
Lance

Code:
clear
input float student
1
2
3
4
5
6
7
8
9
10
end