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
Dummy with multiple options
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Dummy with multiple options
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
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
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
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
Probably something like
series dummy = age = "15-24"
etc.
series dummy = age = "15-24"
etc.
Who is online
Users browsing this forum: No registered users and 2 guests
