Dummy with multiple options

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

celeste.uantwerpen
Posts: 3
Joined: Fri Jul 25, 2014 10:48 am

Dummy with multiple options

Postby celeste.uantwerpen » Fri Jul 25, 2014 10:52 am

Hi! I need to create a dummy variable for several group ages. I have the following set (of ages)
15-24
25-35
35-44
45-54
55-64
>65
I would like to make them "1" if they are in the age category 15-24 OR 25-35 OR 35-44, and 0 if not. How can I do that?
Thank you so much!

Celeste

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Dummy with multiple options

Postby startz » Fri Jul 25, 2014 12:03 pm

Hi! I need to create a dummy variable for several group ages. I have the following set (of ages)
15-24
25-35
35-44
45-54
55-64
>65
I would like to make them "1" if they are in the age category 15-24 OR 25-35 OR 35-44, and 0 if not. How can I do that?
Thank you so much!

Celeste

Code: Select all

series dummy = age<=44
or

Code: Select all

series dummy = (age>=15 and age<=24) or(age>=25 and age<=44) or (age>=35 and age<=34)

celeste.uantwerpen
Posts: 3
Joined: Fri Jul 25, 2014 10:48 am

Re: Dummy with multiple options

Postby celeste.uantwerpen » Fri Jul 25, 2014 12:42 pm

Hi! Thank you for your answer. However I get this message:"Numeric Operator applied to string data".
Any ideas on what I should do?

Thanks again!

Celeste

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Dummy with multiple options

Postby startz » Fri Jul 25, 2014 12:44 pm

Probably something like

series dummy = age = "15-24"

etc.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests