ADF test on multiple variables and saved in a table

For questions regarding programming in the EViews programming language.

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

New_user_ds
Posts: 2
Joined: Tue Oct 23, 2018 12:06 pm

ADF test on multiple variables and saved in a table

Postby New_user_ds » Wed Oct 24, 2018 6:43 am

Hello,

I seek to improve the efficiency of performing ADF tests on group of variables.
I want the eviews to test each variable in the the group and report back t-stat or pvalue (if possible) in a matrix corresponding to the variable name.
There would be two ADF tests: (1) including constant and (2) constant and trend.
Hence there would be a 2x6 matrix.

Currently my code is as follows, and please tell me where it's wrong with the necessary adjustments.

Code: Select all

group unit_root x1 x2 x3 x4 x5 x6
table(6,6) unit_root_results
for !i=1  to  unit_root.@count
%name = unit_root.@seriesname(!i)
uroot(adf, const,  dif=0,  save=root_c)  {%name}
uroot(adf,const,trend, dif=0, save=root_c) {%name}
unit_root_results(1,1+!i)=%name
next


Thanks.

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

Re: ADF test on multiple variables and saved in a table

Postby EViews Gareth » Wed Oct 24, 2018 7:07 am

Code: Select all

unit_root_results(1,1+!i)=%name


needs to be grabbing the correct element out of root_c, not %name.
Follow us on Twitter @IHSEViews

New_user_ds
Posts: 2
Joined: Tue Oct 23, 2018 12:06 pm

Re: ADF test on multiple variables and saved in a table

Postby New_user_ds » Fri Oct 26, 2018 2:51 am

EViews Gareth wrote:

Code: Select all

unit_root_results(1,1+!i)=%name


needs to be grabbing the correct element out of root_c, not %name.



With what line of code do I need to realise that? I think the code up until " uroot( adf, const, dif=0, save=root_c) {%name] " is correct. What is the code to ensure that?

Code: Select all

group unit_root log(rc) log(pedy) log(psh) log(ph) log(dep) rcb
table(6,6) unit_root_results   
for !i=1 to unit_root.@count   
%name= unit_root.@seriesname(!i)   
uroot( adf, const, dif=0, save=root_c) {%name}   
uroot(adf,const,trend, dif=0, save=root_c) {%name}
unit_root_results(1,1+!i)=%root_c
next

serdarbhr
Posts: 1
Joined: Sat Dec 08, 2018 12:44 pm

Re: ADF test on multiple variables and saved in a table

Postby serdarbhr » Sun Dec 09, 2018 10:59 am

Hi

I am totally starter on eviews

ı have multiple series and I d like to make adf unit root test

do you have any recommendation for me

thanks in advance


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 33 guests