I have a sample of 40 countries (id =1,2,...40) with variables x and y (x1,y1,x2,y2...x40,y40) . I wanted to loop in VAR with some specific conditions. For example,if a country has an id 4,7,10,15,32,34 I want to use lag length of 1, but if country has an id 1,2,9,11,23 I want to use lag length of 2, if a country has an id 19,33,20 I want to use lag length of 3 and for other lag length of 4. I use a following sample code:
Code: Select all
for !j=1 to 40
if !j=4 or 7 or 10 or 15 or 32 or 34 then
var m{j}.ls(p) 1 1 y{j} x{j}
else
if !j=1 or 2 or 9 or 11 or 23 then
var m{j}.ls(p) 1 2 y{j} x{j}
else
if !j=19 or 33 or 20 then
var m{j}.ls(p) 1 3 y{j} x{j}
else
var m{j}.ls(p) 1 4 y{j} x{j}
endif
endif
endif
endif
next
However, eviews gives me the syntax error for this. Any help in this regard will be highly appreciated.