EVOLUTION-MANAGER
Edit File: boxcox_trans.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Box-Cox & modulus transformations</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for boxcox_trans {scales}"><tr><td>boxcox_trans {scales}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Box-Cox & modulus transformations</h2> <h3>Description</h3> <p>The Box-Cox transformation is a flexible transformation, often used to transform data towards normality. The modulus transformation generalises Box-Cox to also work with negative values. </p> <h3>Usage</h3> <pre> boxcox_trans(p, offset = 0) modulus_trans(p, offset = 1) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>p</code></td> <td> <p>Transformation exponent, <i>λ</i>.</p> </td></tr> <tr valign="top"><td><code>offset</code></td> <td> <p>Constant offset. 0 for Box-Cox type 1, otherwise any non-negative constant (Box-Cox type 2). <code>modulus_trans()</code> sets the default to 1.</p> </td></tr> </table> <h3>Details</h3> <p>The Box-Cox power transformation (type 1) requires strictly positive values and takes the following form for <code>y > 0</code>: </p> <p style="text-align: center;"><i>y^(λ) = (y^λ - 1)/λ</i></p> <p>When <code>y = 0</code>, the natural log transform is used. </p> <p>The modulus transformation implements a generalisation of the Box-Cox transformation that works for data with both positive and negative values. The equation takes the following forms, when <code>y != 0</code> : </p> <p style="text-align: center;"><i> y^(λ) = sign(y)*((|y|+1)^λ - 1)/λ</i></p> <p>and when <code>y = 0</code>: </p> <p style="text-align: center;"><i> y^(λ) = sign(y) * ln(|y| + 1)</i></p> <h3>References</h3> <p>Box, G. E., & Cox, D. R. (1964). An analysis of transformations. Journal of the Royal Statistical Society. Series B (Methodological), 211-252. <a href="https://www.jstor.org/stable/2984418">https://www.jstor.org/stable/2984418</a> </p> <p>John, J. A., & Draper, N. R. (1980). An alternative family of transformations. Applied Statistics, 190-197. <a href="http://www.jstor.org/stable/2986305">http://www.jstor.org/stable/2986305</a> </p> <h3>See Also</h3> <p><code><a href="yj_trans.html">yj_trans()</a></code> </p> <h3>Examples</h3> <pre> plot(boxcox_trans(-1), xlim = c(0, 10)) plot(boxcox_trans(0), xlim = c(0, 10)) plot(boxcox_trans(1), xlim = c(0, 10)) plot(boxcox_trans(2), xlim = c(0, 10)) plot(modulus_trans(-1), xlim = c(-10, 10)) plot(modulus_trans(0), xlim = c(-10, 10)) plot(modulus_trans(1), xlim = c(-10, 10)) plot(modulus_trans(2), xlim = c(-10, 10)) </pre> <hr /><div style="text-align: center;">[Package <em>scales</em> version 1.1.1 <a href="00Index.html">Index</a>]</div> </body></html>