box: Box-Cox Transformation

View source: R/plot.R

boxR Documentation

Box-Cox Transformation

Description

This function performs Box-Cox transformation on the inputted data matrix.

Usage

box(data, lambda)

Arguments

data

A numeric vector, matrix or data frame of observations. Negative data values are permitted.

lambda

The transformation to be applied to the data. If negative data values are present, lambda has to be positive.

Details

To allow for negative data values, a slightly modified version of the original Box-Cox (1964) is used here. This modified version originated from Bickel and Doksum (1981), taking the following form:

f(y) = \frac{\mathrm{sgn}(y)|y|^\lambda-1}{\lambda}

When negative data values are involved, the transformation parameter, \lambda, has to be positive in order to avoid discontinuity across zero.

Value

A numeric vector, matrix or data frame of the same dimension as data is returned.

References

Bickel, P. J. and Doksum, K. A. (1981) An Analysis of Transformations Revisited. J. Amer. Statist. Assoc. 76(374), 296-311.

Box, G. E. P. and Cox, D. R. (1964) An Analysis of Transformations. J. R. Statist. Soc. B 26, 211-252.

See Also

rbox

Examples


data(rituximab)
library(flowCore)
data <- exprs(rituximab)
summary(data)
# Transform data using Box-Cox with lambda=0.3
dataTrans <- box(data, 0.3)
# Reverse transform data; this should return back to the original rituximab data
summary(rbox(dataTrans, 0.3))

RGLab/flowClust documentation built on Jan. 31, 2024, 11:26 p.m.