R/Normalize.R

"Normalize" <- 
function(x)
{

uniformize <- function (x) 
{ 
	x <- rank(x, 
             na.last = "keep", 
             ties.method = "average")
    n <- sum(!is.na(x))
    x / (n + 1)
  }
  
  return( qnorm(uniformize(x), mean=mean(x, na.rm=TRUE), sd=sd(x, na.rm=TRUE) ) )
  }
  
  
 

Try the QuantPsyc package in your browser

Any scripts or data that you put into this service are public.

QuantPsyc documentation built on June 4, 2022, 1:06 a.m.