R/zscores.R

Defines functions zscores

Documented in zscores

#' rank-based z-scores
#' 
#' Computes the normal scores corresponding to the ranks of a data vector
#' 
#' 
#' @usage zscores(y,ties.method="average")
#' @param y a numeric vector
#' @param ties.method method for dealing with ties
#' @return a numeric vector
#' @author Peter Hoff
#' @export zscores
zscores<-function(y,ties.method="average")
{
 qnorm( rank(y,na.last="keep",ties.method=ties.method)/(1+sum(!is.na(y))) )
}

Try the amen package in your browser

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

amen documentation built on Jan. 13, 2021, 9:17 p.m.