Hello All,
I would need a code to do pairwise regressions to test for cointegration relations among 8 variables with the Engle-Granger method (e.g. first running simple LS regressions then testing for the stationarity of the error terms). I know that it would mean running (n*(n-1))/2 (8*7/2=28) regressions. Could you please help me how I can run these regressions?
Many thans,
Laszlo
Pairwise regression code
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Pairwise regression code
This should get you started:
Code: Select all
'make some data
create u 100
for !i=1 to 8
series x!i=nrnd
next
'perform regressions
group xs x*
equation eq
for !i=1 to xs.@count-1
for !j=!i+1 to xs.@count
%iname = xs.@seriesname(!i)
%jname = xs.@seriesname(!j)
eq.ls {%iname} c {%jname}
eq.makeresids res_{%iname}_{%jname}
next
next
Follow us on Twitter @IHSEViews
Re: Pairwise regression code
Hello Gareth,
This seems to be working... Great help! Many thanks!
Laszlo
This seems to be working... Great help! Many thanks!
Laszlo
Who is online
Users browsing this forum: Google [Bot] and 11 guests