Skip to contents

Grubbs (1969) test that the most extreme observation is an outlier

Usage

GrubbsT(x, alpha = 0.05, opposite = FALSE)

Arguments

x

numeric sample, length >= 3

alpha

level at which the critical value is reported

opposite

test the end NOT selected by the maximum deviation

Value

list(statistic, p_value, critical_value, reject, outlier, index, side, mean, sd, n)

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
GrubbsT(V)
#> $statistic
#> [1] 1.428869
#> 
#> $p_value
#> [1] 0.5358984
#> 
#> $critical_value
#> [1] 2.031652
#> 
#> $reject
#> [1] FALSE
#> 
#> $outlier
#> [1] 8
#> 
#> $index
#> [1] 7
#> 
#> $side
#> [1] "max"
#> 
#> $mean
#> [1] 4.5
#> 
#> $sd
#> [1] 2.44949
#> 
#> $alpha
#> [1] 0.05
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "Grubbs (1969) single-outlier test, outliers::grubbs.test type 10; p = n (pt(t, n-2, lower.tail = FALSE)), one-sided"
#>