Bookmark and Share

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

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

st: rolling regression in panel data

From   "Katharina Raatz" <>
Subject   st: rolling regression in panel data
Date   Wed, 05 Oct 2011 23:11:33 +0200

Dear Statalist,

I have a dta file containing daily return data of several stocks. I would 
like to calculate the CAPM betas of these stock on basis of the 
previous year's return data for each quarter beginning in 2000, i.e. from 
01mar1999 to 28feb2000, from 01jun1999 to 31may2000 and so, for each stock.

I tried to implement this with a combination of statsby and rolling or 
rollreg, but I could only find an options for these commands that would 
calculate the betas from 01mar1999 to 28feb2000, 02mar1999 to 01mar2000 
etc. so for subsequent business day. 

To overcome this, I constructed a help variable indicating all regression 
period start dates for all stocks e.g. the day 01mar1999 with "1". So what 
I would like to know is whether there is a command e.g. for rollreg with 
which I can specify that the regression should be based on data starting 
where help == "1" and end e.g. 252 rows later? And if so, is there any 
chance that I can also export the date (either of the start or the end) and 
the stock ticker besides the coefficient estimate, so that I have a clear 
identification of the regression period and to which stock the beta 

Many thanks in advance! Kristin     

NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren:
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index