andreas.karlsson(a)ltv.se schrieb:
r.lucchetti(a)univpm.it @ INTERNET skrev 2007-05-22 16:10:30 :
[snip]
> ceiling() whould be easy to do. However, with a bit of dexterity you can
> coerce the "int" function to do what you want; for example:
>
> nulldata 100
>
> x = int(uniform()*6)/2
> f = int(x)
> c = (x-f) ? f+1 : f
It surely would be easier to use genr y = ceiling(x)
Well I guess that Jack meant that you define a reusable function that
does that.
> As for "mode()", I'm all for it, provided we find a sensible way to
handle
> multi-modal variables.
Also, when we are discussing new functions, a "rank()" function for the
"genr" command, that gives the ranks of the values in a vector, with ties
resulting in ranks being averaged, would be useful.
Again, why can't you use a user-defined function?
IMHO it's better if the developers work on implementing generic stuff,
and we users write scripts for our special needs. It may still be the
case that there are good reasons why your suggestion should be
implemented directly inside gretl, but then I would like to hear them.
(Aside from that, I wouldn't call it rank because of the rank concept in
linear algebra.)
cheers,
Sven