For the forthcoming Version 8, the answer is pretty simple: RATS automatically saves a copy of the report that you can access using the "Report Windows" operation on the "Window" menu. You can pull that up and then export the information to a spreadsheet. RATS 7.3 only exports the regression results to a report, but with version 8, the F-test information is included.
With 7.3 or older, or if you want to create a custom report that only includes the F-Test information, you can still do this fairly easily, but you need to write some code using REPORT instructions. The main point to notice here is that you need to define the system using individual equations, so that you can estimate one equation at a time and then apply EXCLUDE instructions to get the F-tests on each block of lags.
As you can see, this can be automated to a great extent using loops. Here's the basic code. I've also attached a full example file below, which uses the same data file as the HISTORY.PRG included with RATS.
Code: Select all
* Create a vector to hold the equations -- this makes
* it easier to list the equations and loop over them:
dec vector[equations] eq(4)
* Define the system, listing equations to be defined rather
* than using the MODEL option. Here, we can just
* supply the name of the vector defined above:
system eq
variables logcangdp logcandefl logcanm1 logexrate
lags 1 to 4
det constant
end(system)
* Now, group the equations into a MODEL, which
* allows us to use some model functions to get
* the size of the model, the series numbers
* for the dependent variables, and the labels
* of the dependent variables. This allows us
* to write the rest of the code in a very general
* fashion, so it can be easily adapted to different
* models.
* Here's the GROUP:
group varmodel eq(1) eq(2) eq(3) eq(4)
* Now get the size:
compute modelsize=%modelsize(varmodel)
* Now create a vector with the series (numbers)
* of each dependent variable, stored in DEPVAR:
dec vect[int] depvar(modelsize)
compute depvar=%modeldepvars(varmodel)
* Now store the labels (names) of those variables
* in a vector called VARLABELS:
dec vect[labels] varlabels(modelsize)
ewise varlabels(i)=%modellabel(varmodel,i)
* Check the results
display varlabels
* Start the report
report(action=define,hlabels=||"Variable","F stat","Signif"||)
* Loop over the list of equations, where MODELSIZE gives
* the number of equations:
do eqnum=1,modelsize
* Estimate the current equation:
linreg(equation=eq(eqnum),noprint)
* Add a row to the report listing the dependent variable:
report(span,col=current) "Dependendent Variable "+varlabels(eqnum)
* Loop over the list of variables, for doing each F test:
do varnum=1,modelsize
* Do F-test on 4 lags of current variable:
exclude(noprint)
# depvar(varnum){1 to 4}
* Add the label of the variable being excluded, the test stat,
* and the significance level to a new row in the report:
report(atcol=1) varlabels(varnum) %cdstat %signif
* End the loops:
end do
end do
* Generate the report:
report(action=show)
report(action=show,window="Ftests")
You can then save this window to a spreadsheet, or copy and paste the
information.
You can also use the UNIT and FORMAT options on REPORT to write the
results directly to a file.
Full program (uses only 4 of the 6 variables used by HISTORY--the code can be easily adapted to different models thanks to the use of computed variables and loops):