I really new to Eviews and im a bit stuck.
I need to create dummy variables for various different variables.
I have data for gender e.g 1= male and 2= female
However i would like it to read -
female = 1 if female, 0 if otherwise
male = 1 if male, 0 if otherwise
If someone could point me in the right direction it would be great.
Dummy Variables
Moderators: EViews Gareth, EViews Moderator
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3798
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Dummy Variables
smpl @all
series female = 0
smpl if gender=2
female = 1
smpl @all
series female = 0
smpl if gender=2
female = 1
smpl @all
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Dummy Variables
Or you could use @recode
Code: Select all
series male = @recode(gender=1, 1, 0)
series female = @recode(gender=2, 1, 0)-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Dummy Variables
Or, just simply:
Code: Select all
series male = gender=1
series female = gender=2
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Dummy Variables
Oh yeah. That's even better :)
-
lost_student
- Posts: 2
- Joined: Wed Jul 06, 2011 3:42 am
Re: Dummy Variables
Thanks for the help, could someone tell me how to run the code please! (yes i'm really that bad at this)
EDIT: never mind i figures it out.
EDIT: never mind i figures it out.
Who is online
Users browsing this forum: No registered users and 2 guests
