Remove firms in panel data

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

asdf
Posts: 3
Joined: Mon Feb 10, 2014 6:43 am

Remove firms in panel data

Postby asdf » Mon Feb 10, 2014 6:48 am

I have a panel data with annual data against some firm identifier. For some yearly observations of the firm I am missing a variable and I would like to set a sample without those firms. How can i accomplish this?

Say data is year, firmid, CEOwage and I wan't to remove the firmed's where it has an observation where CEOwage is missing.

Thanks a lot :)

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

Re: Remove firms in panel data

Postby EViews Gareth » Mon Feb 10, 2014 9:07 am

Code: Select all

smpl if ceowage<>na

asdf
Posts: 3
Joined: Mon Feb 10, 2014 6:43 am

Re: Remove firms in panel data

Postby asdf » Mon Feb 10, 2014 9:22 am

Will that not only remove the years with missing CEOwage? and leave the observation of the firm where i have it? I'm looking to remove the exclude the entire history of the firm if at least one observation is missing.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Remove firms in panel data

Postby EViews Glenn » Mon Feb 10, 2014 9:31 am

Code: Select all

smpl if @nasby(ceowage, firmid)=0
where FIRMID is the identifier for your firm. The @nasby counts the number of NAs in CEOWAGE in each of the FIRMIDs and match-merges it back to the firm. So for a firm which has a CEOWAGE NA, all of it's observations will have the common non-zero count of NAs.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests