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.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------