Record the results from a series of rolling regression
Record the results from a series of rolling regression
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.
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.
Re: Record the results from a series of rolling regression
The simplest thing to do there is to just write them all to a text file and import that into Excel.ivory4 wrote:Hi, I implemented a series of rolling regression, as follows:
How could I record the coefficients and std from each regression in a vector and write them in an excel?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
It will be convenient for me to Graph and Record.
Thanks for kind reply and suggestions.
Outside the loop:
open copy rolling.txt
Inside:
display(unit=copy) i %beta %stderrs
Re: Record the results from a series of rolling regression
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.
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.