Page 1 of 1

Multiple regression:Question about storing output

Posted: Wed Mar 23, 2011 4:00 am
by HWbroek
Hi,

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
hope you can help me to fill in the question marks

Re: Multiple regression:Question about storing output

Posted: Wed Mar 23, 2011 7:55 am
by EViews Gareth
Based on your current code, probably the easiest thing to do is use a !colcounter variable. Start it at one, and then each time you run through the !year loop, increase it by one.

Re: Multiple regression:Question about storing output

Posted: Fri Mar 25, 2011 2:56 am
by HWbroek
Thanks, i used a different way, changed the order of the coding of the results so instead of betamin(!rowcounter,?) I used betamin(!i,!rowcounter)
and changed row counter in !rowcounter= !year-1968.
now it works fine but thanks for your help