Am 18.06.2021 um 22:47 schrieb George Matysiak:
Thanks for that. To be clear, what I would like to do is save the
random selected observations and estimate a regression equation. This
is my training sample. The excluded observations would be my test
sample for forecasts - how could I save them as the test set? Can it
be done with the GUI or perhaps it needs a script? Thanks.
Again, CvDataSplitter by Artur sounds like it could be what you want.
Apart from that, with gretl's GUI you could do the following, although
it's maybe a bit tedious:
(the labels may not be exactly that, I'm too lazy to restart gretl in
English, so I'm re-translating on the fly)
1. Draw the random sample (menu Sample/ Random sample)
2. Create a sample range dummy (menu Add / Sample range dummy); say you
call that sd1
3. Restore the full sample (menu Sample / restore full range)
4. Apply the sample which complements the previous one: menu Sample /
restrict by condition, and in the condition field type in the formula:
"missing(sd1)" (without the quotes).
5. Create another sample range dummy for this second sample range: like
in step 2 (say, call it non_sd1)
You can now go back and forth between those samples if you wish. If the
missing values in the dummies bother you and you prefer to have zeros
there, you can use the misszero() function (but not directly in the GUI,