dummy variable for panel data

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

lamia.donia
Posts: 6
Joined: Fri Sep 07, 2012 3:07 pm

dummy variable for panel data

Postby lamia.donia » Tue Sep 18, 2012 8:20 am

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?

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: dummy variable for panel data

Postby EViews Esther » Tue Sep 18, 2012 11:29 am

Code: Select all

smpl @all series dum=0 smpl if legal="French" dum=1 smpl if legal="English" dum=2 smpl @all

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: dummy variable for panel data

Postby startz » Tue Sep 18, 2012 11:42 am

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.

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: dummy variable for panel data

Postby EViews Esther » Tue Sep 18, 2012 1:55 pm

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.
Last edited by EViews Esther on Tue Sep 18, 2012 2:18 pm, edited 1 time in total.

lamia.donia
Posts: 6
Joined: Fri Sep 07, 2012 3:07 pm

Re: dummy variable for panel data

Postby lamia.donia » Tue Sep 18, 2012 2:15 pm

thank you,

i created two dummies one for french and one for english but i get an error message: near singular matrix??

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: dummy variable for panel data

Postby startz » Tue Sep 18, 2012 2:18 pm

Google "dummy variable trap."

econworker
Posts: 39
Joined: Thu Apr 24, 2014 3:51 am

Re: dummy variable for panel data

Postby econworker » Thu Jul 09, 2015 4:12 am

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

startz
Non-normality and collinearity are NOT problems!
Posts: 3796
Joined: Wed Sep 17, 2008 2:25 pm

Re: dummy variable for panel data

Postby startz » Thu Jul 09, 2015 6:08 am

No idea. You might post your EViews workfile including the equation you are estimating.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests