Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: random sample

From   n j cox <>
Subject   Re: st: random sample
Date   Thu, 26 Oct 2006 16:10:59 +0100

You can put an -if uniform() < 0.1- condition on (e.g.)
a -use- statement. This samples records (observations).

As, by chance, this should yield a bit less than 10%
about half the time, some people wanting exactly 10%
would increase that fraction and then deal with surplus observations
once they had been read in.


for more general discussion.


Marcella Sapun

I want to read randomly 10% of a data set that contains about 1 million
records and 100 variables. How do I do that in stata?
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index