Hi,
I'd be really grateful if someone could help me...
I need to create 7 age category dummies for my regression.
My age categories will be:
< 20 (which i will use as my reference group so dont need a dummy)
21-30
31-40
41-50
51-60
61-70
71-80
> 80
Im using eviews 7 and have tried the following to create my first category dummy:
series dum_1
smpl @ all
dum_1 = 0
smpl 21 30
dum_1 = 1
which didnt work :(
please can someone help?
thank you!
eviews 7: creating age category dummies
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: eviews 7: creating age category dummies
Do you currently have a variable that contains age information?
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: eviews 7: creating age category dummies
To expand on Gareth's comments, the smpl statements you employed were using the order of observations in the workfile to define the dummies not the ages.
Assuming that you have an age variable. If all you want to do is use the dummies in an equation, you can do this in two steps:
1. use the Proc/Generate by Classification series proc and the age variable with your specified limit values to create an index variable (0, 1, 2... ) with the age categories (series proc name classify).
2. use the @expand function on your newly created index variable to create dummies on the fly for use in the equation.
Check the documentation for Classification, from series for a discussion of the classification proc.
Assuming that you have an age variable. If all you want to do is use the dummies in an equation, you can do this in two steps:
1. use the Proc/Generate by Classification series proc and the age variable with your specified limit values to create an index variable (0, 1, 2... ) with the age categories (series proc name classify).
2. use the @expand function on your newly created index variable to create dummies on the fly for use in the equation.
Check the documentation for Classification, from series for a discussion of the classification proc.
-
totallyheart
- Posts: 3
- Joined: Thu Mar 24, 2011 6:20 am
Re: eviews 7: creating age category dummies
Hi
thanks for getting back to me so soon.
Im sorry to be a pain, but as im a beginner to eviews i didnt quite understand the steps to creating these dummies.
If you could go over it in layman terms it would be great! :) ...
thanks for getting back to me so soon.
Im sorry to be a pain, but as im a beginner to eviews i didnt quite understand the steps to creating these dummies.
If you could go over it in layman terms it would be great! :) ...
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: eviews 7: creating age category dummies
Do you currently have a variable that contains age information?
-
totallyheart
- Posts: 3
- Joined: Thu Mar 24, 2011 6:20 am
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3797
- Joined: Wed Sep 17, 2008 2:25 pm
Re: eviews 7: creating age category dummies
Try
Code: Select all
series dum_1
smpl @all
dum_1 = 0
smpl if age>=21 or age<=30
dum_1 = 1-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: eviews 7: creating age category dummies
I assume you mean "age < 21" for your first category.
The code
should create your age category variable AGECAT.
Then in your regression specification, you can do
which will create the dummies in the regression, dropping the first category.
The code
Code: Select all
age.classify(method=limits) 21 31 41 51 61 71 81 @ agecat
Then in your regression specification, you can do
Code: Select all
equation eq1.ls y c @expand(agecat, @dropfirst)Who is online
Users browsing this forum: No registered users and 2 guests
