[R] Remove data 3 standard deviatons from the mean using R?

David Winsemius dwinsemius at comcast.net
Tue Apr 9 15:46:16 CEST 2013

On Apr 9, 2013, at 4:12 AM, Lorna wrote:

> Hi Everyone,
> I have a very long list of data-points (+2300) and i know from my  
> histogram
> that there are outliers which are affecting my mean.
> I was wondering if anyone on here knows a way i can quickly get R to
> calculate and remove data which is 3 standard deviations from the  
> mean? I am
> hoping this will tidy my data and give me a repeatable method of  
> tidying for
> future data collection.
> Please if you do post code, make it as user friendly as possible! I  
> am not a
> very good programmer, i can load my data into R and do basic stats  
> on it
> however i havent tried much else....
> Thank you in advance for any advice given :)

This plan has no statistical justification. Around here we have  
reverence for data. Outliers are often meaningful. Requests to distort  
your data should be accompanied by a coherent argument.


David Winsemius, MD
Alameda, CA, USA

More information about the R-help mailing list