equation outputs into table?

For questions regarding programming in the EViews programming language.

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

minson
Posts: 10
Joined: Fri Feb 06, 2009 7:27 am

equation outputs into table?

Postby minson » Tue Feb 10, 2009 10:46 am

Hello,

I have 24 regression equations outputs. I need to copy and paste these into microsoft excel.
d = 100 + 4*dd^5 + 6*dd^6 + 0.5*dd^7
d = 1.2*te + 5*dd^2 + 0.05*dd^7 ...etc

Instead of copying and pasting each equation, is there a way i can save the above form of the equation as a string perhaps, and save it in a table? then i can just copy and paste the table in one go.

e.g.
table mytable
mytable(1) = " d = 100 + 4*dd^5 + 6*dd^6 + 0.5*dd^7 "
mytable(2) = " d = 1.2*te + 5*dd^2 + 0.05*dd^7 " ....etc

many thanks
Minson

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

Re: equation outputs into table?

Postby EViews Gareth » Tue Feb 10, 2009 12:04 pm

Unfortunately there isn't an easy way to do this...

The best I can think of is to put all of the equations into a spool, then write the spool to an RTF file, open it in Excel and delete all the stuff you don't want.
Follow us on Twitter @IHSEViews

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

Re: equation outputs into table?

Postby EViews Gareth » Tue Feb 10, 2009 5:46 pm

A second, perhaps better way, is to put all your equations into a model, then break the model links (Proc->Links->Break All Links), then look at the source text of the model (View->Source Text). That should give you something closer to what you want.
Follow us on Twitter @IHSEViews

minson
Posts: 10
Joined: Fri Feb 06, 2009 7:27 am

Re: equation outputs into table?

Postby minson » Mon Feb 16, 2009 2:52 am

Putting an equation into a model then breaking the links works superbly for one equation. But as soon as I try to add another equation, I get a message in the model saying,

" d is specified as endogenous in another equation in est(1) "

Anyway ideas how I can work around this?

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

Re: equation outputs into table?

Postby EViews Gareth » Mon Feb 16, 2009 9:47 am

Ah, good point - if they have the same dependent variable, I'm not sure you can get them into a model like that.
Follow us on Twitter @IHSEViews

minson
Posts: 10
Joined: Fri Feb 06, 2009 7:27 am

Re: equation outputs into table?

Postby minson » Mon Feb 23, 2009 4:37 am

Ok, for those who are interested, I have gone round the problem in the following way. Not ideal, but it kind of does the bulk of what I wanted:

create a for loop for !hour = 1 to 24- with the loop do the follow steps
- set the sample
- create a new temporary series, with a unique name and set it to the orinal series you wanted to regress on. In this case that original series is called "d".
%temp_series = "d" + !hour
series{%temp_series} = d
- run the regress on this uniquley named variable
- save the equation to a model
- delete temp_series and the equation if you dont want them

go into the model then do what qms gareth suggested "break the model links (Proc->Links->Break All Links), then look at the source text of the model (View->Source Text). "

This method is not perfect because you have different variable, d1 = , d2 = , d3 = ..etc. at the beginning of each equation, which you need to change manually, but thats not too time consuming. Let me know if there is a better way.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 46 guests