Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: re: dear users of Statalist


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: re: dear users of Statalist
Date   Sun, 8 Jul 2007 21:42:37 -0400

Tobias said

But I can't get the right solution. It always gives me a sum of the past 30
returns. But I want to sum the futurereturns.

(At the 01.01.01 should be the sum of the daily returns from the 01.01.01
till the 31.01.01)

Does that work with ROLLING or MVSUMM?



See the egen filter function from egenmore (ssc desc egenmore). It will allow you to compute a moving average(or sum) over future periods. For instance

. egen sum10=filter(wpi), l(-10/0) c(1 1 1 1 1 1 1 1 1 1 1)

will compute sum10 as the sum of current and future 10 values of wpi (eleven terms in all).


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index