Deleting a large number of observations

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

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

Deleting a large number of observations

Postby xuaxace on Tue May 08, 2012 4:44 am

Hey everyone, I am a complete newbie when it comes to Eviews or econometrics for that matter, but I have an assignment which has me using program.

The work that I have to do is, download observations for USA public companies from 1971 to 2010, with a number of accounting variables. Overall I get 300k observations.

What I need to do is to narrow down the sample to only the companies that have been public for those whole time period (40 years) and delete all the other companies that either went public after or died before the 2010.

How exactly can this be done? I have spent the last few days trying to figure it out in veil.

Thanks in advance.
xuaxace
 
Posts: 2
Joined: Tue May 08, 2012 4:37 am

Re: Deleting a large number of observations

Postby EViews Gareth on Tue May 08, 2012 6:23 am

Assuming you have a panel workfile, a quick way would be to set the sample to only those cross-sections that have 40 observations for a given series. Something like:
Code: Select all
smpl if @obsby(y, @crossid) = 40

where Y is the name of the series in question.
Follow us on Twitter @IHSEViews
EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
 
Posts: 5758
Joined: Tue Sep 16, 2008 5:38 pm

Re: Deleting a large number of observations

Postby xuaxace on Tue May 08, 2012 11:53 am

Hey Gareth, thanks for the reply.

I tried tinkering with it for a while, but I was getting this error, is it because GVKEY is alphanumerical and only works if number series?

I tried to change the GVKEY to numerical, without much success.

[Image
xuaxace
 
Posts: 2
Joined: Tue May 08, 2012 4:37 am

Re: Deleting a large number of observations

Postby EViews Gareth on Tue May 08, 2012 1:24 pm

You don't have a panel workfile.
Follow us on Twitter @IHSEViews
EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
 
Posts: 5758
Joined: Tue Sep 16, 2008 5:38 pm


Return to Data Manipulation

Who is online

Users browsing this forum: No registered users and 1 guest