diff --git a/.gitignore b/.gitignore index a18da5b..7d133ee 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ inst/doc *~$*docx *~$*xlsx *~$*pptx +Rplots.pdf +.DS_Store diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 6bb573f..7347c74 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 0.2.8 +Version: 0.2.9 Date: 2025-05-07 03:10:43 UTC SHA: 86213d2cf7bf8a29ac608260f2fd935e7fc2fd7d diff --git a/DESCRIPTION b/DESCRIPTION index 3ebc6ab..ba31978 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: graphicalMCP Title: Graphical Multiple Comparison Procedures -Version: 0.2.8 +Version: 0.2.9 Authors@R: c( person("Dong", "Xi", , "dong.xi1@gilead.com", role = c("aut", "cre")), person("Ethan", "Brockmann", , "ethan.brockmann@atorusresearch.com", role = "aut"), @@ -48,5 +48,5 @@ Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 Language: en-US diff --git a/NEWS.md b/NEWS.md index 031f2da..2e2d7d2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -59,3 +59,8 @@ * Corrected urls for references * Submission for CRAN release + +# graphicalMCP 0.2.9 + +* Closed Issue #90 by changing the precision for parametric tests +* Submission for CRAN release \ No newline at end of file diff --git a/R/graph_test_closure.R b/R/graph_test_closure.R index ba59b8f..c8cb1b5 100644 --- a/R/graph_test_closure.R +++ b/R/graph_test_closure.R @@ -306,14 +306,19 @@ graph_test_closure <- function(graph, # The adjusted p-value for an *intersection* is the smallest adjusted p-value # for the groups it contains adjusted_p_intersection <- apply(adjusted_p, 1, min) - reject_intersection <- - adjusted_p_intersection <= (alpha + .Machine$double.eps) + + # When parametric tests are used, mvtnorm::pmvnorm introduces Monte Carlo + # error (controlled by abseps, default 1e-6). A small tolerance is added to + # rejection comparisons to avoid false non-rejections at the boundary. + tol <- if (any(test_types == "parametric")) 1e-6 else .Machine$double.eps + + reject_intersection <- adjusted_p_intersection <= (alpha + tol) # The adjusted p-value for a *hypothesis* is the largest adjusted p-value for # the intersections containing that hypothesis adjusted_p_hypothesis <- apply(adjusted_p_intersection * matrix_intersections, 2, max, na.rm = TRUE) - reject_hypothesis <- adjusted_p_hypothesis <= alpha # Hypothesis test results + reject_hypothesis <- adjusted_p_hypothesis <= (alpha + tol) # Adjusted p-value details --------------------------------------------------- # Reported adjusted p-values shouldn't exceed 1 diff --git a/codemeta.json b/codemeta.json index 594ff23..b9e1274 100644 --- a/codemeta.json +++ b/codemeta.json @@ -7,13 +7,13 @@ "codeRepository": "https://github.com/openpharma/graphicalMCP", "issueTracker": "https://github.com/openpharma/graphicalMCP/issues", "license": "Apache License 2", - "version": "0.2.8", + "version": "0.2.9", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.1.2 (2021-11-01)", + "runtimePlatform": "R version 4.4.3 (2025-02-28)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -318,7 +318,7 @@ }, "SystemRequirements": null }, - "fileSize": "803.544KB", + "fileSize": "775.434KB", "citation": [ { "@type": "SoftwareSourceCode", @@ -339,7 +339,7 @@ "url": "https://CRAN.R-project.org/package=graphicalMCP" } ], - "releaseNotes": "https://github.com/openpharma/graphicalMCP/blob/master/NEWS.md", + "releaseNotes": "https://github.com/openpharma/graphicalMCP/blob/main/NEWS.md", "readme": "https://github.com/openpharma/graphicalMCP/blob/main/README.md", "developmentStatus": "https://www.repostatus.org/#active", "relatedLink": "https://CRAN.R-project.org/package=graphicalMCP" diff --git a/cran-comments.md b/cran-comments.md index 2c20cdd..e6f1192 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,12 @@ +# Version 0.2.9 + +- This is the ninth submission to CRAN. +- Closed Issue #90 by changing the precision for parametric tests + +## R CMD check results + +0 errors | 0 warnings | 0 notes + # Version 0.2.8 - This is the eighth submission to CRAN. diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf deleted file mode 100644 index adba4e3..0000000 Binary files a/tests/testthat/Rplots.pdf and /dev/null differ diff --git a/vignettes/generate-closure.Rmd b/vignettes/generate-closure.Rmd index 8b4e151..bb3d6ec 100644 --- a/vignettes/generate-closure.Rmd +++ b/vignettes/generate-closure.Rmd @@ -271,13 +271,14 @@ write.csv( ```{r power-conventional, include = FALSE, eval = FALSE} gcp_conventional <- function( - graph, - alpha = 0.025, - power_marginal = rep(alpha, length(graph$hypotheses)), - sim_n = 100, - sim_corr = diag(length(graph$hypotheses)), - sim_success = NULL, - verbose = FALSE) { + graph, + alpha = 0.025, + power_marginal = rep(alpha, length(graph$hypotheses)), + sim_n = 100, + sim_corr = diag(length(graph$hypotheses)), + sim_success = NULL, + verbose = FALSE +) { hyp_names <- names(graph$hypotheses) num_hyps <- length(graph$hypotheses)