random number generator stata
Random numbers in STATA. STATA uses a pseudo-random number function uniform() to generate random numbers. STATA generates a 16-digit values over the interval [0, 1) for each case in the data. You can use these numbers to choose cases (if you choose those with random numbers lower than 0.20, each case has 20% chance of being selected.