Skip to content

Commit

Permalink
Merge pull request #28 from Merck/ported-patch
Browse files Browse the repository at this point in the history
Port essential upstream changes in gMCP 0.8-16
  • Loading branch information
nanxstats authored Jan 11, 2024
2 parents f87fd75 + 29e89d9 commit ecde8c0
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 15 deletions.
6 changes: 3 additions & 3 deletions R/exampleGraphs.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#' Bretz, F., Maurer, W., Brannath, W., Posch, M.: A graphical approach to
#' sequentially rejective multiple test procedures. Statistics in Medicine 2009
#' vol. 28 issue 4 page 586-604.
#' \url{http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' \url{https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#'
#' Bretz, F., Maurer, W. and Hommel, G. (2011), Test and power considerations
#' for multiple endpoint analyses using sequentially rejective graphical
Expand Down Expand Up @@ -448,7 +448,7 @@ improvedParallelGatekeeping <- function() {
edgeAttr(graph, "H4", "H2", "labelY") <- 200
attr(graph, "description") <- paste("Graph representing an improved parallel gatekeeping procedure",
"",
"Literature: Bretz, F., Maurer, W., Brannath, W., Posch, M.: A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine 2009 vol. 28 issue 4 page 586-604. URL: http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf .", sep="\n")
"Literature: Bretz, F., Maurer, W., Brannath, W., Posch, M.: A graphical approach to sequentially rejective multiple test procedures. Statistics in Medicine 2009 vol. 28 issue 4 page 586-604. URL: https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf .", sep="\n")
return(graph)
}

Expand Down Expand Up @@ -1022,7 +1022,7 @@ WangTing2014 <- function(nu, tau) {
"with \\nu=\\epsilon, \\tau=\\epsilon graph from figure 5.",
"",
"Literature: Wang, B., Ting, N. (2014). An Application of Graphical Approach to Construct Multiple Testing Procedures in a Hypothetical Phase III Design. Frontiers in public health, 1 (75).",
"URL: http://journal.frontiersin.org/Journal/10.3389/fpubh.2013.00075/full", sep="\n")
"URL: https://www.frontiersin.org/articles/10.3389/fpubh.2013.00075/full", sep="\n")

variables <- list()
if (!missing(nu)) variables[["nu"]] <- nu
Expand Down
5 changes: 3 additions & 2 deletions R/gMCP.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@
#' @references Frank Bretz, Willi Maurer, Werner Brannath, Martin Posch: A
#' graphical approach to sequentially rejective multiple test procedures.
#' Statistics in Medicine 2009 vol. 28 issue 4 page 586-604.
#' \url{http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' \url{https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#'
#' Bretz F., Posch M., Glimm E., Klinglmueller F., Maurer W., Rohmeyer K.
#' (2011): Graphical approaches for multiple endpoint problems using weighted
#' Bonferroni, Simes or parametric tests. Biometrical Journal 53 (6),
#' pages 894-913, Wiley.
#' \doi{10.1002/bimj.201000239}
#'
#' Strassburger K., Bretz F.: Compatible simultaneous lower confidence bounds
#' for the Holm procedure and other Bonferroni based closed tests. Statistics
Expand Down Expand Up @@ -437,7 +438,7 @@ adjPValues <- function(graph, pvalues, upscale=FALSE, verbose=FALSE) {
#' @references Frank Bretz, Willi Maurer, Werner Brannath, Martin Posch: A
#' graphical approach to sequentially rejective multiple test procedures.
#' Statistics in Medicine 2009 vol. 28 issue 4 page 586-604.
#' \url{http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' \url{https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' @keywords htest graphs
#'
#' @export rejectNode
Expand Down
4 changes: 3 additions & 1 deletion R/gMCP.extended.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ bonferroni.test <- function(pvalues, weights, alpha=0.05, adjPValues=TRUE, verbo
#' (2011): Graphical approaches for multiple endpoint problems using weighted
#' Bonferroni, Simes or parametric tests. Biometrical Journal 53 (6),
#' pages 894-913, Wiley.
#' \doi{10.1002/bimj.201000239}
#'
#' @export
parametric.test <- function(pvalues, weights, alpha=0.05, adjPValues=TRUE, verbose=FALSE, correlation, ...) {
Expand Down Expand Up @@ -361,12 +362,13 @@ simes.test <- function(pvalues, weights, alpha=0.05, adjPValues=TRUE, verbose=FA
#' @references Frank Bretz, Willi Maurer, Werner Brannath, Martin Posch: A
#' graphical approach to sequentially rejective multiple test procedures.
#' Statistics in Medicine 2009 vol. 28 issue 4 page 586-604.
#' \url{http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' \url{https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#'
#' Bretz F., Posch M., Glimm E., Klinglmueller F., Maurer W., Rohmeyer K.
#' (2011): Graphical approaches for multiple endpoint problems using weighted
#' Bonferroni, Simes or parametric tests. Biometrical Journal 53 (6),
#' pages 894-913, Wiley.
#' \doi{10.1002/bimj.201000239}
#'
#' Strassburger K., Bretz F.: Compatible simultaneous lower confidence bounds
#' for the Holm procedure and other Bonferroni based closed tests. Statistics
Expand Down
8 changes: 4 additions & 4 deletions R/graphMCP.R
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ getWeightStr <- function(graph, from, to, LaTeX=FALSE) {
return(getLaTeXFraction(weight))
} else {
asNr <- try(eval(parse(text=weight), envir=NULL, enclos=NULL), silent=TRUE)
if (!is.na(asNr) && !("try-error"%in%class(asNr))) {
if (!is.na(asNr) && !(inherits(asNr, "try-error"))) {
return(getLaTeXFraction(asNr))
}
}
Expand Down Expand Up @@ -514,7 +514,7 @@ setMethod("plot", "graphMCP",
#' @references Frank Bretz, Willi Maurer, Werner Brannath, Martin Posch: A
#' graphical approach to sequentially rejective multiple test procedures.
#' Statistics in Medicine 2009 vol. 28 issue 4 page 586-604.
#' \url{http://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#' \url{https://www.meduniwien.ac.at/fwf_adaptive/papers/bretz_2009_22.pdf}
#'
#' @keywords htest graphs
#'
Expand Down Expand Up @@ -568,12 +568,12 @@ setMethod("simConfint", c("graphMCP"), function(object, pvalues, confint, altern
if (alternative=="greater") {
stderr <- abs(estimates/dist(1-pvalues))
lb <- estimates+dist(alpha)*stderr
lb <- ifelse(getRejected(result), max(0,lb), lb)
lb <- ifelse(getRejected(result), pmax(mu, lb), lb)
ub <- rep(Inf,length(lb))
} else if (alternative=="less") {
stderr <- abs(estimates/dist(pvalues))
ub <- estimates+dist(1-alpha)*stderr
ub <- ifelse(getRejected(result), min(0,ub), ub)
ub <- ifelse(getRejected(result), pmin(mu, ub), ub)
lb <- rep(-Inf,length(ub))
} else {
stop("Specify alternative as \"less\" or \"greater\".")
Expand Down
2 changes: 1 addition & 1 deletion man/exampleGraphs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/gMCP.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/gMCP.extended.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/parametric.test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/rejectNode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/simConfint.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ecde8c0

Please sign in to comment.