normalize | R Documentation |
(Slow) implementation of the transformation described in Albada, 2007.
normalize(X, na.rm = FALSE)
X |
the vector of values |
na.rm |
should the NA values be ignored when estimating the cumulative distribution function. |
Albada et al. Transformation of arbitrary distributions to the normal distribution with application to EEG test-retest reliability (2007, journal of Neuroscience Methods)
n <- 1000
## normal distribution ##
X <- rnorm(n)
Xnorm <- normalize(X)
shapiro.test(Xnorm)
# plot(X, Xnorm)
X.NA <- c(NA,X,NA)
Xnorm.NA <- normalize(X.NA, na.rm = TRUE)
## gamma distribution
X <- rgamma(n, shape = 1)
shapiro.test(X)
# hist(X)
Xnorm <- normalize(X)
shapiro.test(Xnorm)
# hist(Xnorm)
# plot(X,Xnorm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.