On Fri, 4 Dec 2015, Sven Schreiber wrote:
as you will notice, I am currently working on a real-life panel
dataset,
and so here's another panel problem, with example; the following doesn't
work for me ("no obs would be left"):
<hansl>
open abdata.gdt
smpl IND == 3 --restrict # leaves 89 obs
smpl unit == min(unit) --restrict # lowest unit value of the 89 obs is 6
</hansl>
My guess is that gretl evaluates min(unit) not as the lowest in-sample
value (after applying the first restriction), but instead looks for the
global minimum (which is 1). Then the two restrictions cannot hold
simultaneously.
That's right. This is required if
smpl <whatever> --restrict --replace
is going to work.
But I think that all gretl functions that take a series argument
always
work on the currently defined sample, right? If so, then this looks like
a bug.
I wouldn't say so. To do what you want:
<hansl>
open abdata.gdt
smpl IND == 3 --restrict
scalar minu = min(unit) # get the sample-local minimum
smpl unit == minu --restrict
</hansl>
Allin