R/percentile.R

Defines functions percentile

Documented in percentile

#' Percentile
#'
#' Input as percent, not decimal
#' @param perc the "th" percentile to calculate, example 60th -> 60
#' @param mu the mean
#' @param sigma the standard deviation
#' @return the calculated percentile
#' @export
#' @examples
#' percentile(perc,mu,sigma)
percentile <- function(perc,mu,sigma){
  z = qnorm(perc/100)
  return(mu+(z*sigma))
}
DanielM39/myStats documentation built on Dec. 17, 2021, 4:04 p.m.