Code: Select all
'create a workfile
wfcreate q 1990 2010
'create a group which will contain the xs
group xs
'create 5 series
for %i GDP UNEMP INFL CPI M1
series {%i}=nrnd
xs.add {%i}
next
'create matrix to store wald statistics and p-values
matrix(10,2) Walds
'create empty equation to be used inside the loop
equation eq
''counter of how many equations we have run
!rowcounter=1
'run pairwise regressions between each series
for !i=1 to xs.@count-1
%iname = xs.@seriesname(!i)
for !j=!i+1 to xs.@count
%jname = xs.@seriesname(!j)
eq.ls {%iname} c {%jname}
freeze(waldtable) eq.wald c(1)=c(2) ' perform wald test and freeze it into a table called WaldTable
walds(!rowcounter,1) = @val(waldtable(6,2)) ' store wald statistic (which is in cell 6,2 of the table)
walds(!rowcounter,2) = @val(waldtable(6,4)) ' store wald p-value (which is in cell 6,4 of the table)
!rowcounter=!rowcounter+1 ' increment row counter
d waldtable ' delete the table
next
nextThank you!
