R/oneSampleZ.R

Defines functions oneSampleZ

Documented in oneSampleZ

#' Calculate One Sample Z-Score
#'
#' @param v a numerical vector
#' @param u the hypothesised mean
#'
#' @return a number
#' @importFrom stats sd
#' @export
#'
#' @examples
#' oneSampleZ(rnorm(50),50)
oneSampleZ <- function(v, u){
  mean(v) - u/(sd(v)/ sqrt(length(v)))
}
JoWatson2011/mypackage documentation built on Jan. 8, 2020, 12:02 a.m.