Page 1 of 1

Rolling window- how to store r2

Posted: Thu May 30, 2013 9:05 am
by mundane
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

Re: Rolling window- how to store r2

Posted: Thu May 30, 2013 9:20 am
by EViews Gareth

Re: Rolling window- how to store r2

Posted: Thu May 30, 2013 9:51 am
by mundane
I forgot.. what command should I add to the line "eq1.ls dependent c independent1 independent2" to specify that I want to run the regression with robust errors of the the HAC type (HAC standard errors & covariance)?? Thanks!

Re: Rolling window- how to store r2

Posted: Thu May 30, 2013 9:57 am
by EViews Gareth
Do it via the dialogs, then look at View->Representations to see the command line form.