From 7e226f3341bec922426f4d79742e6fdb817a6eac Mon Sep 17 00:00:00 2001 From: "Michael G. Campana" Date: Thu, 16 May 2024 07:53:56 -0400 Subject: [PATCH] StdErr bug fix Std Err for bootstrap does not divided by sqrt of resample number --- kinshipUtils.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kinshipUtils.R b/kinshipUtils.R index 1d4319e..8de411a 100644 --- a/kinshipUtils.R +++ b/kinshipUtils.R @@ -1,6 +1,6 @@ #---------------------------------------------------------------------------------- # kinshipUtils -# Michael G. Campana, 2018 +# Michael G. Campana, 2018-2024 # Smithsonian Conservation Biology Institute #---------------------------------------------------------------------------------- @@ -26,7 +26,6 @@ bootstrap.kinship <- function(gdsobj, ibdmethod = c("MoM", "MLE"), sample.id = N } res <- cbind(res, rowMeans(res[,3:resample+2])) sterrs <- apply(res[3:(i+2)], 1, sd) - sterrs <- sterrs/sqrt(resample) res <- cbind(res, sterrs) res <- cbind(res, res[i+3] - 1.96 * res[i+4], res[i+3] + 1.96 * res[i+4]) colnames(res)[i+3] <- "MeanKinship"