View source: R/effective_functions.r
transNorm | R Documentation |
Note, that we do note use the Doornik-Hansen test because the implementation in 'normwh.test' has been archived. We continue to use the other methods prescribed in Velez et al.
transNorm( x, start = 0.01, family = c("bc", "yj"), lams, combine.method = c("Stouffer", "Fisher", "Average"), ... )
x |
Vector of values to be transformed to normality |
start |
Positive value to be added to variable to ensure all values are positive. This follows the transformation of the variable to have its minimum value be zero. |
family |
Family of test - Box-Cox or Yeo-Johnson. |
lams |
A vector of length 2 giving the range of values for the transformation parameter. |
combine.method |
String giving the method used to to combine p-values from normality tests. |
... |
Other arguments, currently unimplemented. |
Uses the method proposed by Velez, Correa and Marmolejo-Ramos to normalize variables using Box-Cox or Yeo-Johnson transformations.
A scalar giving the optimal transformation parameter.
Velez Jorge I., Correa Juan C., Marmolejo-Ramos Fernando. (2015) "A new approach to the Box-Cox Transformation" Frontiers in Applied Mathematics and Statistics.
data(wvs) library(car) lam <- transNorm(wvs$gdp_cap, family="yj", lams =c(-2,2)) wvs$trans_gdp <- yjPower(wvs$gdp_cap, lambda=lam)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.