Skip to contents

Uses stats::shapiro.test to perform test of normality and outputs interpretation into console.

Usage

check_normal(values, alpha = 0.05)

Arguments

values

numeric vector

alpha

numeric; p-value threshold for significance

Value

Logical SW normality test result; message

Details

The null hypothesis of the S-W test is that the sample comes from a normally distributed population. If the p-value is less than the chosen alpha level, the null hypothesis is rejected, indicating that the data has non-normal distribution.

Examples

set.seed(13)
check_normal(rnorm(100))
#> Shapiro-Wilk normality test: p-value = 0.273
#> ** p = 0.273 > 0.05; normal
#> [1] TRUE