How can I retrieve statistics from a View of an object?

For questions regarding programming in the EViews programming language.

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

Thommo
Posts: 14
Joined: Wed Sep 17, 2008 10:56 am

How can I retrieve statistics from a View of an object?

Postby Thommo » Wed Sep 17, 2008 2:03 pm

For example I can perform a Wald test from my equation, but I cannot retrieve the p-values and store them in a scalar in a program. Is there a way to do this?

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

Postby EViews Gareth » Wed Sep 17, 2008 2:14 pm

Many of our Views, such as tests from an equation, do not have an inbuilt way to retrieve the statistics. However you can always retrieve values by first freezing the view into a table, and then referencing the cell containing that value.

For example:

Code: Select all

freeze(tab1) eq01.wald c(1)=0
scalar f_pvalue = @val(tab1(6,4))

kipfilet
Posts: 7
Joined: Wed Jul 08, 2009 7:12 am

Re: How can I retrieve statistics from a View of an object?

Postby kipfilet » Sat May 22, 2010 11:46 am

Hey there, I want to extract F-statistics from Chow tables recursively (meaning I have to freeze around 130 tables and extract the F statistics). However, naturally, I get an error after the first one. Is there any command to close the table?

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

Re: How can I retrieve statistics from a View of an object?

Postby EViews Gareth » Sat May 22, 2010 3:12 pm

Which error are you getting?
Follow us on Twitter @IHSEViews

kipfilet
Posts: 7
Joined: Wed Jul 08, 2009 7:12 am

Re: How can I retrieve statistics from a View of an object?

Postby kipfilet » Sun May 23, 2010 6:44 am

Sorry, I'm not getting any error. It's just the Chow series that are not filled (just with N/As). I am sure I am doing something wrong with the way I specify the dates for the Chow test.

Code: Select all

workfile taylor m 1999m01 2008m12

smpl 1999m01 2008m12
equation eq03.ls eonia c infl_h indgap

series(120) chow_rec
series(120) chow_rec_p

!i=1
while !i<120+1

freeze(tabchow) eq03.chow @first+!i
chow_f(!i,1) = @val(tabchow(6,2))
chow_f_p(!i,1) = @val(tabchow(6,5))

d tabchow

!i=!i+1
wend

d itera
d eq03


Note: I have also tried replacing the @first+!i with 1999m01+!i, but eviews always tells me that this is an illegal date. Any thought on how to solve this? I have tried going through the command reference, but I was not enlightened on this issue.

Dataminer
Posts: 11
Joined: Thu Jul 23, 2009 2:01 am

Re: How can I retrieve statistics from a View of an object?

Postby Dataminer » Sun May 23, 2010 10:31 am

kipfilet
The attached code (using ev5) may help you make progress. It does the same chow breaktest over and over. You can see that you have to work a bit harder ( I,ve not done it here) to supply the changing breakpoint date and the date has to imply sufficient observations in the earlier and later periods.
Gerald

Code: Select all

workfile taylor m 1999m01 2008m12

smpl 1999m01 2008m12
'
series eonia = @rnorm
series infl_h = @rnorm
series indgap = @rnorm
'
equation eq03.ls eonia c infl_h indgap

series chow_f
series chow_f_p

!i=25
while !i<60

freeze(tabchow) eq03.chow "2001m01"
chow_f(!i) = @val(tabchow(3,2))
chow_f_p(!i) = @val(tabchow(3,5))

d tabchow

!i=!i+1
wend
stop

fmgoto
Posts: 76
Joined: Thu Jan 15, 2009 5:01 am
Location: Brasilia, Brazil

Re: How can I retrieve statistics from a View of an object?

Postby fmgoto » Wed May 26, 2010 7:01 pm

Concerning the "freezing 130 tables", you may as well just freeze the table with the same name and then delete it after you are through with it. It helped a lot when I started getting workfiles with millions of frozen VAR output tables! Just a thought!

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

How can I retrieve statistics from a View of an object?

Postby EViews Gareth » Wed May 26, 2010 7:27 pm

Or, just use the mode=overwrite option on the freeze command.
Follow us on Twitter @IHSEViews

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re:

Postby adarshad » Sat Jan 29, 2022 9:02 am

EViews Gareth wrote:Many of our Views, such as tests from an equation, do not have an inbuilt way to retrieve the statistics. However you can always retrieve values by first freezing the view into a table, and then referencing the cell containing that value.

For example:

Code: Select all

freeze(tab1) eq01.wald c(1)=0
scalar f_pvalue = @val(tab1(6,4))



equation eq{!i}.ls Y{!i} C X{!i}A(-!bestlag_A) X{!i}B(-!bestlag_B) Y{!i}(-1) X{!i}G(-!bestlag_G) X{!i}C(-!bestlag_C) X{!i}B(-!bestlag_B)*X{!i}Z

I want to retrieve wald test values for this equation and store them

Can someone help me

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: How can I retrieve statistics from a View of an object?

Postby adarshad » Sat Jan 29, 2022 9:05 am

i want to run wald test for c3=0 hypothesis for the output of the equations and then store them ...can someone refer to the code

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: How can I retrieve statistics from a View of an object?

Postby adarshad » Sat Jan 29, 2022 9:08 am

and store the pvalue and chi square value for all equations

adarshad
Posts: 101
Joined: Wed Sep 05, 2018 10:32 am

Re: How can I retrieve statistics from a View of an object?

Postby adarshad » Wed Feb 02, 2022 10:42 am

eq!i.wald c(6)=0


FOR i=28

I want to store pvalues in word file or atleast in a table or somewhere together

can someone help

Oikono26
Posts: 2
Joined: Sun Oct 08, 2023 4:02 pm

Re: How can I retrieve statistics from a View of an object?

Postby Oikono26 » Mon Oct 09, 2023 2:42 pm

i would like to write an algorithm in order to be able to retrieve the smoothing parameter (a) in a table. So i would like to do it 10.000 times and that's means i will have 10.000 times the value of a. Could anyone help me??
I have already written the following code for only one series with my data:

freeze ser01.smooth(s) ser01sm

With this command i have the table with the results from simple exponential smoothing which is done only in ser01 and obviously the smoothing parameter (a). It is located in a 8Ε cell. I want to retrieve it and put it in a table.
Attachments
Untitled.jpg
Untitled.jpg (440.7 KiB) Viewed 28480 times


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 10 guests