Page 1 of 1
delete/filtering Panel Data
Posted: Wed Mar 06, 2019 7:45 am
by debagus95
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
Re: delete/filtering Panel Data
Posted: Wed Mar 06, 2019 8:43 am
by EViews Gareth
Something like:
Code: Select all
pagecontract if @obsby(y, @crossid) > 0
Where Y is the name of the series.
Re: delete/filtering Panel Data
Posted: Wed Mar 06, 2019 9:17 am
by debagus95
pardon me
could u please explain it more?
thanks
Re: delete/filtering Panel Data
Posted: Wed Mar 06, 2019 9:21 am
by EViews Gareth
Once you have the data in EViews, you can use the pagecontract command to remove observations.
Re: delete/filtering Panel Data
Posted: Wed Mar 06, 2019 10:26 am
by debagus95
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
Re: delete/filtering Panel Data
Posted: Wed Mar 06, 2019 10:59 am
by EViews Gareth
Put those three series into a group, called G.
Then:
Code: Select all
pagecontract if @sumsby(@rnas(g), @crossid)=0