dear all,
i want to save, in a while/do loop, certain observations of a data set into another data set without closing the first data set. it seems that -post- is the command i should use but apparently i'm not following its syntax correctly.
in a do-file, i wrote:
postfile x1 x2 using filename, replace
local i=1
while `i' <=20 {
here i change the sample and do things to variable y
post x1 x2 if y==1
local i=`i'+1
}
postclose
x1 and x2 are the two variables i want to save in the secondary dataset (without closing the primary one). can you help?!
thanks a lot
pedro
****************************************************
Pedro Martins
Department of Economics
University of Warwick
Coventry CV4 7AL
United Kingdom
Tel: +44/0 24765 28418
Fax: +44/0 24765 23032
Email: [email protected]
Web: www.warwick.ac.uk/staff/P.Martins
*****************************************************
*
* 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/