Sorry Jack, yes I tried it, something obvious must be slightly wrong
because your function misplaced the results, but I understood the logic,
simplified it to
<hansl>
function series rankingalt(series G)
matrix a = aggregate(const, G)
matrix b = cum(a[,2])
return replace(G, a[,1], b)
end function
</hansl>
and it works just fine.
Thanks!
Alecos Papadopoulos PhD
Athens University of Economics and Business
web:
alecospapadopoulos.wordpress.com/
On 22/9/2019 01:00, gretl-users-request(a)gretlml.univpm.it wrote:
> Send Gretl-users mailing list submissions to
> gretl-users(a)gretlml.univpm.it
>
> To subscribe or unsubscribe via email, send a message with subject or
> body 'help' to
> gretl-users-request(a)gretlml.univpm.it
>
> You can reach the person managing the list at
> gretl-users-owner(a)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: an alternative "ranking" function (Riccardo (Jack) Lucchetti)
>
>
> ----------------------------------------------------------------------
>
> Date: Sat, 21 Sep 2019 22:23:50 +0200 (CEST)
> From: "Riccardo (Jack) Lucchetti" <r.lucchetti(a)univpm.it>
> Subject: [Gretl-users] Re: an alternative "ranking" function
> To: Gretl list <gretl-users(a)gretlml.univpm.it>
> Message-ID: <alpine.DEB.2.21.1909212223160.23293(a)ec-4.econ.univpm.it>
> Content-Type: multipart/mixed;
> boundary="-842988409-1783199259-1569097430=:23293"
>
> This message is in MIME format. The first part should be readable text,
> while the remaining parts are likely unreadable without MIME-aware tools.
>
> ---842988409-1783199259-1569097430=:23293
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
> Content-Transfer-Encoding: quoted-printable
>
> On Sat, 21 Sep 2019, Alecos Papadopoulos wrote:
>
>> [Jack] you mean, something like this?
>>
>> <hansl>
>> function series rankingalt(series x)
>> matrix a =3D aggregate(const, x)
>> return replace(x, a[,1], cum(0 | a[1:rows(a)-1,2]))
>> end function
>> </hansl>
>>
>> AP: To the extend I understand the code, I don't think so. I want a ser=
> ies=20
>> that has the length of the sample, exactly as the "ranking" function
gi=
> ves.
>> The only difference between the "ranking" function and the
"rankingalt=
> "=20
>> function is that the "rankingalt" function
> But this is what the function does. Have you tried it?
>
> -------------------------------------------------------
> Riccardo (Jack) Lucchetti
> Dipartimento di Scienze Economiche e Sociali (DiSES)
>
> Universit=E0 Politecnica delle Marche
> (formerly known as Universit=E0 di Ancona)
>
> r.lucchetti(a)univpm.it
>
http://www2.econ.univpm.it/servizi/hpp/lucchetti
> -------------------------------------------------------
> ---842988409-1783199259-1569097430=:23293--
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Gretl-users mailing list -- gretl-users(a)gretlml.univpm.it
> To unsubscribe send an email to gretl-users-leave(a)gretlml.univpm.it
> Website:
https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/
>
>
> ------------------------------
>
> End of Gretl-users Digest, Vol 152, Issue 19
> ********************************************
>