bct function

Applying the Box-Cox Transformation.

Applying the Box-Cox Transformation.

bct returns the Box-Cox transformed numeric vector (Box and Cox, 1964).

bct(y, lambda)

Arguments

  • y: a positive real number vector.
  • lambda: a scalar transformation parameter.

Returns

bct returns the Box-Cox transformed numeric vector, z = log(y) for lambda = 0, z = (y ^ lambda - 1) / lambda for lambda ne 1.

Examples

y <- exp(rnorm(10)) z <- bct(y, 0) #log transformation

References

Box, G.E.P. and Cox, D.R. (1964). An analysis of transformations (with discussion). Journals of the Royal Statistical Society, Series B, 26, 211-246, tools:::Rd_expr_doi("10.1111/j.2517-6161.1964.tb00553.x") .

  • Maintainer: Kazushi Maruo
  • License: GPL (>= 2)
  • Last published: 2025-04-11

Useful links