Hello, I have run this:
for %c {%grp}
for !j = 1 to var_{%c}.@neqn
vector(!j) ssr_{%c}(!j) = var_{%c}.@ssr(!j)
vector sum_ssr_{%c}(1)=@sum(ssr_{%c})
next
next
where %grp = h dev fixed flex open closed hdebt ldebt
Is there a way to generate a vector like this: ssrt_debt(1)= sum_ssr_ldebt+sum_ssr_hdebt, to sum only the sum_ssr vector for hdebt and for ldebt? I have run this but it doesn't work.
Thank you!
Generate a sum vector
Moderators: EViews Gareth, EViews Moderator
-
- EViews Developer
- Posts: 562
- Joined: Thu Apr 25, 2013 7:48 pm
Re: Generate a sum vector
Hello,
That said, if your sum_ssr_{%c} vectors are only ever going to hold one element, use scalars instead of vectors. And there's no point to calculating sum_ssr_{%c} until after you've finished calculating ssr_{%c}, i.e., move that statement after the inner for loop. Finally, you don't need the "(1)" that's currently in your program.
Code: Select all
vector ssrt_debt = sum_ssr_ldebt + sum_ssr_hdebt
That said, if your sum_ssr_{%c} vectors are only ever going to hold one element, use scalars instead of vectors. And there's no point to calculating sum_ssr_{%c} until after you've finished calculating ssr_{%c}, i.e., move that statement after the inner for loop. Finally, you don't need the "(1)" that's currently in your program.
Who is online
Users browsing this forum: No registered users and 13 guests