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
the code I am using.
=========================================
use masterfile
sort date ticker prc
quitely sum RminusI
tempname A
tempfile signals
postfile 'A' ticker date prc using `signals', replace
post `A' (if RminusI < r(p10) ) //post to a new file if RminusI is
less than first decile
postclose `A'
=========================================
However, after the post command I get the following error:
ifRminusI not found
post: above message corresponds to expression 1, variable cusip
What am I doing wrong? Is there a more efficient way to do this ?
Thanks,
Kush
*
* 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/