Dummy Variables

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

Jingga
Posts: 7
Joined: Thu Jan 29, 2015 5:08 am

Re: Dummy Variables

Postby Jingga » Fri Jan 30, 2015 9:21 am

EViews Gareth wrote:We'd need to see the workfile.


Alright thanks for the replies. I'll try some other things first (create the dummies in Excel for example), since the workfile is 360mb! I'll come back to you if it still happens.

Jingga
Posts: 7
Joined: Thu Jan 29, 2015 5:08 am

Re: Dummy Variables

Postby Jingga » Tue Feb 03, 2015 5:07 am

Hi Gareth,

Since the computers I work with cannot really handle the amount of data to produce 192 dummies, I was wondering, is there a shortcut to construct these in EViews? Last time I manually used @recode 192 times, a bit time consuming you can imagine...

Thanks


edit: I figured out this could be done with @expand(reporting)/@expand(partner). Much quicker, and no room for errors. But still I have the same problem as before. I can send my workfile via wetransfer.com, is that okay?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Tue Feb 10, 2015 2:38 pm

Received your file.

Looking at the correlation matrix for a bunch of dummy variables isn't particularly interesting. Any dummy variable that has the same number of "1"s as another dummy will have the same correlation values.

I'm maintaining my gut feeling that you're simply in the dummy variable trap.
Follow us on Twitter @IHSEViews

Jingga
Posts: 7
Joined: Thu Jan 29, 2015 5:08 am

Re: Dummy Variables

Postby Jingga » Wed Feb 11, 2015 3:46 am

alright, I checked the 'g1' and 'g2' groups containing all the countries as a dummy. I removed USA from both and updated the group, to avoid the dummy trap. I then tried to estimate my default equation, but with 'g1' and 'g2';

logtrade c bothin onein gsp logdist logprodgdp logprodgdppc fta comcur comlang_ethno contig landl logprodarea comcol curcol colony g1 g2

Still get the error... (landlockedness is no country specific variable, since it is defined as the number of landlocked countries within an observation, so 0/1/2. Most other variables are country-pair specific). Or is there an aspect of the dummy trap I don't get?
Last edited by Jingga on Tue Feb 17, 2015 4:53 am, edited 1 time in total.

newtoeviews
Posts: 7
Joined: Fri Jan 23, 2015 8:51 am

Re: Dummy Variables

Postby newtoeviews » Thu Feb 12, 2015 9:48 am

Hi all,

As your directed, I have ran a command for filting year from 2006 to 2009 (for sure it is 4 years only) with smpl @first 2006 @last 2009. It turns out the result that

Sample (adjusted): 2000 2006 2010 2013
Periods included: 7

I am not quite sure about it. Could you explain me why it shows that periods included 7 here. I am rather certain about the command since I ran it with years 2000-2005, it gives me the correct periods.

Thanks, HM

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

Re: Dummy Variables

Postby startz » Thu Feb 12, 2015 9:58 am

newtoeviews wrote:Hi all,

As your directed, I have ran a command for filting year from 2006 to 2009 (for sure it is 4 years only) with smpl @first 2006 @last 2009. It turns out the result that

Sample (adjusted): 2000 2006 2010 2013
Periods included: 7

I am not quite sure about it. Could you explain me why it shows that periods included 7 here. I am rather certain about the command since I ran it with years 2000-2005, it gives me the correct periods.

Thanks, HM

If you want 2006 through 2009 the right smpl command is

Code: Select all

smpl 2006 2009

Jingga
Posts: 7
Joined: Thu Jan 29, 2015 5:08 am

Re: Dummy Variables

Postby Jingga » Wed Feb 25, 2015 4:57 am

Jingga wrote:alright, I checked the 'g1' and 'g2' groups containing all the countries as a dummy. I removed USA from both and updated the group, to avoid the dummy trap. I then tried to estimate my default equation, but with 'g1' and 'g2';

logtrade c bothin onein gsp logdist logprodgdp logprodgdppc fta comcur comlang_ethno contig landl logprodarea comcol curcol colony g1 g2

Still get the error... (landlockedness is no country specific variable, since it is defined as the number of landlocked countries within an observation, so 0/1/2. Most other variables are country-pair specific). Or is there an aspect of the dummy trap I don't get?


Can you help me out Gareth?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Wed Feb 25, 2015 10:01 am

I'm not sure what help I can be. You have a singular matrix.
Follow us on Twitter @IHSEViews

Jingga
Posts: 7
Joined: Thu Jan 29, 2015 5:08 am

Re: Dummy Variables

Postby Jingga » Thu Feb 26, 2015 3:18 am

But how? You've seen my workfile, I did everything to my knowledge to avoid the dummy trap. Does it just happen sometimes?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Thu Feb 26, 2015 6:01 am

Variables can be colinear for any number of reasons
Follow us on Twitter @IHSEViews

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

Re: Dummy Variables

Postby startz » Thu Feb 26, 2015 7:23 am

Jingga wrote:But how? You've seen my workfile, I did everything to my knowledge to avoid the dummy trap. Does it just happen sometimes?

Take the RHS variables that are perfectly collinear and regress one on all the rest. If you get a perfect fit, the coefficients may give you a clue as to what's going on. If you don't get a perfect fit, switch a different variable onto the left of this test regression.

With luck, this will eventually tell you which set of variables is causing the perfect multicollinearity.

joshchipunza
Posts: 10
Joined: Wed Mar 04, 2015 2:21 pm

Re: Dummy Variables

Postby joshchipunza » Wed Mar 25, 2015 11:06 am

Hi Gareth

I am running a model like this:

〖LIQ〗_(i,t) = α+D_1 〖List〗_(i,t)+〖β_1 Disclosure〗_t+β_2 〖Size〗_(i,t)+ 〖B_3 Leverage〗_(i,t)+ ε_(i,t)
where D_1 〖List〗is a dummy variable that take the value of 1 when a firm is cross listed and zero when it is cross traded.
The question is that when i run the regression in Eviews it give a feedback that its a Near Singular Matrix. I understand that it could be an issue of correlation in the variables but i just do not know how to go about it since this is how the model should be like. Your assistance will be greatly appreciated

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

Re: Dummy Variables

Postby startz » Wed Mar 25, 2015 11:37 am

You might want to post your EViews workfile, including the equation you wish to estimate.

amal
Posts: 2
Joined: Sat Jun 13, 2015 7:40 am

Re: Dummy Variables

Postby amal » Sat Jun 13, 2015 8:06 am

Hi,

I have a problem with corss-sectional fixed effect estimation for panel data. My database consists in datas from 357 companies from 7 different countries, over 4 years. I am trying to do a fixed effect estimation including dummy variables for the country. So I have for the companies from a certain country the value 1, and 0 for the rest. While trying to estimate this model it gives me the "Near singular matrix" error. How can I correct this error?

Also, i have the same problem by using a variable that has another values that describes each country, not necessarily a dummy variable.

Can you please help me to figure out how to correct this error?

Thank you!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dummy Variables

Postby EViews Gareth » Sun Jun 14, 2015 4:47 am

You've probably fallen into the dummy variable trap, and the only way to fix it is to remove variables.
Follow us on Twitter @IHSEViews


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 24 guests