Hi Artur
That actually worked, I didn't thought it like that, thank you so much!
________________________________
De: Artur Bala <artur.bala.tn(a)gmail.com>
Enviado: lunes, 22 de marzo de 2021 12:59
Para: Gretl list <gretl-users(a)gretlml.univpm.it>
Asunto: [Gretl-users] Re: Deleting values in a dataset (data transformation)
Hi Yago,
What about restricting the sample and make the changes like this:
smpl RowNumber > 0 --restrict
Exited= NA
smpl full
Or another way (more compact)
Exited = (RowNumber > 0)? NA; Exited
Best,
Le lun. 22 mars 2021 à 13:51, Iago Varela
<iagovar@outlook.com<mailto:iagovar@outlook.com>> a écrit :
Hi, I'm Yago, new to gretl.
My question is the following:
I have a dataset with 11k observations.
I have a bunch of "series", being 'RowNumber' and 'Exited' two
of them.
I basically want to set 'Exited' values to 'Null' (or the Gretl
equivalent) where 'RowNumber' > 10000
I've been trying with the Gretl documentation to figure out how to do this, but apart
for being an absolute beginner at programing, it appears that foreach loops can't be
used with series, or that's what the console says.
I figured out that my 'pseudocode' would be something like:
loop foreach RowNumber Exited
if RowNumber > 10000
Exited = Null
endif
endloop
I've been trying for a couple days, also emulating Foreach loops from other languages,
unsuccesfully, hope someone can explain this to me. It's probably something dumb
I'm missing out.
Thank you for your time!
Yago
_______________________________________________
Gretl-users mailing list --
gretl-users@gretlml.univpm.it<mailto:gretl-users@gretlml.univpm.it>
To unsubscribe send an email to
gretl-users-leave@gretlml.univpm.it<mailto:gretl-users-leave@gretlml.univpm.it>
Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/