On Tue, 2 Feb 2016, Henrique Andrade wrote:
Dear Gretl Team,
I found an unexpected (at least for me) behavior using "markers"
command. Please take a look at the following code snippets and the
resulting output:
Input (1):
setobs 6 1:1 --stacked-time-series
genr markers = "%s:%02d", "2015", time
Output (1):
preco
2015:01 0
2015:02 24300
2015:04 0
2015:05 43492
2015:06 375277
When I try to use a series instead of a string I get this result:
Input (2):
setobs 6 1:1 --stacked-time-series
series ano = 2015
genr markers = "%d:%02d", ano, time
Output (2):
preco
2015: 01
01
0 0
2015:02 24300
2015:03 0
2015:04 0
2015:05 43492
2015:06 375277
Is this the intended behavior?
Well, pretty obviously not ;-)
I think you should find that if you do this both ways, it will come
out wrong the first time, but correct the second. However, both ways
will work correctly if you add the "time" variable first:
genr time
genr markers = "%d:%02d", ano, time
Something about the on-the-fly generation of "time" is interfering
with the construction of the first observation marker. This should be
fixable.
Allin