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)
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.
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.