Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Daniel Brodback" <schmani@gmx.de> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Time Series Operators and monthly returns after collapse |

Date |
Thu, 23 Aug 2012 10:53:38 +0200 |

Scott, thank you for your reply! Exactly, I am asking whether it is the (average) 6month return or 1month return. I do understand that I generate the mean of the returns. In your example, the resulting collapsed return is just the average of the 6 month returns. (at least I think so, please correct me if I should be wrong) In my analysis, I observe a larger timeframe and have numerous returns (1 for every month, collapsed as in your example) and want to perform a regression analysis on them. But in order to do that, I need to have monthly returns(*). If I understood the time series operators and -collapse- correctly, I need to divide the collapsed log-returns by 6 in order to receive the monthly returns. Is this assumption right? As mentioned in my initial post I got confused after rethinking my code. Apologies for my ignorance, but I'm quite new to Stata and wasn't aware of the time series operators before. Thanks, Daniel (*): Just for completeness, here is what I am trying to do: I rank stocks based on their prior 6m return and then invest for the subsequent 6m(this is the collapse part). Too see whether this strategy might be beneficial, one has to perform a regression analysis including monthly strategy and market returns. -------- Original-Nachricht -------- > Datum: Wed, 22 Aug 2012 20:26:17 -0500 > Von: Scott Merryman <scott.merryman@gmail.com> > An: statalist@hsphsun2.harvard.edu > Betreff: Re: st: Time Series Operators and monthly returns after collapse > Are you asking if the -collapse- f6.lret6- is the 6 month return or 1 > month return? Isn't it just the average of the last 6 months? In the > following simple example, is the mean of lnret what you expect? > > clear > set obs 12 > gen t = _n > tsset t > set seed 12304 > gen x = ceil(runiform()*10) > gen lnret = ln(x/ l6.x) > preserve > collapse (mean) f6.lnret > l > restore > sum lnre > sum f6.lnre > > Scott > > > On Wed, Aug 22, 2012 at 11:33 AM, Daniel Brodback <schmani@gmx.de> wrote: > > Dear all, > > > > just a quick question because I got quite a bit confused in my analsis > with time series operators and monthly returns. I am ranking stocks based on > their prior 6 month return and then invest for an additional 6 months. > > > > I generate the log-return of the previous 6 month with the following > command: generate lret6 = ln(price / l6.price) > > > > Later, I collapse in a foreach-loop: > > collapse (mean) f6.lret6, by(date `var') > > > > in order to obtain the mean return of my panel. > > > > Now my question: Do I now have the 6month-return or rather the 1 month > return? So far I assumed this would be the 6 month return and hence divided > by 6 in order to obtain a monthly return. But after I rethought my code I > am not sure whether this was the right thing to do. > > > > Any input to get me back on the right track is highly appreciated. > > > > Thanks, > > Daniel > > * > * 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/ * * 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/

**References**:**st: Time Series Operators and monthly returns after collapse***From:*"Daniel Brodback" <schmani@gmx.de>

**Re: st: Time Series Operators and monthly returns after collapse***From:*Scott Merryman <scott.merryman@gmail.com>

- Prev by Date:
**AW: st: Graphing of Exponential Growth and Decay** - Next by Date:
**Re: st: factor variables and qreg?** - Previous by thread:
**Re: st: Time Series Operators and monthly returns after collapse** - Next by thread:
**st: polynomial distributed lags** - Index(es):