Tsallaka zuwa abun ciki
Justice Tech School

Finding Outliers

The boxplot rule flags values far outside the quartiles.

Example
x <- c(10, 12, 11, 13, 200)
q <- quantile(x, c(0.25, 0.75))
iqr <- q[2] - q[1]
print(x[x < q[1] - 1.5 * iqr | x > q[2] + 1.5 * iqr])
print(boxplot.stats(x)$out)

Exercise

Outliers.

boxplot.stats(x)$

Quiz Test

What is the IQR?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.