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.
[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:
<hansl>
series year = 1990 + floor(0.25*(time-1))
series qtr = 1 + (time-1) % 4
series u = $unit
genr markers = "%d:%dQ%d", u, year, qtr
print x y -o
</hansl>
x y
1:1990Q1 -1.967416 0.066847
1:1990Q2 0.859100 0.765145
1:1990Q3 -0.352855 -0.665747
1:1990Q4 -0.100864 0.066031
1:1991Q1 -0.427178 0.998856
...
2:1993Q2 0.952505 -0.278118
Allin