R/welchT.R

Defines functions welchT

Documented in welchT

#' @title BMI585 final project: Welch’s t-test is used to compare the means between two independent arrays
#' @description This functions accept two numerical arrays
#' @param x:the first array
#' @param y:the second array
#' @return welch: welch t test statistics
#' @examples
#' t <- c(1,1,1)
#' g <- c(0,0,0)
#' welchT(t,g)


welchT = function(x,y){
  freeA <- sd(x)**2/length(x)
  freeB <- sd(y)**2/length(y)
  denom <- sqrt(freeA+freeB)
  welch <- (mean(x)-mean(y))/denom
  return (welch)
}
shaoyanpan/BMI585final2 documentation built on Dec. 23, 2021, 1:20 a.m.