Help with storing the p-values from a unit root test

For questions regarding programming in the EViews programming language.

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

marcus1985
Posts: 3
Joined: Sun Feb 03, 2013 2:13 am

Help with storing the p-values from a unit root test

Postby marcus1985 » Sun Feb 03, 2013 4:41 am

Dear Eviews experts,

I have 52 series for which I want to run a unit root test and then store the p-values in a 52,1matrix. My dependent variables are placed in a group, ys.

My code for the unit root test procedure is:

Code: Select all

matrix (52,1) ys_adf for !i=1 to ys.@count freeze(adftable) ys.uroot(adf, trend, info=sic) ys_adf= @val(adftable(7,5)) d adftable next
The program runs through, but I only get N/A's as values in my matrix. My problem is that I cant find the p-values inside the table! I have looked a lot around the forum and in the users guides, but can not find the correct positions anywhere :(

I have managed to write programs that performs and stores the p-values for an LM-test and for a Whites test. The P-value positions were (4,5) and (3,5) respectively. But for the unit root tests it seems more tricky.

I would be very thankful if anyone knows where the p-values are located in the unit root output? Is there a guide somewhere that states where each statistic is stored in a specific output table?

Also, if there is something wrong with the code I would be thankful for corrections and if someone has a working program for this I would be very happy.

Thanks a lot in advance/ Marcus

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

Re: Help with storing the p-values from a unit root test

Postby EViews Gareth » Sun Feb 03, 2013 8:14 am

You're doing the unit root test on the group, not the series in the group.

marcus1985
Posts: 3
Joined: Sun Feb 03, 2013 2:13 am

Re: Help with storing the p-values from a unit root test

Postby marcus1985 » Sun Feb 03, 2013 10:05 am

Thanks for your comment Eviews Gareth. I would like to run the ADF test for each individual series in the group. First series y1 and store the p-value, then y2 etc. It should be simple, but I hav'nt made it work yet. I will continue, but if you or anyone else have the code I would be very thankful :wink:

/Marcus

marcus1985
Posts: 3
Joined: Sun Feb 03, 2013 2:13 am

Re: Help with storing the p-values from a unit root test

Postby marcus1985 » Sun Feb 03, 2013 11:16 am

Solved it! Using an example from you Eviews Gareth and fiddling around with it a little bit. Here is the code if anyone needs it sometime :wink:

Code: Select all

matrix (52,1) ys_p 'create empty equation to be used inside the loop equation eq 'counter of how many equations we have run !rowcounter=1 for !i=1 to 52 freeze(adftable) y{!i}.uroot(adf, trend, info=sic) ys_p(!rowcounter,1)=@val(adftable(7,5)) !rowcounter=!rowcounter+1 d adftable next
The program creates a matrix, runs a ADF-test through all the series named "y" and stores the p-values in the matrix. The t-statisic is in position (7,4) and p-value in (7,5) if you want to make an nx2 matrix. Modify the matrix dimensions and settings as you wish :)


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests