Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: using postfile in a loop


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using postfile in a loop
Date   Mon, 9 Nov 2009 22:14:43 +0000 (GMT)

--- On Mon, 9/11/09, Kushan Thakkar wrote:
> I have a dataset the contains the following data:
> 
> cusip ticker date prc ....(few more variables).... RminusI
> 
> I need to isolate data points for which RminusI is less
> than its first decile and then post these data points in a
> different file. 

This is not a case for -postfile- or a loop. In the example
below nlsw88.dta is your master data, grade is your id variable,
and wage is your RminusI variable.

*---------- begin example --------------
sysuse nlsw88, clear
bys grade: egen lb = pctile(wage), p(10)
keep if wage < lb
*------------ end example --------------
( For more on how to use examples I sent to statalist see:
http://www.maartenbuis.nl/stata/exampleFAQ.html )

Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------





      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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