How to run a ADF unit root test for multiple series
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
How to run a ADF unit root test for multiple series
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
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.
Re: How to run a ADF unit root test for multiple series
My code looks like this at the moment:
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.
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
-
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
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:
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.
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
Re: How to run a ADF unit root test for multiple series
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
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.
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.
Re: How to run a ADF unit root test for multiple series
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
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
Re: How to run a ADF unit root test for multiple series
Then you will find the following link very useful: http://forums.eviews.com/viewtopic.php?f=5&t=18So, my problem is I don't know how to freeze the uroot results into a table and grab the numbers from the table...
Re: How to run a ADF unit root test for multiple series
thanks a lot :)
Re: How to run a ADF unit root test for multiple series
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.
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
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
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
Perform the Panel Unit Root test with the Im-Pesaran-Shin method, which will show you the intermediate results for each cross section (firm).
Who is online
Users browsing this forum: No registered users and 2 guests
