Date: Thu, 9 Feb 2012 13:38:24 -0500
Reply-To: Rick Wicklin <Rick.Wicklin@SAS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rick Wicklin <Rick.Wicklin@SAS.COM>
Subject: Re: Macro for detecting and replacing outlier
On Wed, 8 Feb 2012 14:48:30 -0600, Farmaha, Bhupinder
<bhupi80singh@YAHOO.CO.IN> wrote:
>I am looking for a macro to detect and replace/remove outliers for
multiple
>variables.
>
It's not clear whether you want to detect univariate outliers for many
variables, or whether you want to detect multivariate outliers. Those are
two different things, and a multivariate outlier might not be a univariate
outlier in any variable.
One approach is to use robust estimates of the location (center) of the
data and robust estimates of the scale. For one variable, you can use the
ideas and code presented at
http://blogs.sas.com/content/iml/2012/01/27/detecting-outliers-in-sas-part-
2-estimating-scale/
or tiny url http://bit.ly/wka8D8
For multivariate outliers, you can use the ideas and code at
http://blogs.sas.com/content/iml/2012/02/02/detecting-outliers-in-sas-part-
3-multivariate-location-and-scatter/
or tiny url http://bit.ly/w97zF4
Rick Wicklin
Statistical programming and SAS/IML blog: http://blogs.sas.com/content/iml
|