Am 03.03.19 um 16:40 schrieb Allin Cottrell:
On Sun, 3 Mar 2019, Artur Tarassow wrote:
> Hi,
>
> I've just stumbled about the --panel-time option for setobs. One of
> the things that always annoyed me was the lack of this feature. I am
> really happy its available now!
>
> However, the following doesn't work for me using latest git on ubuntu:
>
> <hansl>
> set verbose off
> clear
>
> N = 2 # cross-sectional dim.
> T = 14 # time dim.
> scalar NT = N*T
> nulldata NT --preserve
> setobs T 1:1 --stacked-time-series
> #setobs 7 2019-02-26 --panel-time
> setobs 4 1990:1 --panel-time
>
> series x = normal()
> series y = normal()
> print y x -o
> </hansl>
>
> However, the printout of the dataset does not comprise any
> information on dates and frequencies [...]
I see that the current doc fails to explain what exactly the
--panel-time apparatus is supposed to be good for. But, no, it doesn't
automatically change the observation markers; it's primarily intended
for plotting purposes. If you select your x series in the GUI,
right-click for "Panel plot" and select the default, you should see
that the x-axis shows time.
Ok, I see. Thanks for clarification.
[BTW, TODO: the special panel plot options don't yet have a
scriptable
representation.]
The following is a bit of a mouthful, but will set time-related
observation markers in your example:
I've implemented a function which generates a series of ISO dates for a
panel for which the user simply needs to provide the initial and last
date of the whole sample. Currently it is restricted to a 7-day week
frequency.
See here:
https://github.com/atecon/gretl_helper/blob/master/gen_panel_isodate_seri...
In case of a 5-day week or so, things become a bit more tricky as the
sequence of ISO-dates is not consecutive any more. It seems that (i)
opening an empty time-series data set, (ii) setting the frequency
correctly, (iii) storing an ISO-date series, (iv) opening a panel data
set and (v) appending the ISO-date series seems to be the most simple
way at the moment.
Best,
Artur