View source: R/selectTransform.R
| selectTransform | R Documentation |
selectTransform performs an automated evaluation to identify the optimal transformation method for a dataset.
selectTransform(data, alpha = 0.05, na.rm = TRUE, verbose = TRUE)
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 |
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. |
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.
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.
Muge Coskun Yildirim and Osman Dag
library(Transform)
selectTransform(MASS::Cushings$Tetrahydrocortisone)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.