On Wed, 23 Dec 2020, Artur Bala wrote:
2) I'd like to print out the 5 greatest values of a series. As
you may see
above, I first sort the whole dataset, then use print with range option and
finally sort again the dataset to revert to the initial position. Ok, these
operations come with no effort at all but, and this is just a suggestion,
would it be more intuitive if a sortby option be included in the print
command? Or a "dummy" option?
you can use the "ranking" function, as in
<hansl>
open greene9_1.gdt
smpl ranking(-labor) <= 5 --restrict
print labor --byobs
</hansl>
I'll admit it's not the most intuitive thing, but seems to work ok.
-------------------------------------------------------
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
-------------------------------------------------------