boxcoxmeta
performs ensemble based Box-Cox transformation via meta analysis for normality of a variable and provides graphical analysis.
boxcoxmeta(data, lambda = seq(-3,3,0.01), nboot = 100, lambda2 = NULL, plot = TRUE,
alpha = 0.05, verbose = TRUE)
A list with class "boxcoxmeta" containing the following elements:
name of method
estimate of Box-Cox Power transformation parameter
additional shifting parameter
a data frame containing the result
the level of significance to assess normality.
transformed data set
variable name
a numeric vector of data values.
a vector which includes the sequence of candidate lambda values. Default is set to (-3,3) with increment 0.01.
a number of Bootstrap samples to estimate standard errors of lambda estimates.
a numeric for an additional shifting parameter. Default is set to lambda2 = 0.
a logical to plot histogram with its density line and qqplot of raw and transformed data. Defaults plot = TRUE.
the level of significance to check the normality after transformation. Default is set to alpha = 0.05.
a logical for printing output to R console.
Muhammed Ali Yilmaz, Osman Dag
Denote \(y\) the variable at the original scale and \(y'\) the transformed variable. The Box-Cox power transformation is defined by:
$$y' = \left\{ \begin{array}{ll} \frac{y^\lambda - 1}{\lambda} \mbox{ , if $\lambda \neq 0$} \cr log(y) \mbox{ , if $\lambda = 0$} \end{array} \right.$$
If the data include any nonpositive observations, a shifting parameter \(\lambda_2\) can be included in the transformation given by:
$$y' = \left\{ \begin{array}{ll} \frac{(y + \lambda_2)^\lambda - 1}{\lambda} \mbox{ , if $\lambda \neq 0$} \cr log(y + \lambda_2) \mbox{ , if $\lambda = 0$} \end{array} \right.$$
Yilmaz, M.A., Dag, O. (2022). Ensemble Based Box-Cox Transformation via Meta Analysis. Journal of Advanced Research in Natural and Applied Sciences, 8:3, 463--471.
library(AID)
data(textile)
# \donttest{
out <- boxcoxmeta(textile[,1])
out$lambda.hat # the estimate of Box-Cox parameter
out$tf.data # transformed data set
# }
Run the code above in your browser using DataLab