Rolling window- how to store r2
Posted: Thu May 30, 2013 9:05 am
Hi everybody! This is my first post in the forum and my first time programming in eviews.... maybe someone can help me with this: I am performing a rolling window and -following the forum instructions- I was able to save the matrix of the coefficients and the t's, but I haven’t been able to perform the same for the R-square... when I try to retrieve these figures using @r2, then an error appears saying something about expecting a matrix and not a scalar... any hint? Below you will find command I was using successfully to retrieve the coefficients (this is the command I tried to modify to get the r2's!). Thanks!
!window = 40
!step = 1
!length = @obsrange
equation eq1
!nrolls = @round ((!length-!window)/!step)
matrix(3, !nrolls) coefmat
!j=0
for !i = 1 to !length -!window+1-!step step !step
!j=!j+1
smpl @first+!i-1 @first+!i + !window - 2
eq1.ls dependent c independent1 independent2
colplace(coefmat,eq1. @coefs,!j)
next
show coefmat
!window = 40
!step = 1
!length = @obsrange
equation eq1
!nrolls = @round ((!length-!window)/!step)
matrix(3, !nrolls) coefmat
!j=0
for !i = 1 to !length -!window+1-!step step !step
!j=!j+1
smpl @first+!i-1 @first+!i + !window - 2
eq1.ls dependent c independent1 independent2
colplace(coefmat,eq1. @coefs,!j)
next
show coefmat