delete/filtering Panel Data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

debagus95
Posts: 8
Joined: Tue Mar 05, 2019 5:26 am

delete/filtering Panel Data

Postby debagus95 » Wed Mar 06, 2019 7:45 am

i have a panel data of 1,352 companies from 5 countries(2003-2017). yet, there is a lots of variables missing.
i want to delete companies which has no observation for 5 consecutive years.
could eviews do that?
I'm really waiting for your help
thanks in advance

I also attach my data
Attachments
all data.xlsx
(5.83 MiB) Downloaded 26 times

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

Re: delete/filtering Panel Data

Postby EViews Gareth » Wed Mar 06, 2019 8:43 am

Something like:

Code: Select all

pagecontract if @obsby(y, @crossid) > 0


Where Y is the name of the series.
Follow us on Twitter @IHSEViews

debagus95
Posts: 8
Joined: Tue Mar 05, 2019 5:26 am

Re: delete/filtering Panel Data

Postby debagus95 » Wed Mar 06, 2019 9:17 am

pardon me
could u please explain it more?
thanks

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

Re: delete/filtering Panel Data

Postby EViews Gareth » Wed Mar 06, 2019 9:21 am

Once you have the data in EViews, you can use the pagecontract command to remove observations.
Follow us on Twitter @IHSEViews

debagus95
Posts: 8
Joined: Tue Mar 05, 2019 5:26 am

Re: delete/filtering Panel Data

Postby debagus95 » Wed Mar 06, 2019 10:26 am

it should be easy but i dont it well
for instance i wanna remove "b" and "d" because it has no observation for 3 consecutive years. what should pagecontract command be?
Name Year gdp inflation export
a 2003 12 8 14
a 2004 13 7 17
a 2005 14 6 19
a 2006 15 9 20
b 2003 na 8 13
b 2004 na 7 15
b 2005 na 6 12
b 2006 12 5 10
c 2003 21 8 15
c 2004 23 7 14
c 2005 25 9 18
c 2006 27 6 14
d 2003 21 8 na
d 2004 23 7 na
d 2005 25 9 na
d 2006 27 6 14

thank you

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

Re: delete/filtering Panel Data

Postby EViews Gareth » Wed Mar 06, 2019 10:59 am

Put those three series into a group, called G.

Then:

Code: Select all

pagecontract if @sumsby(@rnas(g), @crossid)=0
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 3 guests