Sample depending on number of NAs and zeros

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

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

stefanp
Posts: 63
Joined: Wed Sep 30, 2015 12:24 am

Sample depending on number of NAs and zeros

Postby stefanp » Wed Dec 05, 2018 2:31 am

I would like to set the sample if the number of NAs and zeros does not exceed a certain number. Is that possible simply using the smpl command instead of a combination of commands?

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

Re: Sample depending on number of NAs and zeros

Postby EViews Gareth » Wed Dec 05, 2018 8:35 am

If all the numbers are positive:

Code: Select all

smpl if @sum(x>0)>mynumber


Change the x>0 bit to handle negatives.
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 10 guests