M\ny thanks Allin, appreciated.



On Sat, 19 Jun 2021 at 00:00, <gretl-users-request@gretlml.univpm.it> wrote:
Send Gretl-users mailing list submissions to
        gretl-users@gretlml.univpm.it

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        gretl-users-request@gretlml.univpm.it

You can reach the person managing the list at
        gretl-users-owner@gretlml.univpm.it

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gretl-users digest..."

Today's Topics:

   1. Re: Saving excluded observations from a Random sub-sample
      (Allin Cottrell)
   2. Re: Saving excluded observations from a Random sub-sample
      (George Matysiak)


----------------------------------------------------------------------

Date: Fri, 18 Jun 2021 13:12:08 -0400 (EDT)
From: Allin Cottrell <cottrell@wfu.edu>
Subject: [Gretl-users] Re: Saving excluded observations from a Random
        sub-sample
To: r.lucchetti@univpm.it, Gretl list <gretl-users@gretlml.univpm.it>
Message-ID:
        <alpine.LFD.2.20.3.2106181306530.713370@myrtle.attlocal.net>
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Fri, 18 Jun 2021, Riccardo (Jack) Lucchetti wrote:

> On Fri, 18 Jun 2021, George Matysiak wrote:
>
>> Having selected a Random sub-sample, is it possible to save the excluded
>> observations as variables? Thanks.
>
> I'm not sure I understand what you mean, but I'll give it a shot anyway: if
> you want to create a dummy variable holding included/excluded observations,
> there is more than one way to do so: a particularly simple one is to create a
> series of 1s when subsampling is in effect and then fill the excluded
> observation with 0s, as in
>
> <hansl>
> open data7-24
> smpl 100 --random
> series selected = 1
> ols salepric const sqft age city
> smpl full
> selected = misszero(selected)
> </hansl>
>
> of course, more sophisticated variants of the above are possible.

Here's a slight variation on Jack's theme.

<hansl>
open data7-24
smpl 100 --random
ols salepric const sqft age city
series uh = $uhat
smpl full
series excluded = missing(uh)
print uh excluded --byobs
</hansl>

However, my version gives an exact record of the observations
excluded by the random sampling only if all the included
observations were usable by ols.

Allin

------------------------------

Date: Fri, 18 Jun 2021 22:47:42 +0200
From: George Matysiak <gmatysiak@gmail.com>
Subject: [Gretl-users] Re: Saving excluded observations from a Random
        sub-sample
To: gretl-users@gretlml.univpm.it
Message-ID:
        <CAEWMk7u3z3LFGUeCxiJ+mpveXRx3GKCGRuG0Uk8rygGJ1-UFqw@mail.gmail.com>
Content-Type: multipart/alternative;
        boundary="000000000000d7954305c5107025"

--000000000000d7954305c5107025
Content-Type: text/plain; charset="UTF-8"

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.

--000000000000d7954305c5107025
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:tahoma,s=
ans-serif;font-size:small">Thanks for that. To be clear, what I would like =
to do is save the random selected observations and estimate a regression eq=
uation. This is my training sample. The excluded observations would be my t=
est 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.<br clear=3D"all"><=
/div><div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmai=
l_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><=
div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div =
dir=3D"ltr"><div><div dir=3D"ltr"><div><font style=3D"background-color:rgb(=
255,255,255)" face=3D"comic sans ms, sans-serif"><br></font></div><div><fon=
t style=3D"background-color:rgb(255,255,255)" face=3D"comic sans ms, sans-s=
erif"><br></font></div><i></i></div></div></div></div></div></div></div></d=
iv></div></div></div></div></div></div></div></div></div></div>

--000000000000d7954305c5107025--

------------------------------

Subject: Digest Footer

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


------------------------------

End of Gretl-users Digest, Vol 173, Issue 11
********************************************