R/normalizeqntval.R

Defines functions normalizeqntval

Documented in normalizeqntval

normalizeqntval <- 
function(x){
      
      rows <- dim(x)[1]
      cols <- dim(x)[2]
      if (!is.matrix(x)) {
        stop("Matrix expected in normalize.quantiles")
      }
      
      x.order = apply(x,2,function(x) sort.list(x))
      x.sort  = sapply(1:cols,function(i) x[x.order[,i],i])
      mqnts   = rowMeans(x.sort) 
      x.norm  = sapply(1:cols,function(i) mqnts[sort.list(x.order[,i])])
      
      return(list(x=x.norm,mqnts=mqnts))
}

Try the bapred package in your browser

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

bapred documentation built on June 22, 2022, 9:08 a.m.