I tried a simple example following your description and it worked fine. We'll need to see what's the active ingredient in your case.

On Mon, Jan 17, 2022, 6:07 PM Sven Schreiber <svetosch@gmx.net> wrote:
Hi,

I have a situation here where the "smpl ... --replace --restrict"
construct isn't working like (I, at least) expected. Sorry, I can't give
a minimal working example yet. The context is a panel dataset and we're
inside a hansl function where the series y was passed as an argument,
but series 'unit' was created locally inside the function from the $unit
accessor. 'donor' and 'target_group' are valid integers that are
actually present in the 'unit' series (I checked).

smpl unit == donor --restrict
matrix mydonor = {y}    # no problem here, works
smpl --full # should be redundant, but isn't -- perhaps a gretl bug?
smpl unit == target_group --replace --restrict

When I leave out the "smpl --full" line, I get an error message at the
last quoted line saying "no observations would be left".

Somehow it feels as if the "--replace" option here isn't honored.
Because then the error message would make sense; since 'target_group' is
a different unit than 'donor', putting the second restriction on top of
the first would leave an empty set. Again, inserting the smpl --full
line solves this, but it shouldn't be necessary, should it?

This is with the latest snapshot.

thanks

sven
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-leave@gretlml.univpm.it
Website: https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/