Removing outliers: Winsorization

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

andre_6043
Posts: 3
Joined: Mon Sep 14, 2009 2:15 am

Removing outliers: Winsorization

Postby andre_6043 » Mon Sep 14, 2009 2:26 am

Dear all,

I kindly ask you about Help concerning Winsorization in Eviews6.

I have quite a big panel data set with a lot of outliers. To improve the quality of the regression I would like
to remove the outliers by doing a winsorization at the 0.5% level.

Is this possible in Eviews? What is the Eviews command and how do I proceed to do the winsorization?
If this is not possible in Eviews - what are the common ways to exclude outliers and how can I do it?

Thanks in advance for your effort!

trubador
Did you use forum search?
Posts: 1520
Joined: Thu Nov 20, 2008 12:04 pm

Re: Removing outliers: Winsorization

Postby trubador » Mon Sep 14, 2009 3:47 am

Removing outliers is a trimming process. Winsorization is more like a transformation in which you replace the outliers with a threshold quantile value. I suppose you are trying to achieve the latter. The following command will Winsorize the series "y" by %0.5 and will create a new one called "y_q":

Code: Select all

series y_q = @recode(y>@quantile(y,.995),@quantile(y,.995),@recode(y<@quantile(y,.005),@quantile(y,.005),y))
However, I suggest you using a more formal estimation method to handle the outliers than simply preprocessing the data. You might want to look at Quantile Regression Estimation in that respect...

NDB
Posts: 1
Joined: Wed Mar 27, 2013 6:50 am

Re: Removing outliers: Winsorization

Postby NDB » Wed Mar 27, 2013 6:57 am

Dear all

I want to remove the outliers of my dataset through winsorization. Therefore I create a new program and give in the follow formula:

!my_percentile = x
!quant_low = @quantile(variable,!my_percentile)
!quant_high = @quantile(variable,1-!my_percentile)
series variable_win= !quant_low*(variable<!quant_low) + variable*((variable >!quant_low) and (variable <!quant_high)) + !quant_high*(variable >!quant_high)

I ran the winsorization on a 5% level. My problem now is that Eviews changes the outliers in 0, instead of the lowest and highest value within the 5%-95%.

Can you help me solve this problem?

Thanks in advance.

Nicolas

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

Re: Removing outliers: Winsorization

Postby EViews Gareth » Wed Mar 27, 2013 7:37 am

Why use that formula instead of the one that Trubador gave. Or, why not use the Trim add-in to do it?


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest