Applies a Shapiro-Wilks test to a numeric vector, and returns a list with the statistic W, its p-value, and a character string with the interpretation.
Value
A list with four slots:
/item
wW statistic returned byshapiro.test(). /itemp.valuep-value of the Shapiro test. /iteminterpretationCharacter vector, one of "x is normal", "x is not normal". /itemplotA patchwork plot with the qq plot and the histogram of x.
Examples
residuals_test(residuals = runif(100))
#> $shapiro.w
#> [1] 0.9606738
#>
#> $p.value
#> [1] 0.004492854
#>
#> $interpretation
#> [1] "Residuals are not normal"
#>