Re: [Gretl-users] extracting month number

2012-09-17 Thread Allin Cottrell
On Mon, 17 Sep 2012, Allin Cottrell wrote: > If series results are wanted, here's a variant on Ignacio's > suggestion. It's bulkier than Jack's suggestion, but it doesn't > depend on knowing the starting year and quarter in advance: > > > open data9-7 > series quarter year > scalar tyear tquart

Re: [Gretl-users] extracting month number

2012-09-17 Thread Ignacio Diaz-Emparanza
On 17/09/12 11:29, Ignacio Diaz-Emparanza wrote: > 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 str

Re: [Gretl-users] extracting month number

2012-09-17 Thread Ignacio Diaz-Emparanza
On 16/09/12 22:40, Riccardo (Jack) Lucchetti wrote: > ... > Does this help? > > > open bjg.gdt > series year = 1949 + floor((t-1)/12) > series month = 1 + ((t-1)%12) > > > -- > Riccardo (Jack) Lucchetti > Dipartimento di Economia A different pos

Re: [Gretl-users] extracting month number

2012-09-17 Thread Allin Cottrell
On Mon, 17 Sep 2012, Ignacio Diaz-Emparanza wrote: > 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 s

Re: [Gretl-users] extracting month number

2012-09-17 Thread Jack
On Mon, 17 Sep 2012, Annaert Jan wrote: > Very compact, as always. But it wouldn't work for a dataset with weekly > or daily frequency, would it? For daily data, I can't see why not. For weekly data, the problem is that 365 is not a multiple of 7. --

Re: [Gretl-users] extracting month number

2012-09-17 Thread Annaert Jan
analyticscorp.com>>, "gretl-users(a)lists.wfu.edu<mailto:gretl-users(a)lists.wfu.edu>" mailto:gretl-users(a)lists.wfu.edu>> Subject: Re: [Gretl-users] extracting month number On Sun, 16 Sep 2012, Data Analytics Corp. wrote: Hi, I have a monthly time series of the Dow J

Re: [Gretl-users] extracting month number

2012-09-16 Thread Jack
On Sun, 16 Sep 2012, Data Analytics Corp. wrote: > Hi, > > I have a monthly time series of the Dow Jones Industrial Index beginning > 1928:10. I'd like to create a new variable that is just the month > number: 10, 11, 12, 1, 2, 3, How can I do this? I thought there > would be a month funct

[Gretl-users] extracting month number

2012-09-16 Thread Data Analytics Corp .
Hi, I have a monthly time series of the Dow Jones Industrial Index beginning 1928:10. I'd like to create a new variable that is just the month number: 10, 11, 12, 1, 2, 3, How can I do this? I thought there would be a month function in Gretl, but I don't see one. This question, of cou