Page 1 of 1

Extracting results from tables

Posted: Mon Jun 26, 2017 8:56 am
by feporrua1
Hi,

I am having a problem with extracting the results from tables (in particular RESET test). I am using stepls in a loop and as expected each regression has a different number of independent variables. The problem is that the row number in the frozen table containing the statistic (or the p-value) of the RESET test keeps changing depending on the number of regressors that are included. Does anyone know how to solve this? is there another way to extract the relevant statistics from the tests?

This is the code I am using:

Code: Select all

!size=@obs(complete) !regressions=@obs(complete) for !y= 1 to !regressions !x=complete(!y) 'Ramsey RESET for !a=1 to !resettest freeze(rtable) temp{!x}.reset(!a) vector (!y) rt{!a} rt{!a}(!y)=rtable(9,4) d rtable next next
Many thanks!

Francisco

Re: Extracting results from tables

Posted: Mon Jun 26, 2017 9:02 am
by EViews Gareth
Seems like the p-value is always in column D, and is going to be in row 7,8,9, etc... depending on how many regressors there are (and the length of the names).

Since there are no number above the p-value in column D, you could just extract D7, if it isn't a number, extract D8, and keep going until you get a number.


Alternatively, the reset test is pretty easy to run manually by doing the regression.

Re: Extracting results from tables

Posted: Mon Jun 26, 2017 4:40 pm
by feporrua1
Thanks, solution found!

Code: Select all

!resettest=4 !size=@obs(complete) !regressions=@obs(complete) for !y= 1 to !regressions !x=complete(!y) 'Ramsey RESET for !a=1 to !resettest freeze(rtable) temp{!x}.reset(!a) for !e=7 to 12 !xx2=@isna(@val(rtable(!e,4))) if !xx2=0 then exitloop endif next vector (!y) rt{!a} rt{!a}(!y)=rtable(!e,4) d rtable next next

Re: Extracting results from tables

Posted: Mon Jun 26, 2017 6:21 pm
by EViews Gareth
Nicely done.

Re: Extracting results from tables

Posted: Mon Jun 26, 2017 11:54 pm
by feporrua1
Thanks!!