Check normality of a vector of values.
na.rmThis 'certestats' package supports a global default setting for na.rm in many mathematical functions. This can be set with options(na.rm = TRUE) or options(na.rm = FALSE).
For normality(), quantile() and IQR(), this also applies to the type argument. The default, type = 7, is the default of base R. Use type = 6 to comply with SPSS.
x <- runif(1000)
normality(x)
#> # A tibble: 4 × 5
#> statistic p.value method interpretation suggest
#> <dbl> <dbl> <chr> <chr> <chr>
#> 1 0.960 7.39e- 16 Shapiro-Wilk normality test Not normally … NA
#> 2 0.500 1.03e-217 Asymptotic one-sample Kolmogorov-… Not normally … NA
#> 3 0.0126 NA Skewness 0 in normal d… NA
#> 4 1.86 NA Kurtosis 3 in normal d… NA
x <- rnorm(1000)
normality(x)
#> # A tibble: 4 × 5
#> statistic p.value method interpretation suggest
#> <dbl> <dbl> <chr> <chr> <chr>
#> 1 0.998 0.394 Shapiro-Wilk normality test Normally dist… (as is)
#> 2 0.0291 0.365 Asymptotic one-sample Kolmogorov-Smi… Normally dist… (as is)
#> 3 0.00550 NA Skewness 0 in normal d… NA
#> 4 2.77 NA Kurtosis 3 in normal d… NA
x <- rexp(1000, rate = 3)
normality(x)
#> # A tibble: 4 × 5
#> statistic p.value method interpretation suggest
#> <dbl> <dbl> <chr> <chr> <chr>
#> 1 0.821 5.58e- 32 Shapiro-Wilk normality test Not normally … NA
#> 2 0.500 1.34e-217 Asymptotic one-sample Kolmogorov-… Not normally … NA
#> 3 1.93 NA Skewness 0 in normal d… NA
#> 4 8.87 NA Kurtosis 3 in normal d… NA