Creating dummy variables 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

blanche812
Posts: 2
Joined: Wed Sep 05, 2012 11:28 pm

Creating dummy variables for panel data

Postby blanche812 » Thu Sep 06, 2012 12:04 am

Dear all,

I am working on my dissertation and have problems on creating dummy variables in fixed effects model. My dependent variable is net income inequality (nii) and 3 explanatory variables: GDP(lggdp), GDP squared(lggdp2) and degree of openess(openess). The balanced panel data covers 13 countires in the period of 1979-2009. How can I generate a dummy variable which takes the value 1 if a fiscal consolidation is undertaken in the UK in year 1979,1980,1981,1982 and 1994-1999 and is undertaken in Sweden in year 1984,1993-1998, takes the value 0 otherwise ? or do I have to create two dummy variables seperatley for 2 countries?

I attached my workfile below. Hope my questions make sense and someone could help.

Many thanks :)
workfile1.wf1
(36.11 KiB) Downloaded 360 times

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

Re: Creating dummy variables for panel data

Postby EViews Gareth » Thu Sep 06, 2012 7:51 am

Code: Select all

smpl @all series dum=0 smpl 1979 1982 1994 1999 if country="GBR" dum=1 smpl 1984 1984 1993 1998 if country="SWE" dum=1 smpl @all

blanche812
Posts: 2
Joined: Wed Sep 05, 2012 11:28 pm

Re: Creating dummy variables for panel data

Postby blanche812 » Thu Sep 06, 2012 12:05 pm

Thanks a lot for your reply.
I tried to include more countries and years one by one in the dummy vaiable. But when I entered the last line, it returned an " Error in sample: illegal date IF" message. What does it mean and how can I continue to enter more lines?

smpl @all
series dum=0
smpl 1979 1982 1994 1995 1996 1997 1998 1999 if country="GBR"
dum=1
smpl 1984 1984 1993 1994 1995 1996 1997 1998 if country="SWE"
dum=1
smpl 1983 1984 1989 1990 1992 1993 1994 1995 1996 1997 if country="ESP"
dum=1
smpl 1992 1993 1994 1995 1996 1997 if country="FIN"
dum=1
smpl 1983 1984 1985 1986 1995 if country="DNK"

Any help would be greatly appreciated :) .

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

Re: Creating dummy variables for panel data

Postby EViews Gareth » Thu Sep 06, 2012 12:30 pm

Years need to be entered in pairs. You cannot have an odd number of years.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests