ez.boxcox | R Documentation |
box-cox power transformation GDoc Note
ez.boxcox(
y,
col = NULL,
na.rm = FALSE,
plot = TRUE,
print2scr = TRUE,
force = TRUE,
method = c("boxcox", "modified.tukey"),
precise = c("rounded", "raw"),
...
)
y |
a data frame or a vector |
col |
passed to |
na.rm |
rm na from y,x (pairwise), if not, NA stays as is. applicable only if y is a vector. |
plot |
boxcox plot. applicable only when there is an actual transformation |
print2scr |
print out transformation parameters |
force |
T = transform regardless, or F = only if p.lambda rounded is less than .05. |
method |
"boxcox" is |
precise |
use rounded lambda, one of c(0, 0.33, -0.33, 0.5, -0.5, 1, -1, 2, -2) or raw/calculated lambda |
returns transformed y, or original y if no transformation occurs.
Box and Cox (1964) bcPower
and modified tukey basicPower
can only deal with non-negative responses. Also consider applying z standardization to boxcox-transformed data.
lambda is a tuning parameter that can be optimized in a way that the distribution of the transformed data has the largest similarity to a normal distribution. There are several proposals to optimize lambda.
The Box-Cox-transformed values do not guarantee normality although the data should be less skewed and should have less extreme values than before transformation.
Some research (Zwiener et al, 2014, PLOS ONE) pointed out that z Standardization of covariates leads to better prediction performance independent of the underlying transformation used (eg., raw, log, boxcox)
see also boxcox
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.