Skip to content

Commit 9daf026

Browse files
committed
Use a more conservative multiple testing correction in the EgoStat test.
fixes #83
1 parent 23b7fe8 commit 9daf026

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/testthat/test-EgoStat.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ test_that("scaling and nonscaling egostats are combined correctly", {
120120
test_that("egostats with alter missing data are close to complete network stats", {
121121

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

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

0 commit comments

Comments
 (0)