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" <[email protected]>
To   <[email protected]>
Subject   st: Re: st. Rolling Return calculation
Date   Tue, 21 Jun 2005 17:02:39 +0200

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 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:       [email protected] 

*   For searches and help try:

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