On 14/11/2023 16:24, Allin Cottrell wrote:
This is somewhat related to recent discussion of "Binary Logit
with
string series".
As you may know, when gretl reads string-valued series from (e.g.) a CSV
file, consecutive 1-based numeric codes are attached to the strings in
their order of occurrence. In some cases that's fine, but if the string
values have a "natural" ordering it may not be so fine.
[...]
On importing these data "high" will get code 1,
"low" code 2, and so on.
One may want to recode income as low=1, middle=2, high=3, and also
recode working as no=1, yes=2. That's not super difficult in hansl, but
I wonder if it would be worthwhile to provide a built-in function to do
the job: this could be a new function, or perhaps could be enabled as a
variant of strvsort(), via an optional second argument.
I like the idea of giving a second argument to strvsort(), in the
interest of keeping the namespace as compact as 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
-------------------------------------------------------