Hi.
So i have 1300 csv data that i want to regress using rolling regression (with for loop). So I manage to do the loop programming, but the result comes in matrix (5,@nrolls). I want to transpose the matrix so it will be (@nrolls,5). After that, i want to change the matrix into series, so i can save as it all to excel.
Does anyone have the solution for this problem? Below is the eviews programming that i'm working at so far.
Thankyou!
cd "c:\Users\Dhitya\Desktop\Program\dataset"
%filenames = @wdir("c:\Users\Dhitya\Desktop\Program\dataset")
for !k=1 to @wcount(%filenames)
%file = @word(%filenames, !k)
wfopen %file
import c:\Users\Dhitya\Desktop\Program\dataset\index\Indeks_2002.csv
import c:\Users\Dhitya\Desktop\Program\dataset\index\FF3_2002.csv
!window = 60
!step = 1
!length = @obsrange
equation eq1
!nrolls = @round((!length-!window)/!step)
matrix(5,!nrolls) coefmat!k
!j=0
for !i = 1 to !length-!window+1-!step step !step
!j=!j+1
smpl @first+!i-1 @first+!i+!window-2
genr return=(((close-close(-1))/close(-1))*100)-rf
equation eq1.ls return c indeks mkt_rf smb hml
colplace(coefmat!k, eq1.@coefs,!j)
next
next
Transpose matrix & export to excel
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- EViews Developer
- Posts: 870
- Joined: Tue Sep 16, 2008 3:50 pm
Re: Transpose matrix & export to excel
See http://www.eviews.com/help/helpintro.html#page/content/matrixref-@transpose.html for transposing a matrix
See http://www.eviews.com/help/helpintro.html#page/content/matrixref-mtos.html to create series from your matrix.
See http://www.eviews.com/help/helpintro.html#page/content/matrixref-mtos.html to create series from your matrix.
Who is online
Users browsing this forum: No registered users and 36 guests