generate trend for dummy

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

ecofin
Posts: 182
Joined: Fri May 10, 2013 11:24 am

generate trend for dummy

Postby ecofin » Wed Oct 01, 2014 12:57 pm

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 :x
is there any way to do this by a simple command. see the documentation below

thanks in advance.
Attachments
[Russell_Davidson,_James_G._MacKinnon]_Econometric.pdf
(103.61 KiB) Downloaded 630 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Wed Oct 01, 2014 1:15 pm

series t = @year-@min(@year)+1

ecofin
Posts: 182
Joined: Fri May 10, 2013 11:24 am

Re: generate trend for dummy

Postby ecofin » Wed Oct 01, 2014 1:49 pm

thanks for your reply and for your help :D

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Wed Oct 08, 2014 1:59 pm

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Wed Oct 08, 2014 2:55 pm

I don't understand the question.

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Thu Oct 09, 2014 1:14 am

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).

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Thu Oct 09, 2014 9:29 am

Code: Select all

series t = @round((@trend-11.5)/24)+1

Code: Select all

series t2 = @max(@trend)-@trend

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Sat Oct 11, 2014 2:10 pm

thanks! a lot.

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Sun Oct 12, 2014 12:56 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Sun Oct 12, 2014 9:32 am

What frequency are your data?

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Sun Oct 12, 2014 1:55 pm

weekly.
2/ and what is the general formula when the frequency change example ( fortnight, multi-years, ten-day, intraday,...) :roll: .
Last edited by ch2324 on Sun Oct 12, 2014 2:13 pm, edited 1 time in total.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Sun Oct 12, 2014 2:11 pm

@trend+1

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Sun Oct 12, 2014 2:21 pm

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,...) :roll:

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: generate trend for dummy

Postby EViews Gareth » Sun Oct 12, 2014 2:42 pm

I don't follow.

ch2324
Posts: 133
Joined: Fri May 10, 2013 10:52 am

Re: generate trend for dummy

Postby ch2324 » Thu Oct 16, 2014 8:22 am

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.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests