Skip to content

Commit 790e830

Browse files
authored
Merge pull request #93 from openpharma/90-bug-graph_test_closure-provides-inconsistent-results-between-rejections-and-closed-tests
90 bug graph test closure provides inconsistent results between rejections and closed tests
2 parents f39d02c + 89e4d4d commit 790e830

9 files changed

Lines changed: 39 additions & 17 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ inst/doc
1212
*~$*docx
1313
*~$*xlsx
1414
*~$*pptx
15+
Rplots.pdf
16+
.DS_Store

CRAN-SUBMISSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 0.2.8
1+
Version: 0.2.9
22
Date: 2025-05-07 03:10:43 UTC
33
SHA: 86213d2cf7bf8a29ac608260f2fd935e7fc2fd7d

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: graphicalMCP
33
Title: Graphical Multiple Comparison Procedures
4-
Version: 0.2.8
4+
Version: 0.2.9
55
Authors@R: c(
66
person("Dong", "Xi", , "dong.xi1@gilead.com", role = c("aut", "cre")),
77
person("Ethan", "Brockmann", , "ethan.brockmann@atorusresearch.com", role = "aut"),
@@ -48,5 +48,5 @@ Config/testthat/edition: 3
4848
Encoding: UTF-8
4949
LazyData: true
5050
Roxygen: list(markdown = TRUE)
51-
RoxygenNote: 7.3.2
51+
RoxygenNote: 7.3.3
5252
Language: en-US

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,8 @@
5959

6060
* Corrected urls for references
6161
* Submission for CRAN release
62+
63+
# graphicalMCP 0.2.9
64+
65+
* Closed Issue #90 by changing the precision for parametric tests
66+
* Submission for CRAN release

R/graph_test_closure.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,19 @@ graph_test_closure <- function(graph,
306306
# The adjusted p-value for an *intersection* is the smallest adjusted p-value
307307
# for the groups it contains
308308
adjusted_p_intersection <- apply(adjusted_p, 1, min)
309-
reject_intersection <-
310-
adjusted_p_intersection <= (alpha + .Machine$double.eps)
309+
310+
# When parametric tests are used, mvtnorm::pmvnorm introduces Monte Carlo
311+
# error (controlled by abseps, default 1e-6). A small tolerance is added to
312+
# rejection comparisons to avoid false non-rejections at the boundary.
313+
tol <- if (any(test_types == "parametric")) 1e-6 else .Machine$double.eps
314+
315+
reject_intersection <- adjusted_p_intersection <= (alpha + tol)
311316

312317
# The adjusted p-value for a *hypothesis* is the largest adjusted p-value for
313318
# the intersections containing that hypothesis
314319
adjusted_p_hypothesis <-
315320
apply(adjusted_p_intersection * matrix_intersections, 2, max, na.rm = TRUE)
316-
reject_hypothesis <- adjusted_p_hypothesis <= alpha # Hypothesis test results
321+
reject_hypothesis <- adjusted_p_hypothesis <= (alpha + tol)
317322

318323
# Adjusted p-value details ---------------------------------------------------
319324
# Reported adjusted p-values shouldn't exceed 1

codemeta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"codeRepository": "https://github.com/openpharma/graphicalMCP",
88
"issueTracker": "https://github.com/openpharma/graphicalMCP/issues",
99
"license": "Apache License 2",
10-
"version": "0.2.8",
10+
"version": "0.2.9",
1111
"programmingLanguage": {
1212
"@type": "ComputerLanguage",
1313
"name": "R",
1414
"url": "https://r-project.org"
1515
},
16-
"runtimePlatform": "R version 4.1.2 (2021-11-01)",
16+
"runtimePlatform": "R version 4.4.3 (2025-02-28)",
1717
"provider": {
1818
"@id": "https://cran.r-project.org",
1919
"@type": "Organization",
@@ -318,7 +318,7 @@
318318
},
319319
"SystemRequirements": null
320320
},
321-
"fileSize": "803.544KB",
321+
"fileSize": "775.434KB",
322322
"citation": [
323323
{
324324
"@type": "SoftwareSourceCode",
@@ -339,7 +339,7 @@
339339
"url": "https://CRAN.R-project.org/package=graphicalMCP"
340340
}
341341
],
342-
"releaseNotes": "https://github.com/openpharma/graphicalMCP/blob/master/NEWS.md",
342+
"releaseNotes": "https://github.com/openpharma/graphicalMCP/blob/main/NEWS.md",
343343
"readme": "https://github.com/openpharma/graphicalMCP/blob/main/README.md",
344344
"developmentStatus": "https://www.repostatus.org/#active",
345345
"relatedLink": "https://CRAN.R-project.org/package=graphicalMCP"

cran-comments.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Version 0.2.9
2+
3+
- This is the ninth submission to CRAN.
4+
- Closed Issue #90 by changing the precision for parametric tests
5+
6+
## R CMD check results
7+
8+
0 errors | 0 warnings | 0 notes
9+
110
# Version 0.2.8
211

312
- This is the eighth submission to CRAN.

tests/testthat/Rplots.pdf

-8.88 KB
Binary file not shown.

vignettes/generate-closure.Rmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,14 @@ write.csv(
271271

272272
```{r power-conventional, include = FALSE, eval = FALSE}
273273
gcp_conventional <- function(
274-
graph,
275-
alpha = 0.025,
276-
power_marginal = rep(alpha, length(graph$hypotheses)),
277-
sim_n = 100,
278-
sim_corr = diag(length(graph$hypotheses)),
279-
sim_success = NULL,
280-
verbose = FALSE) {
274+
graph,
275+
alpha = 0.025,
276+
power_marginal = rep(alpha, length(graph$hypotheses)),
277+
sim_n = 100,
278+
sim_corr = diag(length(graph$hypotheses)),
279+
sim_success = NULL,
280+
verbose = FALSE
281+
) {
281282
hyp_names <- names(graph$hypotheses)
282283
num_hyps <- length(graph$hypotheses)
283284

0 commit comments

Comments
 (0)