Program to run with existing workfile
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Program to run with existing workfile
What instruction is needed for an EViews program to run with an existing workfile? For example, I have a file with UNRATE in it and have several equations trying to forecast UNRATE. One such model is a nonlinear model that first requires the user to run a least squares model several times and extract the SSR to find the minimum SSR model. I see several examples of creating files with the program and then using nrnd to generate data, but I did not see an example of how to use a program with an existing workfile. I am a beginner related to programming EViews, so I may have missed the proper instruction while looking at examples or reading the manual. Thanks
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Program to run with existing workfile
To expand on Startz' answer...
If you already have the workfile open and it is the only workfile open, you don't need to use any command - the program will automatically work on the current workfile.
If you have multiple workfiles open and need to tell the program which one to use, use the wfselect command to tell EViews which one to use.
If you don't have the workfile open, use wfopen to use it.
Finally, if you're not sure if you have it open or not, use wfuse.
If you already have the workfile open and it is the only workfile open, you don't need to use any command - the program will automatically work on the current workfile.
If you have multiple workfiles open and need to tell the program which one to use, use the wfselect command to tell EViews which one to use.
If you don't have the workfile open, use wfopen to use it.
Finally, if you're not sure if you have it open or not, use wfuse.
Follow us on Twitter @IHSEViews
Re: Program to run with existing workfile
Thanks. What if I have the file open and want to run a given equation, (say EQ32) 20 times to extract the SSR? I read your example programs in which you ran equations several times to extract the Rsquared, but have not been able to change that program to accomplish my goal.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Program to run with existing workfile
Why would you want to extract SSR from the same equation 20 times?
Follow us on Twitter @IHSEViews
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Program to run with existing workfile
To expand on Gareth's answer...
Once you run an equation, it remembers all the values it produces until you change something. No need to re-run it. Also, you can run it once and save the value you want in a scalar for easy later reference.
Once you run an equation, it remembers all the values it produces until you change something. No need to re-run it. Also, you can run it once and save the value you want in a scalar for easy later reference.
Re: Program to run with existing workfile
There is an example in Enders, Applied Econometric Time Series, 4th ed. on pages 425 to 436 concerning a Threshold model (TAR). He shows that the threshold is found at the minimum SSR. In the example case, running a given model 141 time as described on page 426 locates the minimum SSR. Page 435 shows Potential Thresholds and SSR in a chart.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Program to run with existing workfile
Presumably, something changed in the equation between runs. You'll have to reference the equation object after each run.
Re: Program to run with existing workfile
Yes, there is a two stage process. Find the threshold, which requires an input change in order to find the minimum SSR. This process took 141 iterations with the change variable in Enders book. Then, given the threshold value, forecast UNRATE. I was hoping to get some help to write the routine needed in order to make the change and run multiple iterations of an equation, with the change input in order to find the threshold value.
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Program to run with existing workfile
You'll probably have to take a stab at writing it yourself before anyone will help.
Follow us on Twitter @IHSEViews
Re: Program to run with existing workfile
I am not shying from doing work, I am having a difficult time trying to find the instructions that tell the program to select an equation from an open workfile, change a given variable and then evaluate the equation for a given number of times and then store the SSR, similar to your example storing r2s. Some of the elements I see in your sample programs. It looks like a "for" instruction is needed (similar to a do loop in FORTRAN, from distant past). If you can recommend a beginners workbook, I would gladly read it.
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Program to run with existing workfile
AASA wrote:I am not shying from doing work, I am having a difficult time trying to find the instructions that tell the program to select an equation from an open workfile, change a given variable and then evaluate the equation for a given number of times and then store the SSR, similar to your example storing r2s. Some of the elements I see in your sample programs. It looks like a "for" instruction is needed (similar to a do loop in FORTRAN, from distant past). If you can recommend a beginners workbook, I would gladly read it.
To create an equation
Code: Select all
equation eq01
Code: Select all
eq01.ls y c x
Chapter 16 of http://www.eviews.com/illustrated/illustrated.html will help some on the programming.
Re: Program to run with existing workfile
Thanks. I printed the chapter 16 pages from EViews Illustrated and will see if I can make some progress. Many years ago I took a couple semesters of FORTRAN, but have not done any programming in decades.
Who is online
Users browsing this forum: No registered users and 58 guests