Dear fellow translators,
I'm sorry if this is a duplicate message, but the next gretl release
--most probably the final one for this year-- isn't too far away. So if
you (like me) are not updating the translations super-regularly, now
might be a good time, so that the translated strings make it into what
will be gretl 2023c.
Feel free to forward this message accordingly, as I'm not sure if every
translator is on this list.
As always, thank you for your work with the gretl project!
while working on the wiki blog entry, I've noticed that with respect to
the new multiple-bands syntax, there's a mistake in the documentation
for gnuplot; it contains the line:
bundles bb = array(b1, b2)
This should be 'defarray' instead of 'array'.
I can apply the trivial fix myself, but for now I'm reporting it here
before I forget.
I set up a gdt file with dataset used in the famous "NJ-vs-Pennsylvania"
article by Card & Krueger on the minimum wage.
Since I figure this could be useful to everyone teaching (and learning)
causal effects, diff-in-diff and all that, I added it to our
/share/data/misc catalogue. Pushed to git.
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
This is somewhat related to recent discussion of "Binary Logit with
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
Consider the following CSV (I'll call it strorder.csv):
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
Anyway, here's a hansl prototype for such a function. The idea is
that you pass in the original series along with an array in which
the original string values are ordered as you want them coded, and
you get back a new string-valued series.
set verbose off
function series strorder (series x, strings S)
Sx = strvals(x)
ns = nelem(Sx)
if ns != nelem(S)
funcerr "Replacement strings array is of wrong length"
matrix v = zeros(ns, 1)
chk = instrings(S, Sx[i])
if rows(chk) == 0
funcerr "Bad replacement string"
v[i] = chk
series ret = replace(x, seq(1,ns), v)
open strorder.csv -q
print "string values of income:"
income2 = strorder(income, defarray("low", "middle", "high"))
print "string values of income2:"
print income income2 -o # should be identical
print "string values of working:"
working2 = strorder(working, defarray("no", "yes"))
print "string values of working2:"
print working working2 -o # should be identical
I just stumbled over the following challenge.
In the first example, I run a binary logit with a numeric (discrete)
encoded variable "dirnum".
In the second example, the dependent is string-valued series "dirstr"
with only two distinct values ("down", "up").
The logit command estimates a binary logit for the first example (as
expected) and a ordered logit for the 2nd example, however.
The reason might be that for "stringified" series, the minimal distinct
value is 1 and not zero.
Even though the magnitude of the coefficients are equals, the sign may
differ. Also, some statistics such as R^2 and the contigency table are
not printed for the ordered case.
Is this an expected behavior?
set verbose off
series ret = ldiff(close)
series dirnum = ret >= 0 ? 1 : 0 # 0-based
series dirstr = ret >= 0 ? 2 : 1 # has to be 1-based for stringify() to
strings direction = defarray("down", "up")
print -o --range=1:3
# Both only have two distinct values
logit dirnum const # binary logit
logit dirstr const # ordered logit
in short: --cluster=period works as announced, but with two-way
clustering --cluster=period,unit doesn't work, one has to create a
series mimicking the period (e.g., genr time).
I guess this is an oversight and not intended.
Also, Allin, off-list you said that "set panel_robust driscoll_kraay"
now is a further option, but with yesterdays's snapshot I'm getting an
invalid value error. Is this in a different branch or not pushed or