Record the results from a series of rolling regression

Questions and discussions on Time Series Analysis

Record the results from a series of rolling regression

Postby ivory4 » Mon Aug 24, 2009 2:04 pm

Hi, I implemented a series of rolling regression, as follows:

compute start=1979:3, end=1996:4
do i = 0, 48
linreg(noprint) y start+i end+i
# constant x1 x2
display i %beta $
%stderrs
end do i

How could I record the coefficients and std from each regression in a vector and write them in an excel?
It will be convenient for me to Graph and Record.

Thanks for kind reply and suggestions.
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm

Re: Record the results from a series of rolling regression

Postby TomDoan » Mon Aug 24, 2009 5:37 pm

ivory4 wrote:Hi, I implemented a series of rolling regression, as follows:

Code: Select all
compute start=1979:3, end=1996:4
do i = 0, 48
   linreg(noprint) y start+i end+i
   # constant x1 x2
   display i %beta $
   %stderrs
   end do i


How could I record the coefficients and std from each regression in a vector and write them in an excel?
It will be convenient for me to Graph and Record.

Thanks for kind reply and suggestions.


The simplest thing to do there is to just write them all to a text file and import that into Excel.

Outside the loop:

open copy rolling.txt

Inside:

display(unit=copy) i %beta %stderrs
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Record the results from a series of rolling regression

Postby ivory4 » Thu Oct 01, 2009 10:22 pm

This is really a good way of recording the results.
I am a little bit uncomfortable with the matrix representation in RATS, it is not as straight forward as in gauss.
But this small trick helps a lot.

Thanks.

ps: late reply because I use this many times after I read your post.
ivory4
 
Posts: 149
Joined: Mon Aug 24, 2009 12:16 pm


Return to Other Time Series Analysis

Who is online

Users browsing this forum: No registered users and 1 guest