I have a question about saving my output in a matrix.
I have a program that regresses 49 industry each year of the sample period, so 49 industries and 41 years. I need the coefficients, st.errors and t-stats. The problem i have is that the matrix should store the first year in column 1 and the second year in column 2 etc. But the problem is that eviews continues in the first column, i have read the programming guide but can't find a way to do this.
this is my program so far.
Code: Select all
' first try
'preparing to save beta output in table
matrix(industry.@count,46) betamin
matrix(industry.@count,46) betaplus
matrix(industry.@count,46) Tstatbmin
matrix(industry.@count,46) Tstatbplus
matrix(industry.@count,46) stderbmin
matrix(industry.@count,46) stderbplus
!rowcounter=1
'rolling sample (dates)
for !year= 1969 to 2009
'first year
smpl !year !year
'the different industries ols
for !i = 1 to industry.@count
%name = industry.@seriesname (!i)
equation eq{!year}_{%name}.ls(n)industry(!i) c variables
'getting the results in the table
betamin(!rowcounter, ??? )= eq{!year}_{%name}.@coefs(2)
betaplus(!rowcounter, ???)= eq{!year}_{%name}.@coefs(3)
Tstatbmin(!rowcounter, ??? )= eq{!year}_{%name}.@tstat(2)
Tstatbplus(!rowcounter, ???)= eq{!year}_{%name}.@tstat(3)
stderbmin(!rowcounter, ??? )= eq{!year}_{%name}.@stderrs(2)
stderbplus(!rowcounter, ???)= eq{!year}_{%name}.@stderrs(3)
'to "roll" to next year
smpl !year+1 !year+1
'to assure right output is in the corresponding row
!rowcounter= !rowcounter+1
'deleting the equations
delete eq{!year}_{%name}
next
next
smpl @all
