On Sat, 24 Sep 2016, oleg_komashko(a)ukr.net wrote:
Dear Allin,
I thought I found such example
(that is, an example of a list-generating command overwriting an
existing series)
in the first message:
(that is,
http://lists.wfu.edu/pipermail/gretl-devel/2016-September/006938.html
)
open denmark.gdt
series LRY_LRM = IBO
Head of LRY_LRM :
LRY_LRM
1974:1 0.1547356
1974:2 0.1779912
list x = LRY LRM
square(x,1)
new head of LRY_LRM:
LRY_LRM
1974:1 68.67460
1974:2 68.16070
You're right. In my reply to your original post I was misremembering
the nature of the check that we perform when doing things like
square, lags, log and so on (functions that create a set of
automatically named series).
What we ensure is that the auto-names are unique (the set of
auto-names contains no duplicates), NOT that we don't overwite any
existing series.
Here's how the uniqueness issue arises. When you use ldiff, "ld_"
gets stuck in front of the original name, when you generate
cross-products two series names get stuck together with an
underscore, and so on. If your original series names are long, they
may have to truncated to meet the 31-character limit on gretl
identifiers, and two or more generated names may be the same after
truncation. If that happens, we apply a "mangling" rule to ensure
uniqueness.
As for overwriting existing series, avoiding that (if you want to
avoid it -- in some cases, of course, overwriting may be
intentional), that's up to the user. If you have (as you describe in
your original post) "a large data set with hundreds of variables and
hundreds of new dummies and interactions", you would be well advised
to take charge of the naming yourself. You can generate a list of
transformations from a list of inputs using a "foreach" loop plus
the genseries() function.
I suppose we could add a "set" variable -- maybe something like
set auto_overwite off
such that if any built-in list-generating function would overwrite
an existing series it terminates with an error.
Allin