Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: statalist-digest V4 #1555


From   "Carlos Elordi" <[email protected]>
To   <[email protected]>
Subject   st: Re: statalist-digest V4 #1555
Date   Sat, 20 Mar 2004 16:57:03 -0500

Hi,
I would like to create a random sample of observations from a large data
file (lets say 1 or 5%), selecting cases based on an id number. For many
cases I have more than one row (record) per id number, so I cannot apply the
sample command directly.
Is there an easy way to randomly select all the cases, together with their
corresponding records, without having to reshape the data? The number of
records for each case could range from 1 to 15.
Thanks in advance for any help,
Carlos


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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