Page 1 of 1
dummy variable for panel data
Posted: Tue Sep 18, 2012 8:20 am
by lamia.donia
hello,
I want to create a dummy variable for panel estimation. a dummy for the legal origin of the cross sections which are either french or english legal origin.
1- what are the steps to create dummy variable?
2- should I use one dummy variable or two for each category?
3- in case of one or two dummies; the coding of the dummy variable 1 and 0 or 1 for french and 2 for english for example?
Re: dummy variable for panel data
Posted: Tue Sep 18, 2012 11:29 am
by EViews Esther
Code: Select all
smpl @all
series dum=0
smpl if legal="French"
dum=1
smpl if legal="English"
dum=2
smpl @all
Re: dummy variable for panel data
Posted: Tue Sep 18, 2012 11:42 am
by startz
Code: Select all
smpl @all
series dum=0
smpl if legal="French"
dum=1
smpl if legal="English"
dum=2
smpl @all
Uh no. This is correct EViews code, but it's not a dummy variable. A dummy variable must be coded 0/1. You probably need two of them.
Re: dummy variable for panel data
Posted: Tue Sep 18, 2012 1:55 pm
by EViews Esther
Yes, I just give an example to make a dummy with (0), 1, or 2 depending on the legal origin condition.
As an example,
Code: Select all
series dum = 0
smpl if legal = "English"
dum = 1 will produce a dummy with 1 if legal = English, 0 otherwise.
Re: dummy variable for panel data
Posted: Tue Sep 18, 2012 2:15 pm
by lamia.donia
thank you,
i created two dummies one for french and one for english but i get an error message: near singular matrix??
Re: dummy variable for panel data
Posted: Tue Sep 18, 2012 2:18 pm
by startz
Google "dummy variable trap."
Re: dummy variable for panel data
Posted: Thu Jul 09, 2015 4:12 am
by econworker
Dear Startz
I have a question regarding the dummy variable in panel data.
I have a panel data which I want to estimate with PMG estimation. The friequency is weekly, however I included annual dummies, something like : my data is 1998 to 2014, so its 17 years weekly data and I created 17 dummy variables that takes value of one for each year and for all the cross sections. But the strange issue is that when I include the Whole annual dummy variables (17 ìannual dummies) it doesnt make any multicolinearity with constant, however when I do the same estimation with stata it drops the dummy of 1998, would you tell what is the reason for that result in Eviews?
Thank you
Re: dummy variable for panel data
Posted: Thu Jul 09, 2015 6:08 am
by startz
No idea. You might post your EViews workfile including the equation you are estimating.