From b0519ec2e48327b20f0439c01055982c65d51c10 Mon Sep 17 00:00:00 2001 From: falkcarl Date: Fri, 16 Apr 2021 10:00:56 -0400 Subject: [PATCH] fix sampleSize calculations It's either this or the docs need to be updated to properly reflect what "the average of sample sizes used for each individual correlation" means. --- R/defaultFunctions.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/defaultFunctions.R b/R/defaultFunctions.R index 7000bf8..ee5ce44 100644 --- a/R/defaultFunctions.R +++ b/R/defaultFunctions.R @@ -37,11 +37,11 @@ sampleSize_pairwise <- function(data, type = c( "pairwise_average","maximum","mi misMatrix <- t(xmat) %*% xmat if (type == "pairwise_maximum"){ - sampleSize <- max(misMatrix) + sampleSize <- max(misMatrix[lower.tri(misMatrix)]) } else if (type == "pairwise_minimum"){ - sampleSize <- min(misMatrix) + sampleSize <- min(misMatrix[lower.tri(misMatrix)]) } else if (type == "pairwise_average"){ - sampleSize <- mean(misMatrix) + sampleSize <- mean(misMatrix[lower.tri(misMatrix)]) }