Multiple regression:Question about storing output

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

HWbroek
Posts: 3
Joined: Tue Mar 22, 2011 6:53 am

Multiple regression:Question about storing output

Postby HWbroek » Wed Mar 23, 2011 4:00 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Multiple regression:Question about storing output

Postby EViews Gareth » Wed Mar 23, 2011 7:55 am

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.

HWbroek
Posts: 3
Joined: Tue Mar 22, 2011 6:53 am

Re: Multiple regression:Question about storing output

Postby HWbroek » Fri Mar 25, 2011 2:56 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests