Page 2 of 2

Re: generate trend for dummy

Posted: Wed Oct 29, 2014 7:47 am
by ch2324
can you hepl me Mr Gareth.

Re: generate trend for dummy

Posted: Wed Oct 29, 2014 9:11 am
by EViews Gareth
I still don't follow what you're trying to do.

Re: generate trend for dummy

Posted: Thu Oct 30, 2014 11:57 am
by ch2324
sorry! this is my workfile, i hope that you understand me what i mean. just i would to generate trend and dummy for different frequency.
it's very important for me Mr Gareth.

many thanks in advance.

Re: generate trend for dummy

Posted: Thu Oct 30, 2014 12:00 pm
by EViews Gareth
Still not clear.

Re: generate trend for dummy

Posted: Thu Oct 30, 2014 12:12 pm
by ch2324
see the picture

Re: generate trend for dummy

Posted: Thu Oct 30, 2014 12:13 pm
by ch2324
and this

Re: generate trend for dummy

Posted: Thu Oct 30, 2014 1:10 pm
by EViews Gareth
Showing pictures isn't asking a question...

But I think at least one of your columns is just the @month variable.

Re: generate trend for dummy

Posted: Fri Oct 31, 2014 7:11 am
by ch2324
question: generate trend and dummy for different frequency.
1-interday:
genr trend (t1): from 03/01/2000 08:00 to 03/01/2000 10:00 take 1
from 04/01/2000 08:00 to 04/01/2000 10:00 take 2. and so on

genr trend (2): from 03/01/2000 08:00 to 03/01/2000 10:00 take 1 2 3 4 5.
from 04/01/2000 08:00 to 04/01/2000 10:00 take 1 2 3 4 5. and son on

genr dum1: the first 03/01/2000 08:00 and the last 03/01/2000 10:00 take 1
the first 04/01/20000 08:00 and the last 04/01/2000 10:00 take 1. and so on

2-daily
genr trend (t3): the first month take 1, the second month take 2, the third month take 3...etc

genr trend (t4): the first month take 1 2 3...29, the second month take 1 2 3...29, the third month take 1 2 3...31,...and son on

3-weekday
genr trend (t5): the first month take 1 next month take 2 and so on

genr trend (t6): the first month take 1 2 3...5, the second month take 1...4, and son on.

4-tenday
genr trend (t7): the first month take 1 next month take 2 and so on

genr trend (t8): the first month take 1 2 3 next month take 1 2 3 and so on

genr dum2: the first tenday and the last take 1 for every month.

5-fortnight
genr trend (t9): the first month take 1 next month take 2 and so on

genr trend (t10): the first month take 1 2 3 next month take 1 2 and so on

genr dum3: the first and last fortnight take 1 for every months.

Re: generate trend for dummy

Posted: Fri Oct 31, 2014 8:10 am
by EViews Gareth
A few of these will have issues at the start of the workfile, but:


1-Interday:

Code: Select all

series dum1 = @datepart(@date, "ddd")-3 series dum2 = @recode(@day<>@day(-1), 1, dum2(-1)+1) series dum3 = @recode(@day<>@day(-1) or @day<>@day(1), 1, 0)
2-daily:

Code: Select all

series dum1=@month series dum2 = @day
3-weekday:

Code: Select all

series dum1= @month series dum2= @recode(@month<>@month(-1), 1, dum(-1)+1)

That should get you doing, anyway

Re: generate trend for dummy

Posted: Fri Oct 31, 2014 11:30 am
by ch2324
problem
1-inraday:
the code for dum1 generate trend for the first year, it not continue for the second year 2001 it repeat.

Code: Select all

series dum1 = @datepart(@date, "ddd")-3
2-daily:
same problem for the code dum1 (and same problem for fortnight & tenday)

Code: Select all

series dum1=@month
3-weekday:
A- same problem for the code dum1 (and same problem for fortnight & tenday)

Code: Select all

series dum1=@month
B- when i une the code for dum2 it chow error message '' dum is not defined "

Code: Select all

series dum2= @recode(@month<>@month(-1), 1, dum(-1)+1)
4- when i use the code for dum2 (tenday & fortnight) it not generate trend for example: frequency tenday
11/01/2000 take 11 it should equal 2.
21/01/2000 take 21 it should equal 3.

Code: Select all

series dum2 = @day

Re: generate trend for dummy

Posted: Tue Nov 04, 2014 10:28 am
by ch2324
can you help me Mr Gareth.

Re: generate trend for dummy

Posted: Tue Nov 04, 2014 10:58 am
by EViews Gareth

Code: Select all

series dum1=@cumsum(@recode(@datefloor(@date,"d")<>@datefloor(@date(-1) ,"d"),1,0))
That's pretty general, and will solve the intraday. For the monthly ones, change the "d" to an "m".

Re: generate trend for dummy

Posted: Tue Nov 04, 2014 11:31 am
by ch2324
thanks a lot,
this code for dummy chow error message

Code: Select all

series dum2= @recode(@month<>@month(-1), 1, dum(-1)+1)
what can i do. :oops:

Re: generate trend for dummy

Posted: Tue Nov 04, 2014 11:38 am
by EViews Gareth
series dum2= @recode(@month<>@month(-1), 1, dum2(-1)+1)

Re: generate trend for dummy

Posted: Tue Nov 04, 2014 12:11 pm
by ch2324
thanks for your help. :D