2 questions on spools

For questions regarding programming in the EViews programming language.

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

Jwink
Posts: 11
Joined: Thu Mar 17, 2011 12:44 pm

2 questions on spools

Postby Jwink » Fri Mar 18, 2011 12:00 pm

Hi Eviews Forum,

I'm working with Eviews 6 with the July 2010 patch. I'm a programming novice, so the program below may be more elaborate than it needs to be, so please let me know if there are ways to simplify it.

I'm having two issues trying to run a simple program that runs some tests and then appends the results to a spool.

First when the program gets to the line for the hettest, I get the following error message:
Insufficient number of coefficients to test in "DO_TESTSPOOL.APPEND BSERNEQ.HETTEST(TYPE=BPG) @REGS"
When I put just bserneq.hettest(type=bpg) @regs in the command line, it works fine, but not while trying to append it.
Second when I try to put the forecast output into the spool I get the following error:
Incomplete command in batch mode in "DO_TESTSPOOL.APPEND BSERNEQ.FORECAST(G) BSERNF"
This sort of works when I put it in the command line, though the forecast box pops up requiring me to authorize it, so obviously some other command is required. I've tried adding in the b=ep and f=actual, but that doesn't stop the box from popping up. If there's any way to fix this, I'd appreciate it (also if there are any other programming tips, that'd be great to).

-Thanks,
John

Code: Select all

'Program for BSERN '1st - create your spool and name it: spool testspool '2nd - set your sample size *note need to adjust sample sizes with new runs smpl 1990:1 2010:4 '2a - create a seasonally adjusted version of your variable (not always necessary): bsern.x12(mode=m, filter=msr) '3rd - output the graphs of your data testspool.append bsern.line bsern_sa.line '4th - output correlograms to look for serial correlation testspool.append bsern.correl(24) bsern.correl(24, d1) bsern.correl(24,d2) '5th - output unit root tests testspool.append bsern.uroot(adf,dif=0,none,info=sic) bsern.uroot(adf,dif=0,const,info=sic) bsern.uroot(adf,dif=0,const,trend,info=sic) bsern.uroot(adf,dif=1,none,info=sic) bsern.uroot(adf,dif=1,const,info=sic) bsern.uroot(adf,dif=1,const,trend,info=sic) '6th estimate the equation - have to name your equation for later use - here we've named it bserneq: equation bserneq.ls log(bsern_sa) c log(securf) log(msvtot) log(sp500(-4)) ar(1)ma(2) ar(2) ar(3) testspool.append bserneq '***Here is the place to put other versions of the equation if the original equation no longer provides a good fit. '***If you put in other equations, please note why that equation is better, e.g. higher R^2, better forecast, less serial correlation, etc. '7a need to run tests on the equation to see whether there are issues with serial correlation - first with the correlogram (may need to run subsequent tests with other tests - such as LM) testspool.append bserneq.correl(24) '7b test for remaining heteroskedasticity (default is Breusch-Pagan Godfrey Test including all regressors) testspool.append bserneq.hettest(type=bpg) @regs '7c display the graph for the fit of the residuals testspool.append bserneq.resids(g) '8 Compute the long, out of sample forecast smpl 2011:1 2017:4 testspool.append bserneq.forecast(g) bsernf '8a compute a long, in-sample forecast *note need to adjust sample sizes with new runs smpl 2005:4 2010:4 testspool.append bserneq.forecast(g,e) bsernf_is '8b compute a short, in-sample forecast *note need to adjust sample sizes with new runs smpl 2009:4 2010:4 testspool.append bserneq.forecast(g,e) bsernf_iss
Last edited by Jwink on Tue Mar 29, 2011 11:16 am, edited 2 times in total.

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

Re: 2 questions on spools

Postby EViews Gareth » Fri Mar 18, 2011 12:07 pm

In both cases, try putting the command you want to append in quotes:

Code: Select all

TESTSPOOL.APPEND "BSERNEQ.HETTEST(TYPE=BPG) @REGS"

Jwink
Posts: 11
Joined: Thu Mar 17, 2011 12:44 pm

Re: 2 questions on spools

Postby Jwink » Fri Mar 18, 2011 12:26 pm

Great! It worked. Thanks very much for that.

Do you know why it would require quotes in those cases whereas not in others? In other words, is there a general rule for putting in quotes?

-Thanks

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

Re: 2 questions on spools

Postby EViews Gareth » Fri Mar 18, 2011 12:30 pm

If there is a space in the command you're appending to the spool, you'll need to put it in quotes.

The append command lets you append more than one thing at a time, where each thing is separated by a space. Thus having a space in the command you want to append confuses things.

Jwink
Posts: 11
Joined: Thu Mar 17, 2011 12:44 pm

Re: 2 questions on spools

Postby Jwink » Fri Mar 25, 2011 11:58 am

Thanks for the clarification Gareth.

Now that the basic version is running, I'm trying to rewrite the program using program arguments so that it can be repeated for a number of different variables. But it then runs into problems when trying to run the operations with arguments when they're inside the quotation marks.

For example it now won't run this:
{%spool}.append "{%eq}.hettest(type=bpg) @regs"

or this:
{%spool}.append "{%eq}.forecast(g) bsernf"

Other operations using {%eq} work, so I'm pretty sure that it's not an issue with the argument.

Thanks again for the help.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests