On Sat, 5 Dec 2015, Sven Schreiber wrote:
Here's another problem that may be related, because a common
theme is
the combination of panel data and subsampling. But now it's about the
pxsum() function. Here's a minimal example script:
<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. (There
has been a feature request on the tracker by myself for a long time
calling for a behavior of pxsum that ignores missings, but that has
never been done AFAIK and thus is a different issue.)
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.
This one is a bug, for sure. But I don't think it's related to your
previous panel-sampling point. It would seem that the the excluded
unit 3 is somehow not being ignored but instead being treated as
all-NA for the purposes of pxsum().
Allin