Page 1 of 1
Creating and exporting Unit root tests for several countries
Posted: Wed Apr 09, 2014 6:43 am
by thomas84
Hi,
I want to create individual unit root tests for 15 countries and export the results into excel. So far, I have done unit root tests for each country individually, it is quite tidious. Is there a more efficient way? I have tried to do individiual tests for all countries together (as a group) but the output only gives me p-values (e.g. ADF and Fisher test). I need the t-statistics. Any idea is appreciated.
Thank you,
Thomas
Re: Creating and exporting Unit root tests for several count
Posted: Wed Apr 09, 2014 7:44 am
by EViews Gareth
Best way is to write a program that automates it for you. Just a simple for loop will do the trick.
Re: Creating and exporting Unit root tests for several count
Posted: Tue Apr 29, 2014 2:57 am
by thomas84
Hi,
Thank you for this update. I am now trying to write a loop but I am only an enthusiastic amateur. Could you give me feedback on this one or any reference where I can study programming?
I started to write down the following, testing for level:
group g
table ADF
for !i = 1 to g.@count
U1 = g.@logc( !i)
uroot (adf,const,dif=0,info=sic, save=level1) {U1}
ADF(1,1+!i) = U
ADF(2, 1 +!i) = level1(3,1)
uroot (adf,trend, dif=0, save=level2) {U1}
ADF(3, 1+!i) = level2(3,1)
next
It is based on another post in this forum. However, while Eviews runs the program the ADF table remains empty. I would appreciate your help on this.My file name is logc which includes 15 countries and I would like to call the series U1.
Best,
Thomas
Re: Creating and exporting Unit root tests for several count
Posted: Tue Apr 29, 2014 7:50 am
by EViews Gareth
Code: Select all
group g
table ADF
for !i = 1 to g.@count
%U1 = g.@seriesname(!i)
uroot(adf,const,dif=0,info=sic, save=level1) {%U1}
ADF(1,1+!i) = %u1
ADF(2, 1 +!i) = level1(3,1)
uroot (adf,trend, dif=0, save=level2) {%U1}
ADF(3, 1+!i) = level2(3,1)
next
Re: Creating and exporting Unit root tests for several count
Posted: Thu May 15, 2014 1:28 am
by thomas84
Thank you for this program. However, the ADF table remains empty. I tried with different series names but interestingly Eviews does not give me an error message even when I put in a series name that does not exist in my work file. So I assume the problem might be related to the command g.@seriesname. Do you have any suggestions what could be the issue and what could be done to solve it?
Thank you!
Re: Creating and exporting Unit root tests for several count
Posted: Thu May 15, 2014 3:08 pm
by EViews Gareth
Does your group have series in it?
Re: Creating and exporting Unit root tests for several count
Posted: Tue May 20, 2014 4:51 am
by thomas84
I have 15 countries with time series data from 1960 to 2013. So take consumption for example, I have c1 to c15 which illustrate the countries containing the time series data. I put in the seriesname but it remains empty.
Re: Creating and exporting Unit root tests for several count
Posted: Tue May 20, 2014 8:24 am
by EViews Gareth
Put your series into the group G.
Re: Creating and exporting Unit root tests for several count
Posted: Fri May 23, 2014 3:30 am
by thomas84
Ok, I grouped the variables first now and hopefully it works then. However, Eviews now displays an error message that I have "Too many arguments in the unit root command (adf, trend, ...)". Therefore I cannot execute the program. I had this before but somehow it worked again so I do not know what this issue is about. Sorry about this.
Best
Re: Creating and exporting Unit root tests for several count
Posted: Fri May 23, 2014 6:52 am
by EViews Glenn
What is the line in your program that has the word "uroot"?.
Re: Creating and exporting Unit root tests for several count
Posted: Sat May 24, 2014 8:51 am
by thomas84
I literally took the command you provided. So it is the first line with level 1. I attach the screenshot. Thank you...
Re: Creating and exporting Unit root tests for several count
Posted: Sat May 24, 2014 10:55 am
by startz
You probably have a space after "uroot" that should be deleted.
Re: Creating and exporting Unit root tests for several count
Posted: Tue Mar 03, 2015 7:23 am
by thomas84
Yes, that was the problem. Thank you! I am now having the ouput with two rows, presumably the ADF t statistics. Thank you!