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" <>
To   <>
Subject   st: Re: statalist-digest V4 #1555
Date   Sat, 20 Mar 2004 16:57:03 -0500

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,

*   For searches and help try:

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