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 Gareth, EViews Steve, EViews Moderator, EViews Jason

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

Deleting a large number of observations

Postby xuaxace » 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.

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

Re: Deleting a large number of observations

Postby EViews Gareth » 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.

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

Re: Deleting a large number of observations

Postby xuaxace » 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

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

Re: Deleting a large number of observations

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

You don't have a panel workfile.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests