Skip to content

Commit

Permalink
Use a more conservative multiple testing correction in the EgoStat test.
Browse files Browse the repository at this point in the history
fixes #83
  • Loading branch information
krivit committed Oct 10, 2024
1 parent 23b7fe8 commit 9daf026
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/testthat/test-EgoStat.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test_that("scaling and nonscaling egostats are combined correctly", {
test_that("egostats with alter missing data are close to complete network stats", {

# Test data
set.seed(1)
set.seed(0)
n <- 100
e <- 150
ds <- c(10,15,5,20)
Expand Down Expand Up @@ -201,9 +201,7 @@ test_that("egostats with alter missing data are close to complete network stats"

# Varying
pvals <- sapply(apply(d[!novar,], 1, t.test), "[[", "p.value")
pval <- pchisq(-2*sum(log(pvals)), 2*sum(!novar), lower.tail=FALSE)
expect_true(
pval > 0.001, # Not very safe, since this test is stochastic.
info = paste("Varying missing alter data estimate is off, p-value =", pval)
)
hmp <- 1/mean(1/pvals)
expect_gt(hmp, 0.0091) # alpha = 0.01, L = 73 critical value for the Harmonic Mean P-value
})

0 comments on commit 9daf026

Please sign in to comment.