In August I raised the possibility of extending the dummify function
to accommodate syntax such as
list dlist = dummify(x, n)
where n <= 0 means that no category is dropped, while n > 0 means
that the n-th category is dropped. For this to work, it would be
necessary to require that x is a series, whereas in its current
version dummify(X) will work with a list X.
After some discussion I think that this was put on the list of
backwards incompatible changes, but it does not appear in the current
version of the gretl wiki which discusses such changes. Is there a
consensus that the extension is desirable or are there reasons for
not implementing it?
As with other things my proposal is driven by the difficulty of
programming functions. The command "dummify x" will create a
complete set of dummy variables. The difficulty is that in a
function it is quite difficult to turn these dummy variables into a
list when you don't know how many values x may take, whether they are
consecutive, etc. On the other hand, the command "list
dlist=dummify(x)" will always drop the first category. There is a
clumsy way of generating the missing dummy variable by using matrices
but it is inefficient and will fail in some circumstances. Hence,
the more flexible syntax is much cleaner.
Gordon