On Sat, Jul 15, 2023 at 4:20 PM Cottrell, Allin <cottrell(a)wfu.edu> wrote:
On Sat, Jul 15, 2023 at 2:53 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
>
> Hello panel devotees,
>
> I believe I'm seeing a bug in cumulated sample restrictions in the panel
> context [...]
Here's a minimal example of what you describe [...]
A little more explanation might be in order. When a gretl dataset is
sub-sampled by a boolean condition that selects non-contiguous
observations, there are two (and only two) copies of the dataset in
existence: the full one in the background and the restricted one in
the foreground. When a second non-contiguous restriction is imposed
(without the --replace flag) we're not going to create a third copy of
the dataset. Instead we (1) record the existing restriction, (2)
restore the full dataset, (3) compute the logical product of the prior
restriction and the new one, then (4) apply the logical product to the
full dataset to create the new restricted one.
That is, if restriction R1 is in place and then gretl is asked to
apply another restriction R2, things basically work as if gretl did
smpl full
R3 = R1 && R2
smpl R3 --restrict
In many cases the result will be the same as applying R2 _in the
context of R1_, but if R2 contains a term that is not invariant with
respect to sub-sampling such as max() or min() applied to a series,
the results will differ.
Allin