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>
Artur
Am 12.12.2016 um 20:53 schrieb Allin Cottrell:
On Mon, 12 Dec 2016, Artur T. wrote:
> Dear all,
>
> I stumbled over the following issue:
>
> <hansl>
> nulldata 3
> series x = {1,0,1}
> x = zeromiss(x)
> x # as expected
> x = cum(x)
> x # shouldn't it be: 1|NA|2 ?
> </hansl>
>
> Is it intended that NAs break the cumulation of values by cum(), or is
> it a bug?
Well, it's consistent with the general policy that x + NA = NA, for all
x. Is there a reason to make an exception for cumulation? I would say
it's up to the user to substitute an estimate for a missing value (or to
choose a sample range without NAs) if he/she wants to cumulate a series.
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users