Page 1 of 1

Exclude outliers from series

Posted: Fri Feb 22, 2013 11:44 am
by Student24
Hi

I'm looking for a syntax to create a new series which excludes all values outside of 3 standard deviations from the mean of an existent series.
It would also be nice to have such a syntax which creates a series that excludes 5% of values (percentiles) from both ends of the current series distribution.

Thanks for any advice!

Re: Exclude outliers from series

Posted: Fri Feb 22, 2013 5:25 pm
by EViews Glenn
series new_y = @recode(@abs(y-@mean(y))>(3*@stdev(y)), NA, y)
series alt_y = @recode((y>@quantile(y, .95))+(y<@quantile(y, .05)), NA, y)