R 中的異常偵測入門
Alastair Rushworth
Data Scientist
boxplot(temperature, ylab = "Celsius")

hist(temperature, breaks = 6)

對稱且鐘形嗎?
使用 grubbs.test() 函式:
grubbs.test(temperature)
Grubbs test for one outlier
data: temp
G = 3.07610, U = 0.41065, p-value = 0.001796
alternative hypothesis: highest value 30 is an outlier
grubbs.test(temperature)
Grubbs test for one outlier
data: temperature
G = 3.07610, U = 0.41065, p-value = 0.001796
alternative hypothesis: highest value 30 is an outlier
p-value
最大值 的位置
which.max(weights)
5
最小值 的位置
which.min(temperature)
12
R 中的異常偵測入門