On Wed, 2 Mar 2022, Sven Schreiber wrote:
Am 01.03.2022 um 21:21 schrieb Allin Cottrell:
> The problem exposed by check2() lies in libgretl's automatic compounding
> of a "--unit" style restriction with a regular --restrict. It works fine
> if you compound them manually in a single command:
>
> ? smpl $unit == 5 and dates < 20010101 --restrict
> Full data set: 1708 observations
> Current sample: 40 observations
Right, verified that that is a workaround for my problem, thanks. (After
doing a "smpl full" before; alternatively I guess adding --replace would
also work, but haven't explicitly tested that.)
> But anyway, you're right, more work is needed in this area.
Let me repeat -but now explicitly- the code that lets gretl crash, as
this is probably the most important case:
<hansl>
# assuming checkdata.gdt is loaded...
smpl full
setobs 4 1991:1 --panel-time
smpl 1991:1 2017:4 --time # n = 1512
function void check2 (series x)
series dates = $obsdate
smpl 5 5 --unit
smpl 1991:1 2000:4 --time
smpl
end function
check2(UKIB)
</hansl>
That case is now fixed in git. (And as a side-effect, subsampling a
panel dataset in the time dimension should be somewhat more
efficient.)
However, working on the fix brought home to me how complex things
can get when compounding sub-samplings within a function, where the
panel has already been sub-sampled before the function is called. So
I'm not going to claim that everything is now OK, and I'll do some
more investigation.
Allin