boxcox_transform: Helper function to calculate optimal Box-Cox power...

Description Usage Arguments Details Value

View source: R/boxcox.r

Description

A Box-Cox (BC) transformation is often used to transform data to achieve a symmetric, unimodal distribution (typically, of the response). The BC transformation can be estimated via boxCox. The code to find the optimal value is a bit cumbersome. In this function, we streamline the process.

Usage

1
boxcox_transform(x, plot = FALSE, family = c("bcPower", "yjPower"), ...)

Arguments

x

numeric data vector

plot

logical. Plot the BC's objective function? Default: no.

family

transformation family to use: Box-Cox or Yeo-Johnson. The options match those in boxCox

...

additional arguments passed to boxCox

Details

The BC transformation requires a positive response. In this case, the Yeo-Johnson (YJ) transformation generalizes the BC transformation to allow all real values.

Value

list with the transformed data in x and the optimal BC value in lambda.


ramhiser/pocketknife documentation built on May 26, 2019, 10:11 p.m.