On Mon, 5 Apr 2010, Leandro Zipitria wrote:
Dear Allin,
thanks a lot for your script !
You're welcome -- this was quite an interesting challenge.
Let me just ask an easy question. As now I have the data in
gretl format, I can sort the data the way you tell in number b).
I have already try it and I think it works. What I' ve done is:
dataset sortby Supermarket && Year && Month && Product As I have
not found it in the User Guide, I think it could recursively
sort the dataset in that specific order (first by Supermarket,
then by Year, etc.). I have tried and, as far as I check it, it
works. Tell me if it is correct.
No, I'm afraid you must have just "got lucky". The "dataset
sortby" command takes just one series argument, there's no
provision for a hierarchical sort. It might be a good idea to
extend this command to take a list argument.
But anyway, I'm attaching a version of my script which requires
only that the dataset be sorted by supermarket (and it does that
internally, the original data rows can be in any order). This new
script goes the whole way, creating a panel dataset. It works on
your sample file and I guess it should work on your full file; I
believe that the only change that should be required is adjusting
the name of the XLS (or gdt) file to read in the first instance.
Allin Cottrell