selectTransform: Data-Driven Selection of the Optimal Transformation Method

View source: R/selectTransform.R

selectTransformR Documentation

Data-Driven Selection of the Optimal Transformation Method

Description

selectTransform performs an automated evaluation to identify the optimal transformation method for a dataset.

Usage

selectTransform(data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)

Arguments

data

a numeric vector to be transformed.

alpha

the level of significance used to assess normality based on the Shapiro-Wilk test. Default is set to alpha = 0.05.

na.rm

a logical value indicating whether missing values should be removed before the computation proceeds.

verbose

a logical value indicating whether the output should be printed to the R console.

Details

The function applies several transformation methods to the data and evaluates the normality of the transformed data using the Shapiro-Wilk test.

For each transformation method, the function reports the estimated transformation parameter, when applicable, the Shapiro-Wilk test statistic, and the corresponding p-value. The transformation method yielding the maximum Shapiro-Wilk test statistic is recommended as the optimal transformation method.

The transformation methods evaluated by the function include Box-Cox, Manly, Modulus, Bickel-Doksum, Yeo-Johnson, Dual, Gpower, Log-shift, Square-root shift, Log, Reciprocal, Glog, and Neglog transformations. For transformation methods without a transformation parameter, the lambda value is reported as NA.

Value

A data frame presenting the name of the transformation method, the corresponding transformation function call, the estimated transformation parameter, the Shapiro-Wilk test statistic, the corresponding p-value of the Shapiro-Wilk normality test.

Author(s)

Muge Coskun Yildirim and Osman Dag

Examples



library(Transform)
selectTransform(MASS::Cushings$Tetrahydrocortisone)


Transform documentation built on June 5, 2026, 5:08 p.m.