Page 1 of 2
generate trend for dummy
Posted: Wed Oct 01, 2014 12:57 pm
by ecofin
hi,
i have 30 obs quarterly data, i would like to generate series (trend) to take 1 for the first year, and 2 for the second year...etc.
i use the the command line:
smpl @all
series t=0
smpl 1 4
series t=1
smpl 5 8
series t=2
smpl 9 12
series t=3
..... etc
is there any way to do this by a simple command. see the documentation below
thanks in advance.
Re: generate trend for dummy
Posted: Wed Oct 01, 2014 1:15 pm
by EViews Gareth
series t = @year-@min(@year)+1
Re: generate trend for dummy
Posted: Wed Oct 01, 2014 1:49 pm
by ecofin
thanks for your reply and for your help :D
Re: generate trend for dummy
Posted: Wed Oct 08, 2014 1:59 pm
by ch2324
how can genr trend equal 1 for every 2 years for the month data, next equal 2 for the second two year and so on.
Re: generate trend for dummy
Posted: Wed Oct 08, 2014 2:55 pm
by EViews Gareth
I don't understand the question.
Re: generate trend for dummy
Posted: Thu Oct 09, 2014 1:14 am
by ch2324
genr trend for every two years
from 2001m01 2002m12 equal 1
from 2003m01 2004m12 equal 2
from 2005m01 2006m12 equal 3
.....and so on
2/ my second question about ''genr time=@trend+1'' function it generate series from 1 to the last number of obs (1 2 3 4......50).
how can reverse this to generate trend from the last obs to the number 1 ( 50 49 48 47.....1).
Re: generate trend for dummy
Posted: Thu Oct 09, 2014 9:29 am
by EViews Gareth
Code: Select all
series t = @round((@trend-11.5)/24)+1
Re: generate trend for dummy
Posted: Sat Oct 11, 2014 2:10 pm
by ch2324
thanks! a lot.
Re: generate trend for dummy
Posted: Sun Oct 12, 2014 12:56 am
by ch2324
i have problem to generate trend for week sales.
03-01-2001 = 1
10-01-2001 =2
17-01-2001 =3
24-01-2001 =4
31-01-2001=5
and
07-02-2001=1
14-02-2001=2
21-02-2001=3
28-02-2001=4
.... and so on
how can do this.
Re: generate trend for dummy
Posted: Sun Oct 12, 2014 9:32 am
by EViews Gareth
What frequency are your data?
Re: generate trend for dummy
Posted: Sun Oct 12, 2014 1:55 pm
by ch2324
weekly.
2/ and what is the general formula when the frequency change example ( fortnight, multi-years, ten-day, intraday,...)

.
Re: generate trend for dummy
Posted: Sun Oct 12, 2014 2:11 pm
by EViews Gareth
@trend+1
Re: generate trend for dummy
Posted: Sun Oct 12, 2014 2:21 pm
by ch2324
not this, generate trend from 1 to 5 for the first month and so on
03-01-2001 = 1
10-01-2001 =2
17-01-2001 =3
24-01-2001 =4
31-01-2001=5
and
07-02-2001=1
14-02-2001=2
21-02-2001=3
28-02-2001=4
.... and so on
2/ and what is the general formula when the frequency change example ( fortnight, multi-years, ten-day, intraday,...)

Re: generate trend for dummy
Posted: Sun Oct 12, 2014 2:42 pm
by EViews Gareth
I don't follow.
Re: generate trend for dummy
Posted: Thu Oct 16, 2014 8:22 am
by ch2324
generate trend:
1/ weekly frequency: from 03-01-2001 to 31-01-2001 (trend take 1....5), and from 07-02-2001 to 28-02-2001 (trend take 1 to 4) and so on.
2/ suppose that i have others data by different frequency (fortnight, intraday) how can make trend like this:
interday frequency: from 03-01-2001 08:00 to 03-01-2001 09:00 (trend take 1 to 3), from 04-01-2001 08:00 to 04-01-2001 09:00 (trend take 1 to 3) and so on.
interday frequency: from 03-01-2001 08:00 to 03-01-2001 09:00 (trend take 1), from 04-01-2001 08:00 to 03-01-2001 09:00 (trend take 2) and so on.
fortnight frequency: from 03-01-2001 to 31-01-2001 (trend take 1 to 3), from 14-02-2001 to 28-02-2001 (trend take 1 to 2) and son on.
fortnight frequency: from 03-01-2001 to 31-01-2001 (trend take 1), from 14-02-2001 to 28-02-2001 (trend take 2) and son on.