dear all,
i have a panel data:100 crossid and 30 dateid, then when estimate fixed effection model there will be many dum variables, it will be so crazy for if input every one by hand. is there any command or function i can use in eviews? i mean is there any easy way to create many dum variables, just like the function @trend().
and, i don't know how to use the "if condition", like:
" genr dum1=1 if str>=20 and dum1=0 if str<20"
is this available?
thanks a lot!
how to create dum variable if there are many obs?
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
tanghanpost
- Posts: 27
- Joined: Tue Dec 30, 2008 6:39 am
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: how to create dum variable if there are many obs?
There are three options that might help:dear all,
i have a panel data:100 crossid and 30 dateid, then when estimate fixed effection model there will be many dum variables, it will be so crazy for if input every one by hand. is there any command or function i can use in eviews? i mean is there any easy way to create many dum variables, just like the function @trend().
and, i don't know how to use the "if condition", like:
" genr dum1=1 if str>=20 and dum1=0 if str<20"
is this available?
thanks a lot!
(1) Use the fixed effect option for your estimate.
(2) Check out the @EXPAND function to see if it does what you want.
(3) Code your dummy variables with something like the following:
Code: Select all
smpl if str<20
series dum1=0
smpl if str>=20
dum1=1Re: how to create dum variable if there are many obs?
Alternatively, you can use @RECODE(3) Code your dummy variables with something like the following:Code: Select all
smpl if str<20 series dum1=0 smpl if str>=20 dum1=1
Code: Select all
series dum1 = @recode(str<20,0,1)
-
startz
- Non-normality and collinearity are NOT problems!
- Posts: 3796
- Joined: Wed Sep 17, 2008 2:25 pm
Re: how to create dum variable if there are many obs?
or in this particularly easy caseAlternatively, you can use @RECODE(3) Code your dummy variables with something like the following:Code: Select all
smpl if str<20 series dum1=0 smpl if str>=20 dum1=1
Code: Select all
series dum1 = @recode(str<20,0,1)
Code: Select all
series dum1 = str>=20
Who is online
Users browsing this forum: No registered users and 2 guests
