[R] R code for to check outliers

Rui Barradas ruipbarradas at sapo.pt
Wed Jul 18 20:52:46 CEST 2012


Hello,

Inline

Em 18-07-2012 18:44, Nordlund, Dan (DSHS/RDA) escreveu:
>> -----Original Message-----
>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> project.org] On Behalf Of Sajeeka Nanayakkara
>> Sent: Wednesday, July 18, 2012 6:28 AM
>> To: r-help at r-project.org
>> Subject: [R] R code for to check outliers
>>
>>
>>
>>
>>
>>   What is the R code to check whether data series have outliers or not?
>>
>> Thanks,
>>
>> Sajeeka Nanayakkara
>> 	[[alternative HTML version deleted]]
>
> Sajeeka,
>
> You have been given lots of good information and appropriate warnings.  Let me add another caveat to think about in the context of outliers/unusual values.  A value may only be unusual in a multivariate context.  If we have a dataset with human heights in it, a value of 73 inches would not be unusual.  If we then learned that this particular individual was female, it would be somewhat unusual but certainly within the realm of possibility.

Uma Thurman!

>  If we then learn that the individual is 3 years old, it would be highly unusual.
>
> So, you can see why people on the list are somewhat unwilling to say here is THE function "to check whether data series have outliers or not."
>
> Now having said that, can you define what YOU mean by "outlier" and why you are concerned about finding them.  Someone may be able to offer advice that will help you achieve your goal.

Agreeing with what has being said and not wanting to misdirect no one, 
there's a function in the graphics package that gives outliers, boxplot. 
They are computed based on boxplot.stats so see

?boxplot.stats

in particular the parameter coef and it's default value.
See also the return values from both these functions.

Rui Barradas

>
> Dan
>
> Daniel J. Nordlund
> Washington State Department of Social and Health Services
> Planning, Performance, and Accountability
> Research and Data Analysis Division
> Olympia, WA 98504-5204
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list