how can i remove outliers in my data

Hi everyone, Hope everyone doing Good I have some problem. when I run my codes to find the probability I got some errors due to outliers Values. Could anyone help me, how i can remove outlier values? I have a dataset in excel. Thank you :)

3 Comments

That very much depends on the data you are working with. You could simply define a set number of standard deviations from the mean and remove data below and above said threshold.
How would you go about coding this? I am very bad at statistics. . .
Like I said in my Answer below (scroll down past this "Comments" section down to the official "Answers" section at the bottom of the page):
TF = isoutlier(A);
% Now remove outliers from A
A(TF) = []; % or equivalently, A = A(~TF);

Sign in to comment.

Answers (1)

Did you check the help?
"TF = isoutlier(A) returns a logical array whose elements are true when an outlier is detected in the corresponding element of A. By default, an outlier is a value that is more than three scaled median absolute deviations (MAD) away from the median. If A is a matrix or table, then isoutlier operates on each column separately. If A is a multidimensional array, then isoutlier operates along the first dimension whose size does not equal 1."

Asked:

on 28 May 2018

Commented:

on 12 Dec 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!