Am 04.12.2015 um 18:28 schrieb Sven Schreiber:
Hi again,
as you will notice, I am currently working on a real-life panel dataset,
and so here's another panel problem, with example; the following doesn't
work for me ("no obs would be left"):
<hansl>
open abdata.gdt
smpl IND == 3 --restrict # leaves 89 obs
smpl unit == min(unit) --restrict # lowest unit value of the 89 obs is 6
</hansl>
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.
thanks,
sven