How to run a ADF unit root test for multiple series

For questions regarding programming in the EViews programming language.

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

xorlosch
Posts: 7
Joined: Thu Oct 23, 2008 12:19 pm

How to run a ADF unit root test for multiple series

Postby xorlosch » Thu Oct 23, 2008 12:31 pm

I have a workfile with around 100 series imported. For all these series I would like to run an ADF unit root test for the levels and first differences and store the series name and the t-values in a table. The series names do not have a unique pattern. Is this possible to do without the interface? Thanks for your help.

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

Re: How to run a ADF unit root test for multiple series

Postby EViews Gareth » Thu Oct 23, 2008 12:34 pm

Best bet is to put your series into a group and then write a for loop that loops through the members of the group, performing the test on each one as it goes.

xorlosch
Posts: 7
Joined: Thu Oct 23, 2008 12:19 pm

Re: How to run a ADF unit root test for multiple series

Postby xorlosch » Fri Oct 24, 2008 2:58 am

My code looks like this at the moment:

Code: Select all

group g * 'put every series in the workfile into a group table (50,50) ADF for !i=1 to g.@count 'loop through every series in the first group %name = g.@seriesname(!i) 'grab the current series name uroot(adf, const, dif=0,save=level1) {%name} ADF(1,1+!i)=%name ADF(2, 1+!i)= level1(3,1)' uroot(adf, trend, dif=0,save=level2) {%name} ADF(3, 1+!i)= level2(3,1) next
I have two problems. First, I would like to exclude c and -resid from my group selction. Second, I would love to save the t-values of the Trend term in my table as well.

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

Re: How to run a ADF unit root test for multiple series

Postby EViews Gareth » Fri Oct 24, 2008 7:10 am

Code looks good so far.

C won't get added to your group (since it isn't a series). You can remove resid from your group with the drop command:

Code: Select all

group g * g.drop resid
I believe the only way to save the t-values is to freeze the uroot results into a table, then grab the numbers from that table. Cumbersome, but it should work.

xorlosch
Posts: 7
Joined: Thu Oct 23, 2008 12:19 pm

Re: How to run a ADF unit root test for multiple series

Postby xorlosch » Fri Oct 24, 2008 9:10 am

Thanks for your help. It worked out well.

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

Re: How to run a ADF unit root test for multiple series

Postby EViews Gareth » Fri Oct 24, 2008 10:32 am

Great.

As an aside, you don't need to create the ADF table as 50 by 50. EViews tables will resize automatically.

Thus you can just create the table without sizing it, then everytime you put something into a row or column, EViews will resize the table if that row or column doesn't already exist.

seg_b
Posts: 15
Joined: Wed Mar 30, 2011 7:10 am

Re: How to run a ADF unit root test for multiple series

Postby seg_b » Mon May 16, 2011 2:21 am

Hi!

this topic was very helpful to me. But I used to program with SAS and I have to program a ADF unit root test for multiple series with Eviews.
So, my problem is I don't know how to freeze the uroot results into a table and grab the numbers from the table...

Could you help me, please.

Seg_b

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: How to run a ADF unit root test for multiple series

Postby trubador » Mon May 16, 2011 3:11 am

So, my problem is I don't know how to freeze the uroot results into a table and grab the numbers from the table...
Then you will find the following link very useful: http://forums.eviews.com/viewtopic.php?f=5&t=18

seg_b
Posts: 15
Joined: Wed Mar 30, 2011 7:10 am

Re: How to run a ADF unit root test for multiple series

Postby seg_b » Wed May 18, 2011 5:48 am

thanks a lot :)

seg_b
Posts: 15
Joined: Wed Mar 30, 2011 7:10 am

Re: How to run a ADF unit root test for multiple series

Postby seg_b » Wed May 25, 2011 1:41 am

Hi,

I used this topic to do my own programm to run a ADF unit root test for multiple series.
I just want to know how I can get the sum squared resid at every test.
I need it to run the F-test (if b=0 and if c=0)...

can someone help me again?
thanks.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: How to run a ADF unit root test for multiple series

Postby EViews Glenn » Tue Aug 12, 2014 9:36 am

Perform the Panel Unit Root test with the Im-Pesaran-Shin method, which will show you the intermediate results for each cross section.

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

Re: How to run a ADF unit root test for multiple series

Postby EViews Gareth » Tue Aug 12, 2014 9:05 pm

It looks, in the workfile you posted at least, as though firms are your cross-sections.

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

Re: How to run a ADF unit root test for multiple series

Postby EViews Gareth » Wed Aug 13, 2014 7:46 am

Perform the Panel Unit Root test with the Im-Pesaran-Shin method, which will show you the intermediate results for each cross section (firm).


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests