Contract panel workfile

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

JhonnyCa
Posts: 6
Joined: Tue Feb 17, 2015 11:32 am

Contract panel workfile

Postby JhonnyCa » Mon Mar 30, 2015 11:23 am

Hi,
I'm using eviews8. I have a dated panel workfile with >500 cross sections (stocks) and 7 variables/series. I want to drop those stocks (that is the entire cross-sections) for which any of the 7 variables doesn't have at least one observation. So if for a specific stock there are all variables available except one - let's say the variable "dividend", that has only NA's - I want to completely remove this stock/cross section from the workfile. I couldn't figure out how to program this task. Thank you in advance for your help!

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

Re: Contract panel workfile

Postby EViews Gareth » Mon Mar 30, 2015 11:42 am

Code: Select all

pagecontract if (@obsby(x1, @crossid)>0 and @obsby(x2,@crossid)>0 and @obsby(x3, @crossid>0) and @obsby(x4, @crossid>0) and @obsby(x5, @crossid>0) and @obsby(x6, @crossid>0) and @obsby(x7, @crossid>0))
I can't tell from your post whether you want those "ands" to be "ands" or "ors", but try it with both :D

JhonnyCa
Posts: 6
Joined: Tue Feb 17, 2015 11:32 am

Re: Contract panel workfile

Postby JhonnyCa » Mon Mar 30, 2015 12:14 pm

Thank you very much, it works out smoothly!


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests