royston: Royston's Multivariate Normality Test

View source: R/royston.R

roystonR Documentation

Royston's Multivariate Normality Test

Description

Performs Royston’s test for multivariate normality by combining univariate W-statistics (Shapiro–Wilk or Shapiro–Francia) across variables and adjusting for the correlation structure.

Usage

royston(data, tol = 1e-25, bootstrap = FALSE, B = 1000, cores = 1)

Arguments

data

A numeric matrix or data frame with observations in rows and variables in columns.

tol

Numeric tolerance passed to solve when inverting the covariance matrix. Default is 1e-25.

bootstrap

Logical; if TRUE, compute p-value via bootstrap resampling. Default is FALSE.

B

Integer; number of bootstrap replicates used when bootstrap = TRUE. Default is 1000.

cores

Integer; number of cores for parallel computation when bootstrap = TRUE. Default is 1.

Value

A data frame with one row containing the test name (Test), the Royston test statistic (Statistic), and the associated p-value (p.value) from a chi-square approximation.

Examples

## Not run: 
data <- iris[1:50, 1:4]
royston_result <- royston(data)
royston_result

## End(Not run)


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

Related to royston in MVN...