Page 1 of 1

Storing test statistics from simulation

Posted: Sat May 16, 2015 3:19 pm
by flurp
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

Re: Storing test statistics from simulation

Posted: Sat May 16, 2015 8:50 pm
by EViews Gareth
You're grabbing the 7th row, 5th column of the table. That is only a single element.

Re: Storing test statistics from simulation

Posted: Sun May 17, 2015 12:40 am
by flurp
Thanks for the reply.

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

Re: Storing test statistics from simulation

Posted: Sun May 17, 2015 5:10 pm
by EViews Gareth
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))