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

st: post

From   "Pedro Martins" <>
To   <>
Subject   st: post
Date   Wed, 27 Nov 2002 16:46:28 +0000

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

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 Martins
Department of Economics
University of Warwick
Coventry CV4 7AL
United Kingdom

Tel: +44/0 24765 28418
Fax: +44/0 24765 23032

*   For searches and help try:

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