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

st: RE: Unique values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Unique values
Date   Sun, 1 Feb 2004 16:46:45 -0000

(1) 

bysort security: egen maxclose = max(close)
list security close date if close == maxclose 

Note that -list- will catch ties when they occur. 

(2) depends on how weekly returns are calculated. 

Nick 
n.j.cox@durham.ac.uk 

Natarajan Ramachandran
 
> I have a couple of securities in a variable and their closing 
> prices with a corresponding date.
>  
> (1) How do I loop through each security to find out the 
> maximum closing price and the corresponding date?
>  
> (2) How do I loop through each security to find out the 
> weekly returns?

<<winmail.dat>>




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