box_cox: Box cox transformation

Description Usage Arguments Details Value Examples

View source: R/box cox.R

Description

This function perform box cox transformation.

Usage

1
box_cox(y, lambda1, lambda2, na.omit = FALSE)

Arguments

y

The vector to be transformed.

lambda1

The first parameter of the transformation, range from -5 to 5.

lambda2

The second parameter of the transformation, lambda2 is introduced for negative values of y. lambda2 must be greater than -y.

na.omit

Whether or not to remove NAs, the default is FALSE.

Details

This function calculate the box cox transform of a vector.

The box_cox is used to transform non-normal dependent variables into a normal shape.

Value

A vector that is the box cox transformation of y.

Examples

1
2
box_cox(5:10,2,6)
box_cox(-5,3,2)

hannahdxz/powers documentation built on May 29, 2019, 12:04 p.m.