I'm trying to loop over the index of an svector and do some operations using series whose variable names are in each element of the svector. For example, if I was to try to take the log of every variable, if my series names are all stores in an svector called indvar:
for !j = 1 to @rows(indvar)
series l_{ indvar({!j})} = log( { indvar({!j})} )
next
Then I get the error "INDVAR(1) is not a valid string name or scalar name in series l_{ indvar({!j})} = log( { indvar({!j})} )
from what it says in the programming reference guide I should be able to treat indvar(1) as a string, shouldn't I?
Also if I put the string into a temporary string like this:
for !j = 1 to @rows(indvar)
%derp = indvar({!j})
series l_{{ indvar({!j})}} = log( { indvar({!j})} )
series dl_{%derp} = dlog( { %derp } )
next
Can't pull out contents of an svector using {}
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Can't pull out contents of an svector using {}
Pulling them out into temporary strings should work.
Who is online
Users browsing this forum: No registered users and 2 guests
