Check normality of a vector of values.
na.rm
This '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.959 3.81e- 16 Shapiro-Wilk normality test Not normally … NA
#> 2 0.500 5.71e-218 Asymptotic one-sample Kolmogorov-… Not normally … NA
#> 3 0.0385 NA Skewness 0 in normal d… NA
#> 4 1.85 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.999 0.790 Shapiro-Wilk normality test Normally dist… (as is)
#> 2 0.0369 0.130 Asymptotic one-sample Kolmogorov-Smi… Normally dist… (as is)
#> 3 -0.0102 NA Skewness 0 in normal d… NA
#> 4 3.21 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.833 4.87e- 31 Shapiro-Wilk normality test Not normally … NA
#> 2 0.500 1.34e-217 Asymptotic one-sample Kolmogorov-… Not normally … NA
#> 3 1.68 NA Skewness 0 in normal d… NA
#> 4 6.30 NA Kurtosis 3 in normal d… NA