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