Normalise data with a power transformation.

Usage,
power_transformation(
  data,
  trait = "DATA",
  alpha = 0.05,
  transf_vals = c(2, exp(1), 3, 4, 5, 6, 7, 8, 9, 10),
  plots_prefix = file.path(tempdir(), "HIST"),
  digits = 6,
  plot = TRUE,
  quiet = FALSE
)

Arguments

data

Original data.

trait

Trait name.

alpha

Significance level.

transf_vals

Transformation values.

plots_prefix

Prefix for plots with or without path.

digits

Significant digits to compare p-values of transformations.

plot

Boolean flag to indicate whether or not to plot a histogram comparing the original and transformed/normalised data.

quiet

Boolean flag to hide status messages.

Value

Data structure containing the normalised data, original data if no transformation was performed.

See also

Other Transformation functions: log_transformation(), root_transformation()

Examples

set.seed(123)
data <- rnorm(100, 5)
transformed <- MetaPipe::power_transformation(sqrt(data), "ROOT_2")
#> Warning: Using ragg device as default. Ignoring `type` and `antialias` arguments
#> 
#> The data was normalised by a power of 2