Deleting a cross section from a panel

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Pilot013
Posts: 3
Joined: Sun Mar 25, 2012 4:58 am

Deleting a cross section from a panel

Postby Pilot013 » Sun Mar 25, 2012 5:04 am

Hello!

I am currently writing my bachelor thesis and my topic is related to the link between economic growth and public debt. I have a panel of 17 countries, followed on several variables from 1980-2012. My cross sections are the countries as you perhaps think. I want to delete 2-3 countries from the list, because I have a lot of missing data for them in the period 1980-1990 and they bias the results afterwards. In this sense, I would like to perform 2 estimations:

1) For all the countries from 1990-2010 with Fixed effects and
2) Only for the countries I have data from 1980-2010 again with Fixed effects.

Unfortunately, I couldn't figure out how to delete cross sections from E-views.

Thanks in advance for your advice!

Kind regards from Denmark! :)

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

Re: Deleting a cross section from a panel

Postby EViews Gareth » Sun Mar 25, 2012 9:06 am

Do you want to actually delete them, or just not include them in the estimation?

If the former, simply put something like this as your sample:

Code: Select all

1980 2010 if @crossid<>15 and @crossid<>7
Where 15 and 7 are the cross-sections you don't want.

Pilot013
Posts: 3
Joined: Sun Mar 25, 2012 4:58 am

Re: Deleting a cross section from a panel

Postby Pilot013 » Sun Mar 25, 2012 1:05 pm

Hi Gareth!

Thanks a lot for your answer - this did the trick! :-) I have some other questions as well, since I am at the final stage of my thesis so I am just trying to estimate the model correctly and test for endogeneity, serial correlation, causality and goodness-of-fit. I will post those questions in another topic. I have been studying in the university of Aarhus. During our Econometrics course we studied only cross-sectional data estimation and analysis. I got a big confused with some of the interpretations of the Beta coefficients. As I am dealing with a lot of ratios (Debt/GDP, Investments/GPD, Current Account balance/GDP, etc..), I get a confused how to interpret the results if my explained variable is in a ratio form and the explanatory set of variables as well.

Thanks once again for now and these days, I will post my other questions in a structured form.

Kind regards! :)

yzerman
Posts: 6
Joined: Fri Jun 21, 2013 7:54 am

Re: Deleting a cross section from a panel

Postby yzerman » Fri Jun 21, 2013 12:44 pm

Do you want to actually delete them, or just not include them in the estimation?

If the former, simply put something like this as your sample:

Code: Select all

1980 2010 if @crossid<>15 and @crossid<>7
Where 15 and 7 are the cross-sections you don't want.
Gareth,

What if I actually wanted to delete some cross-sections to reduce the size of my file?

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

Re: Deleting a cross section from a panel

Postby EViews Gareth » Fri Jun 21, 2013 3:00 pm

Use the pagecontract command.

Tuinsmurf
Posts: 11
Joined: Thu Mar 31, 2016 5:44 am

Re: Deleting a cross section from a panel

Postby Tuinsmurf » Fri Aug 12, 2016 3:21 am

Hi there,

I am using panel data for the period 1984-2008 with 8 countries.

I'd like to alter my sample for the same period to exclude the following cross sections: Iran, Israel, Malta and New Zealand

How would I go about this in terms of code?

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

Re: Deleting a cross section from a panel

Postby EViews Gareth » Fri Aug 12, 2016 8:06 am

Code: Select all

smpl 1984 2008 if country<>"Iran" and country<>"Israel"....

Tuinsmurf
Posts: 11
Joined: Thu Mar 31, 2016 5:44 am

Re: Deleting a cross section from a panel

Postby Tuinsmurf » Tue Aug 16, 2016 4:26 am

Thank you Gareth!!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests