Page 1 of 1

Sample depending on number of NAs and zeros

Posted: Wed Dec 05, 2018 2:31 am
by stefanp
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?

Re: Sample depending on number of NAs and zeros

Posted: Wed Dec 05, 2018 8:35 am
by EViews Gareth
If all the numbers are positive:

Code: Select all

smpl if @sum(x>0)>mynumber


Change the x>0 bit to handle negatives.