Le mer. 30 déc. 2020 à 14:28, Artur Bala <artur.bala.tn@gmail.com> a écrit :

Le mer. 30 déc. 2020 à 13:59, Sven Schreiber <svetosch@gmx.net> a écrit :
I don't see this problem here. You might have to send us a
self-contained example, preferably with one of gretl's shipped datasets.
 
Thank you Sven. I'll manage to send it over.

Hi Sven,
Here's attached the function. Does this help? 
Please note that the function still needs some fine-tuning.
In the sample script I also included 2 lines (refering to "lever")  that make the function fail.

Best,
Artur