How to quickly convert equation objects to code for a program file?

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

JC198998
Posts: 13
Joined: Thu Jan 02, 2025 7:13 pm

How to quickly convert equation objects to code for a program file?

Postby JC198998 » Thu Mar 27, 2025 7:58 pm

Hello, I was given a workfile with hundreds of equations as objects. Is there a quick way to automatically convert the equations into code for the program file?

I would rather not have to open each one and copy past them onto the program. Thank you.

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

Re: How to quickly convert equation objects to code for a program file?

Postby EViews Gareth » Fri Mar 28, 2025 8:03 am

What do you mean by "convert the equations into code"?

What are you trying to do?

JC198998
Posts: 13
Joined: Thu Jan 02, 2025 7:13 pm

Re: How to quickly convert equation objects to code for a program file?

Postby JC198998 » Fri Mar 28, 2025 10:00 am

I only have a workfile that has hundreds of objects (e.g., graphs, equations, tables, etc). By "convert to code", I mean, is there a quick/automated way to turn the equations (objects) in this workfile into lines of code for a program file?

For example, there are multiple least squares equations saved in this workfile. Is there a quick way to get the equivalent lines of code (or syntax) for each of these equations that does not require me to open each one and copy-paste the equations/variables? Like maybe a loop or some function I can use?

Thank you.
Last edited by JC198998 on Fri Mar 28, 2025 10:03 am, edited 1 time in total.

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

Re: How to quickly convert equation objects to code for a program file?

Postby EViews Gareth » Fri Mar 28, 2025 10:03 am

Sorry, still not clear. Are you trying to extract the results of the equations? Or re-estimate them, with the current spec? Or what?

JC198998
Posts: 13
Joined: Thu Jan 02, 2025 7:13 pm

Re: How to quickly convert equation objects to code for a program file?

Postby JC198998 » Fri Mar 28, 2025 10:06 am

Yes, I would like to re-estimate them.

For example, there is a least squares equation saved as an object in this workfile. I'd like to get the syntax/code that estimates this specific equation, so I can input it into a program file (instead of having just the workfile). Is there quick way to do this for tens of equations that are saved in the workfile?

Let me know if this is still not clear. I can elaborate further. Thank you for your patience.

JC198998
Posts: 13
Joined: Thu Jan 02, 2025 7:13 pm

Re: How to quickly convert equation objects to code for a program file?

Postby JC198998 » Fri Mar 28, 2025 10:20 am

I think a clearer explanation would be - in this workfile, there is a least squares equation named ls_1 that is specified as Dep1, Var1, Var2, etc.

I'd like to get the syntax/code/specification (i.e., 'equation ls_1.ls Dep1 Var1 Var2') for a new program file without having to manually open the object and then click on (1) proc, (2) specify/estimate, and copy-paste the specification written on the "Equation Estimation".

I'd like to know if there is a quick/automated way to get the syntax/code/specification of all equations saved in the workfile.

I hope this helps. Thank you for your time.

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

Re: How to quickly convert equation objects to code for a program file?

Postby EViews Gareth » Fri Mar 28, 2025 10:55 am

Something like this:

Code: Select all

%eqlist = @wlookup("*", "equation") table eqlist !rc = 1 for %j {%eqlist} eqlist(!rc,1) = %j eqlist(!rc,2) = {%j}.@command next
would retrieve the command used to estimate each equation.


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest