Storing test statistics from simulation

For questions regarding programming in the EViews programming language.

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

flurp
Posts: 2
Joined: Sat May 16, 2015 2:58 pm

Storing test statistics from simulation

Postby flurp » Sat May 16, 2015 3:19 pm

Hi

I am trying to do a simulation to test the power of the ADF test for near unit root process, so basically simulate a number of AR(1) processes and test them with ADF. Almost everything seem to work, but as a last step I want to gather the t-statistics, frozen into tables, into a vector and I cant figure out a way to make this work. There is no error messages but the vector only contains one value, and its not one of the t-values. What am I doing wrong?

Thanks

Here is the code so far:

Code: Select all

wf create u 1000 'AR parameter !phi1=0.9 !sigma2 = 1 for !i=1 to 5 smpl @first @first series y{!i}=0 smpl 2 @last series y{!i}=!phi1*y{!i}(-1)+nrnd*@sqrt(!sigma2) smpl 900 @last y{!i}.uroot(trend, info=aic) freeze(tabl{!i}) y{!i}.uroot next for !i=1 to 5 vector t=@val(tabl{!i}(7,5)) next

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

Re: Storing test statistics from simulation

Postby EViews Gareth » Sat May 16, 2015 8:50 pm

You're grabbing the 7th row, 5th column of the table. That is only a single element.

flurp
Posts: 2
Joined: Sat May 16, 2015 2:58 pm

Re: Storing test statistics from simulation

Postby flurp » Sun May 17, 2015 12:40 am

Thanks for the reply.

Ok, is there any way to grab one element from each table and getting them into one vector or series?

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

Re: Storing test statistics from simulation

Postby EViews Gareth » Sun May 17, 2015 5:10 pm

Create the vector outside of your for loop. Then inside your for loop, set the ith element of the vector equal to the table element"

Code: Select all

t(!i) = @val(tab1{!i}(7,5))


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests