On 16/09/12 22:40, Riccardo (Jack) Lucchetti wrote:
...
Does this help?
<hansl>
open bjg.gdt
series year = 1949 + floor((t-1)/12)
series month = 1 + ((t-1)%12)
</hansl>
--------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Economia
A different possibility is to play with strings. We have the command
'obslabel' for this.
For example, if the observations are quarterly, this code writes the
year of the 't' observation into the string 'iyear' and the quarter into
the string 'iquarter': (where t=1, 2, 3, ... is the 1-based index of the
observation: )
<hansl>
string s = obslabel(t)
sscanf s, "%d:%d", tyear, tquarter
</hansl>
If you need it, you may then put the strings in scalars in this way:
scalar ty=@tyear
scalar tq=@tquarter
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.ehu.es/ignacio.diaz-emparanza/
www.ea3.ehu.es