Skip to content

Commit

Permalink
StdErr bug fix
Browse files Browse the repository at this point in the history
Std Err for bootstrap does not divided by sqrt of resample number
  • Loading branch information
campanam authored May 16, 2024
1 parent ca33b20 commit 7e226f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kinshipUtils.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#----------------------------------------------------------------------------------
# kinshipUtils
# Michael G. Campana, 2018
# Michael G. Campana, 2018-2024
# Smithsonian Conservation Biology Institute
#----------------------------------------------------------------------------------

Expand All @@ -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"
Expand Down

0 comments on commit 7e226f3

Please sign in to comment.