Compute and return information on tests for the normality of data.
Usage
normality_tests(
x,
tests = c("shapiro", "ks", "ad", "cvm", "lilliefors", "pearson", "sf")
)
Arguments
- x
Vector of numerics to check normality
- tests
Vector of strings, or a string, indicating the tests to check.
Options include 'shapiro', 'ks', 'ad', 'cvm', 'lilliefors', 'pearson', and
'sf'
Value
A list of qqplot and normality test results
Details
Tests require independent data unless otherwise specified.
shapiro: Shapiro-Wilk test
ks: Kolmogorov-Smirnov test
ad: Anderson-Darling test
cvm: Cramer-von Mises test
lilliefors: lilliefors test
pearson: Pearson chi-square test
sf: Shapiro-Francia test
Examples
x <- c(rnorm(14, sd = 2), rnorm(6), rnorm(20, mean = 2))
normality_tests(x)
#> $qqplot
#>
#> $shapiro
#> [1] 0.2270045
#>
#> $ks
#> [1] 0.000311607
#>
#> $ad
#> [1] 0.2235118
#>
#> $cvm
#> [1] 0.2508239
#>
#> $lilliefors
#> [1] 0.2323053
#>
#> $pearson
#> [1] 0.602679
#>
#> $sf
#> [1] 0.2044254
#>