Page 3 of 10
Re: Dummy Variables
Posted: Fri Jan 03, 2014 1:44 pm
by ecofin
the problem is geralized the dummy for all series for daily date no-dated and quarterly

.
daily:
series dum1= @recode((@date<=@dateval("31/01/1990")) or (@date>=@dateval("01/03/1990") and @date<=@dateval("31/03/1990")) or (...etc,1,0)
No-dated:
series dum2=@recode((@obsnum<=2) or (@obsnum>=5 and @obsnum<=6) or (...etc,1,0).
quarterly:
series dum3=@recode((@date<=@dateval("1990q04")) or (@date>=@dateval("1992q01") and @date<=@dateval("1992q04")) or (...etc,1,0)
it's long to write for all date, Have you an idea.
best regards.
Re: Dummy Variables
Posted: Fri Jan 03, 2014 5:27 pm
by EViews Gareth
How many dates do you have? What's wrong with what you just wrote?
Re: Dummy Variables
Posted: Sat Jan 04, 2014 1:42 am
by ecofin
I have 400 obs, the problem it takes a lot of time to create dummy for large observations like my example with the function, if I have for example 1000 obs or 5000 obs

what shall I do.
my example for NO-dated obs is: create dummy equal 1 for "1 2" obs next "5 6" obs next "9 10" obs next....etc, dummy equal 0 for "3 4" obs next "7 8" obs next "11 12" obs...etc, for all 400 obs.
my idea just to create regular dummy equal 1 for obs for example: 6 obs take 1 next 6 obs take 0 next 6 obs take 1...etc, you understand me.
best regards.
Re: Dummy Variables
Posted: Mon Jan 06, 2014 7:31 am
by ecofin
is there any way to reduce the function for dummy in my example because it's very long.
Re: Dummy Variables
Posted: Mon Jan 06, 2014 8:09 am
by EViews Glenn
I'm not certain that I understand all of the details of your computation, but there is a classify proc that should do what you want. It's described in detail in the manual. On a series, click on Proc/Classify (I'm not sure of the exact proc name and I'm away from the docs right now, but you should be able to find it).
Re: Dummy Variables
Posted: Mon Jan 06, 2014 10:23 am
by ecofin
ok I explain, just I would like to create dummy variable for my series No-dated, quarterly or monthly, daily data like this 11 00 11 00 11 00...etc or for quaterly data 1111 0000 1111 0000...etc, for monthly 12 obs take 1 and next 12 obs take 0...etc.
but the problem is very long to write it by the function like this for No-dated: series dum2=@recode((@obsnum<=2) or (@obsnum>=5 and @obsnum<=6) or (...etc,1,0), I can write it by the function for all my 400 obs, but it takes long time.
you understood me.
Re: Dummy Variables
Posted: Mon Jan 06, 2014 12:08 pm
by EViews Glenn
I think I understand, my earlier response does apply.
Proc/Generate by Classification. Method: Limit Values. Choose the appropriate bin interval definition. Encoding: Index (0, 1, 2...)
Then use the new variable with @expand.
Re: Dummy Variables
Posted: Mon Jan 06, 2014 12:45 pm
by ecofin
this my work file, I would like to create dummy for quarterly data like this 1111 0000 1111 0000 ...etc, my series 'x', how to use @expand.
Re: Dummy Variables
Posted: Tue Jan 07, 2014 1:42 am
by ecofin
would you like to help me, how tu use @expand for the quarterly data or No-dated...etc, just create dummy like this 1111 0000 1111 0000...etc
kind regards.
Re: Dummy Variables
Posted: Tue Jan 07, 2014 8:48 am
by EViews Gareth
So you just want a dummy variable that has four 1s, followed by four 0s, followed by four 1s, followed by four 0s and so on?
Re: Dummy Variables
Posted: Tue Jan 07, 2014 10:02 am
by ecofin
thanks a lot Gareth and Glenn for your help and your reply :D .
Re: Dummy Variables
Posted: Wed Jan 08, 2014 1:20 pm
by jodai
I have dated (yearly) panel data and want to create a dummy variable that takes 1 exclusively for the three years previous to a specific change in the data and 0 otherwise. Specifically, I have a variable that changes over time and I want the dummy variable to take 1 in the three years previous to it getting bigger than 0.2. Any help is very much appreciated. Thank you in advance.
Re: Dummy Variables
Posted: Wed Jan 08, 2014 2:39 pm
by jodai
I did it in excel now, but I'd still be curious how it would work in eviews :)
Re: Dummy Variables
Posted: Wed Jan 08, 2014 2:43 pm
by startz
Code: Select all
series dummy = x(1)>.2 or x(2)>.2 or x(3)>.2
Re: Dummy Variables
Posted: Thu Jan 16, 2014 5:53 am
by ariana
hi
i have a question regarding to use year dummy variables in fixed effect model
when i add my dummy variable and i want to run a model it says singular matrix but without it i can use fixed effect
one more question is about using distance variable,you know that distance is not changing by time so it relates to cross section just ,but again when i want to run fixed effect it is not working,when i remove distance then it will be ok
i want to know what is the problem
thanks alot