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

st: Re: st. Rolling Return calculation


From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: st. Rolling Return calculation
Date   Tue, 21 Jun 2005 17:02:39 +0200

Kelly,
 
Read [U] 13.7 Explicit subscripting (in Stata 8 is is another chapter number).
 
  gen rreturn=return+1 in 1
  replace rreturn=rreturn[_n-1]*(return+1) in 2/l
 
(it is lowercase L in 2/l)
 
This is not my field, but I wondered why dates were in reverse order. 
I also wondered: You write that return is a percentage. If it is, 
return+1 should be 1.00078 in the first observation.
 
Hope this helps
Svend

________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       sj@soci.au.dk 
_________________________________________________________ 

*
*   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/



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