boxCoxTransform: Box-Cox Transformation of Numeric Matrix

View source: R/data.R

boxCoxTransformR Documentation

Box-Cox Transformation of Numeric Matrix

Description

This function applies the Box-Cox transformation to the columns of a numeric matrix.

Usage

boxCoxTransform(data, lambdas, ...)

Arguments

data

A numeric matrix to be transformed.

lambdas

A numeric vector, a single number, NA, or NULL indicating the lambda parameter(s) for the Box-Cox transformation. Use NULL for no transformation, NA for estimating the lambda parameter for each variable, a single number for equal lambda parameter for all variables, and a numeric vector for distinct lambda parameters for the corresponding variables.

...

additional parameters for MASS::boxcox function.

Value

data

transformed data

lambdas

final lambda vector used in the calculations.

Examples

data <- matrix(rnorm(40), ncol = 2)
result <- ldt:::boxCoxTransform(data, c(0.5, 0.5))


ldt documentation built on Sept. 11, 2024, 5:25 p.m.