On Mon, 12 Dec 2016, Allin Cottrell wrote:
On Mon, 12 Dec 2016, Artur T. wrote:
> Ok, fair enough. But for what reason does this not work:
>
> <hansl>
> nulldata 3
> series x = {1,0,0}'
> x = zeromiss(x)
> x # as expected
> smpl x==1 --restrict
> x = cum(x) # cumulating a scalar value should be a scalar, right?
> x # but is actually NA
> smpl full
> x
> </hansl>
Hmm, that seems like a corner case but all the same I guess I would expect a
value of 1 for cum(x) with the sample restricted to a sample of a single
(valid) observation of 1. I'll look into it.
Having looked into it, I can confirm that this really is a corner
case. However, to satisfy the expected logic I have special-cased a
sample range of 1 observation such that cum() returns that
observation.
Allin