Hello,
Eviews 8 here. I have string vector with 15 names. I want to drop 2 names (based on certain criteria) from this svector and create new svector (13) with the rest of the names. I used If statement and it correctly identifies the names (let's say 5th and 10th) that I want to drop but when the code creates new svector it leaves rows 5 and 10 blank for dropped names. How can I bypass the empty rows and svector would move lower names into empty rows?
Here is the simple loop that I used:
!lead=@columns(TIME1) '13columns
!all=@rows(all) '15 rows
svector(!lead) svec
for !i=1 to !iall
if test(!i)=0 or test(!i)<0 then
svec(!i)=all(!i)
endif
next
string vector question
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
Re: string vector question
I am not sure if there is a shortcut to pull out the elements of a svector as a string, but the following should do trick for you:
Code: Select all
%slist = ""
%drop = ""
for !i = 1 to @rows(svec)
%slist = %slist + " " + svec(!i)
if test(!i)=0 or test(!i)<0 then
%drop = %drop + " " + svec(!i)
endif
next
svector svec = @wsplit(@wdrop(%slist,%drop))Who is online
Users browsing this forum: No registered users and 1 guest
