Skip to content

Commit 6bb2259

Browse files
authored
Update CombatFunctions
1 parent 791f755 commit 6bb2259

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

Combat_HKfunctions.R

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -490,37 +490,7 @@ nnmd<-function(FCs,essential,nonessential){
490490
denom<-apply(FCs,2,function(x) sd(x[noness]))
491491
unlist(numerators)/unlist(denom)
492492
}
493-
ssmd <- function (a, b, verbose=TRUE,...)
494-
{
495-
if (length(a) < 2 | length(b) < 2) {
496-
stop(call. = FALSE, "Inputs need to be greater at least 2 elements long")
497-
}
498-
if (is.numeric(a) == FALSE | is.numeric(b) == FALSE) {
499-
stop(call. = FALSE, "Input needs to be numeric.")
500-
}
501-
502-
mu_a <- mean(a, ...)
503-
mu_b <- mean(b, ...)
504-
var_a <- var(a, ...)
505-
var_b <- var(b, ...)
506-
507-
# if lengths are equal assume correlation and calculate covariance
508-
if (length(a) == length(b)) {
509-
cov_ab <- cov(a, b)
510-
beta <- (mu_a - mu_b)/sqrt(var_a + var_b - 2 * cov_ab)
511-
} else{ # unequal lengths => not paired , cannot calc covariance
512-
beta <- (mu_a - mu_b) / sqrt(var_a + var_b)
513-
if(verbose == TRUE)
514-
{
515-
warning("a and b have different lengths. Calculations assumed no correlation.",
516-
call. = FALSE)
517-
}
518-
}
519-
520493

521-
522-
return(beta)
523-
}
524494

525495
CL_qualitySSMD<-function(FCmatrix,ess,noness){
526496
out<-vector("numeric",length=ncol(FCmatrix))

0 commit comments

Comments
 (0)