Is there a way of summing the row elements of a group of series carrying the NAs as zeros? i.e. not having a NA result in the @rsum when one or more of the series has a NA value.
Thanks
Javier
@rsum
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: @rsum
Use @nan.
Code: Select all
group g @nan(x,0) @nan(y,0)
@rsum(g)Re: @rsum
Thanks, clever solution. I have series names in a string and wrapping each of them in @nan(,0) becomes complicated (with @wcross), an off-the-shelf solution could be great. Gareth, could you please add a variation of @rsum that carries NAs as zeros?
Javier
Javier
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: @rsum
I'm confused. @rsum should not propagate NAs unless all elements are NAs.
If the latter point is the issue, you could always recode the end result.
series y = @rsum(group01)
y = @nan(y, 0)
If the latter point is the issue, you could always recode the end result.
series y = @rsum(group01)
y = @nan(y, 0)
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: @rsum
I should point out that your suggestion does work...
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: @rsum
Can't we just pretend that this morning @RSUM propagated NAs, so didn't do what Javiersan wanted, but then he asked me to make a variation that didn't propagate NAs (unless all are NA), which I then did and magically updated all copies of EViews 7? I think that way everyone comes out a winner.
Who is online
Users browsing this forum: No registered users and 2 guests
