test_univariate_normality: Univariate Normality Tests

View source: R/test_univariate_normality.R

test_univariate_normalityR Documentation

Univariate Normality Tests

Description

Performs one of several common univariate normality tests on each numeric variable in a vector, matrix, or data frame.

Usage

test_univariate_normality(data, test = c("SW", "CVM", "Lillie", "SF", "AD"))

Arguments

data

A numeric vector, matrix, or data frame with observations in rows and variables in columns. Non-numeric columns are dropped with a warning. Each column is tested individually.

test

A character string specifying the normality test to use. Choices are: "SW" (Shapiro–Wilk), "SF" (Shapiro–Francia), "AD" (Anderson–Darling), "CVM" (Cramér–von Mises), and "Lillie" (Lilliefors test). Default is the first match from this list.

Value

A data frame with one row per variable and the following columns: Test, the name of the test used; Variable, the name of the tested variable; Statistic, the test statistic; and p.value, the associated p-value.

Examples

## Not run: 
data(iris)
test_univariate_normality(iris[, 1:4], test = "AD")

## End(Not run)


MVN documentation built on June 10, 2025, 5:12 p.m.