Exclude outliers from series

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

Student24
Posts: 3
Joined: Fri Feb 22, 2013 11:37 am

Exclude outliers from series

Postby Student24 » Fri Feb 22, 2013 11:44 am

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!

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

Re: Exclude outliers from series

Postby EViews Glenn » Fri Feb 22, 2013 5:25 pm

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)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests