Extracting results from tables

For questions regarding programming in the EViews programming language.

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

feporrua1
Posts: 8
Joined: Wed Jun 14, 2017 7:20 pm

Extracting results from tables

Postby feporrua1 » Mon Jun 26, 2017 8:56 am

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

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

Re: Extracting results from tables

Postby EViews Gareth » Mon Jun 26, 2017 9:02 am

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.
Follow us on Twitter @IHSEViews

feporrua1
Posts: 8
Joined: Wed Jun 14, 2017 7:20 pm

Re: Extracting results from tables

Postby feporrua1 » Mon Jun 26, 2017 4:40 pm

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

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

Re: Extracting results from tables

Postby EViews Gareth » Mon Jun 26, 2017 6:21 pm

Nicely done.
Follow us on Twitter @IHSEViews

feporrua1
Posts: 8
Joined: Wed Jun 14, 2017 7:20 pm

Re: Extracting results from tables

Postby feporrua1 » Mon Jun 26, 2017 11:54 pm

Thanks!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 24 guests