On Sat, 5 Dec 2015, Sven Schreiber wrote:
<hansl>
nulldata 12
setobs 4 1:1 --stacked-time-series
series hey = normal()
hey[1:3] = NA
genr unit
smpl unit < 3 --restrict
series check1 = pxsum(hey)
series check2 = pxsum(misszero(hey))
series check3 = pxsum(ok(hey))
</hansl>
'check1' will be correct, with missings in positions 1:3 and 2:3.
[...]
But 'check2' and 'check3' will be full of missings /
completely empty at
least within the current subsample, and that is clearly wrong IMO.
Instead check2 and check3 should have no missings at all.
Hope it's easy to find and fix the bug.
That's now found and fixed. The p* functions for panel statistics,
such as pxsum, were not confining themselves to the current sample
range. That wasn't a completely motiveless crime, since I originally
thought of them as providing values pertaining to the entire panel
dataset. Nonetheless, I agree that failing to respect the sample
range produces counter-intuitive results and is out of line with
other functions.
Allin