View Full Version : Programming Stata


sawyer
10-14-2008, 07:14 PM
Hi people!
I've written a program in Stata that creates 10 groups of numbers, each group being made up of 7 numbers from 1-35. The problem is that sometimes a number appears more than once, and I'd like each group to consist of 7 unique number. Here's the code and I wonder if anyone could help me out because I don't know how to solve this.


capture program drop test
program test
clear
set obs 7
forvalues i=1(1) 10 {
generate x`i'=int(35*uniform()+1)
sort x`i'
}
list
end


(Pardon my English but I'm not from the US.)

zmogggggg
10-25-2008, 10:39 AM
Let us know if you're still working on this (the Stata lab is so far away :D)