diff --git a/404.html b/404.html index c98e7f9..663470b 100644 --- a/404.html +++ b/404.html @@ -31,7 +31,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/LICENSE.html b/LICENSE.html index f65d9a0..1e4fb64 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/closed-testing.html b/articles/closed-testing.html index e6feb8a..2e816b2 100644 --- a/articles/closed-testing.html +++ b/articles/closed-testing.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/comparisons.html b/articles/comparisons.html index e42f5b6..85def62 100644 --- a/articles/comparisons.html +++ b/articles/comparisons.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/generate-closure.html b/articles/generate-closure.html index 012d34f..d119be0 100644 --- a/articles/generate-closure.html +++ b/articles/generate-closure.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/glossary.html b/articles/glossary.html index 77fc06e..e9110fb 100644 --- a/articles/glossary.html +++ b/articles/glossary.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/graph-examples.html b/articles/graph-examples.html index 3e6cef2..28995e5 100644 --- a/articles/graph-examples.html +++ b/articles/graph-examples.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/graphicalMCP.html b/articles/graphicalMCP.html index 7e001bd..63ccd96 100644 --- a/articles/graphicalMCP.html +++ b/articles/graphicalMCP.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/index.html b/articles/index.html index 7df8e5c..0bf5fe0 100644 --- a/articles/index.html +++ b/articles/index.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/articles/shortcut-testing.html b/articles/shortcut-testing.html index 3a17c04..fea9250 100644 --- a/articles/shortcut-testing.html +++ b/articles/shortcut-testing.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/authors.html b/authors.html index cd6a3ba..d7338bd 100644 --- a/authors.html +++ b/authors.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 @@ -83,13 +83,13 @@ Citation Source: inst/CITATION Xi D, Brockmann E (2024). -graphicalMCP: Graphical multiple comparison procedures, version 0.2.2 edition. +graphicalMCP: Graphical multiple comparison procedures, version 0.2.3 edition. https://github.com/Gilead-BioStats/graphicalMCP. @Manual{, title = {{graphicalMCP}: Graphical multiple comparison procedures}, author = {Dong Xi and Ethan Brockmann}, - edition = {version 0.2.2}, + edition = {version 0.2.3}, year = {2024}, url = {https://github.com/Gilead-BioStats/graphicalMCP}, } diff --git a/index.html b/index.html index 3db2394..51443e7 100644 --- a/index.html +++ b/index.html @@ -33,7 +33,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/news/index.html b/news/index.html index 4b7bac4..35657ae 100644 --- a/news/index.html +++ b/news/index.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 @@ -90,6 +90,11 @@ graphicalMCP graphicalMCP 0.2.2 Updated citations Resubmission for first CRAN release + + +graphicalMCP 0.2.3 +Included cran-comments.ms in .Rbuildignore +Resubmission for first CRAN release diff --git a/pkgdown.yml b/pkgdown.yml index 9910bab..7d26228 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -9,7 +9,7 @@ articles: graph-examples: graph-examples.html graphicalMCP: graphicalMCP.html shortcut-testing: shortcut-testing.html -last_built: 2024-07-02T16:19Z +last_built: 2024-07-03T14:21Z urls: reference: https://gilead-biostats.github.io/graphicalMCP/reference article: https://gilead-biostats.github.io/graphicalMCP/articles diff --git a/reference/adjust_p.html b/reference/adjust_p.html index 0afbe3c..d50df78 100644 --- a/reference/adjust_p.html +++ b/reference/adjust_p.html @@ -32,7 +32,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/adjust_weights.html b/reference/adjust_weights.html index 9c1d3e4..1ee7759 100644 --- a/reference/adjust_weights.html +++ b/reference/adjust_weights.html @@ -30,7 +30,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/as_graph.html b/reference/as_graph.html index ff2c72d..256330d 100644 --- a/reference/as_graph.html +++ b/reference/as_graph.html @@ -22,7 +22,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/edge_pairs.html b/reference/edge_pairs.html index 17d9293..45845f5 100644 --- a/reference/edge_pairs.html +++ b/reference/edge_pairs.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/example_graphs.html b/reference/example_graphs.html index a9292fe..b9235b4 100644 --- a/reference/example_graphs.html +++ b/reference/example_graphs.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_calculate_power.html b/reference/graph_calculate_power.html index 77faedb..7593445 100644 --- a/reference/graph_calculate_power.html +++ b/reference/graph_calculate_power.html @@ -26,7 +26,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_create.html b/reference/graph_create.html index 1336474..ab061db 100644 --- a/reference/graph_create.html +++ b/reference/graph_create.html @@ -16,7 +16,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_generate_weights.html b/reference/graph_generate_weights.html index 9143fe3..befa830 100644 --- a/reference/graph_generate_weights.html +++ b/reference/graph_generate_weights.html @@ -34,7 +34,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_rejection_orderings.html b/reference/graph_rejection_orderings.html index 7e74177..d1518df 100644 --- a/reference/graph_rejection_orderings.html +++ b/reference/graph_rejection_orderings.html @@ -26,7 +26,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_test_closure.html b/reference/graph_test_closure.html index 5e94cba..bd5e51c 100644 --- a/reference/graph_test_closure.html +++ b/reference/graph_test_closure.html @@ -36,7 +36,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_test_fast.html b/reference/graph_test_fast.html index c0796e6..b562135 100644 --- a/reference/graph_test_fast.html +++ b/reference/graph_test_fast.html @@ -16,7 +16,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_test_shortcut.html b/reference/graph_test_shortcut.html index 3fa2adf..15930b2 100644 --- a/reference/graph_test_shortcut.html +++ b/reference/graph_test_shortcut.html @@ -22,7 +22,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graph_update.html b/reference/graph_update.html index 5075536..d003445 100644 --- a/reference/graph_update.html +++ b/reference/graph_update.html @@ -16,7 +16,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/graphicalMCP-package.html b/reference/graphicalMCP-package.html index f3850a9..baf92a0 100644 --- a/reference/graphicalMCP-package.html +++ b/reference/graphicalMCP-package.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/index.html b/reference/index.html index addbc9b..3954143 100644 --- a/reference/index.html +++ b/reference/index.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/input_val.html b/reference/input_val.html index 2ce4e61..e2b2b91 100644 --- a/reference/input_val.html +++ b/reference/input_val.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/plot.initial_graph.html b/reference/plot.initial_graph.html index e4cd827..db627e1 100644 --- a/reference/plot.initial_graph.html +++ b/reference/plot.initial_graph.html @@ -18,7 +18,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/plot.updated_graph.html b/reference/plot.updated_graph.html index 2dbbd23..2ee8959 100644 --- a/reference/plot.updated_graph.html +++ b/reference/plot.updated_graph.html @@ -14,7 +14,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/print.graph_report.html b/reference/print.graph_report.html index d57117a..33e904c 100644 --- a/reference/print.graph_report.html +++ b/reference/print.graph_report.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/print.initial_graph.html b/reference/print.initial_graph.html index ba76df5..04630e1 100644 --- a/reference/print.initial_graph.html +++ b/reference/print.initial_graph.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/print.power_report.html b/reference/print.power_report.html index 6f82daf..3e5ac83 100644 --- a/reference/print.power_report.html +++ b/reference/print.power_report.html @@ -12,7 +12,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/print.updated_graph.html b/reference/print.updated_graph.html index b6129f9..543a886 100644 --- a/reference/print.updated_graph.html +++ b/reference/print.updated_graph.html @@ -14,7 +14,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/reference/test_values.html b/reference/test_values.html index 9b09263..5d2269d 100644 --- a/reference/test_values.html +++ b/reference/test_values.html @@ -10,7 +10,7 @@ graphicalMCP - 0.2.2 + 0.2.3 diff --git a/search.json b/search.json index 4eb5dd3..7f07d09 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright 2023 Gilead Sciences Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Graphical multiple comparison procedures based on the closure principle","text":"Consider confirmatory clinical trial comparing test treatment (treatment) control treatment (control) disease. two doses treatment: low dose high dose. three endpoints included multiplicity adjustment strategy, primary endpoint (PE) two secondary endpoints (SE1 SE2). total, six null hypotheses: \\(H_1\\), \\(H_3\\) \\(H_5\\) primary hypothesis two secondary hypotheses respectively low dose versus control; \\(H_2\\), \\(H_4\\) \\(H_6\\) primary hypothesis two secondary hypotheses respectively high dose versus control. clinical considerations constrain structure multiple comparison procedures, can flexibly incorporated using graphical approaches. First, low high doses considered equally important, means rejecting primary hypothesis either dose versus control leads successful trial. Regarding secondary hypotheses, one tested corresponding primary hypothesis rejected. means \\(H_3\\) \\(H_5\\) tested \\(H_1\\) rejected; \\(H_4\\) \\(H_6\\) tested \\(H_2\\) rejected. addition, statistical considerations complete graph. primary hypotheses \\(H_1\\) \\(H_2\\) equal hypothesis weight 0.5. secondary hypotheses hypothesis weight 0. primary hypothesis rejected, weight propagate along three outgoing edges: one primary hypothesis two descendant secondary hypotheses. edge primary hypothesis transition weight 0.5; two edges descendant secondary hypotheses equal transition weight 0.25. secondary hypotheses dose-control comparison, edge transition weight 1 (close 1 allow \\(\\epsilon\\) edges). hypothesis weights dose-control comparison group propagated primary hypothesis dose-control comparison, hypotheses first dose-control comparison group deleted. specifications, can create following graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"create-a-graph","dir":"Articles","previous_headings":"Motivating example","what":"Create a graph","title":"Graphical multiple comparison procedures based on the closure principle","text":"","code":"hypotheses <- c(0.5, 0.5, 0, 0, 0, 0) epsilon <- 1e-5 transitions <- rbind( c(0, 0.5, 0.25, 0, 0.25, 0), c(0.5, 0, 0, 0.25, 0, 0.25), c(0, 0, 0, 0, 1, 0), c(epsilon, 0, 0, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0, 0, 0), c(0, 0, 0, 1, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\") g <- graph_create(hypotheses, transitions, hyp_names) plot_layout <- rbind( c(0.15, 0.5), c(0.65, 0.5), c(0, 0), c(0.5, 0), c(0.3, 0), c(0.8, 0) ) plot( g, layout = plot_layout, eps = epsilon, edge_curves = c(pairs = 0.8), vertex.size = 35 )"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"bonferroni-tests","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Bonferroni tests","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given set p-values \\(H_1, \\ldots, H_6\\), graphical multiple comparison procedure can performed control family-wise error rate (FWER) significance level alpha. one-sided p-values, alpha often set 0.025 (default). First, perform Bonferroni-based procedure using closure principle (Bretz et al. 2009). running procedure, none hypotheses rejected. results identical using graph_test_shortcut().","code":"p_values <- c(0.015, 0.013, 0.01, 0.007, 0.1, 0.0124) test_results <- graph_test_closure( g, p = p_values, alpha = 0.025, verbose = TRUE, test_values = TRUE ) test_results$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.026 0.026 0.028 0.028 0.100 0.028 test_results$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> FALSE FALSE FALSE FALSE FALSE FALSE # Same testing results as # 'graph_test_shortcut(g, p = p_values, alpha = 0.025)$outputs$rejected'"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"obtain-the-closure","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Bonferroni tests","what":"Obtain the closure","title":"Graphical multiple comparison procedures based on the closure principle","text":"investigate closure every intersection hypothesis rejected, one obtain detailed output specifying verbose = TRUE. hypotheses tested using Bonferroni tests, adjusted p-value every intersection hypothesis adjusted p-value group 1 (meaning hypotheses group Bonferroni tests). intersection hypothesis rejected adjusted p-value less equal alpha. Adjusted p-values initially calculated groups hypotheses. case one group, includes hypotheses, can . adjusted p-value intersection hypothesis minimum across groups within intersection. Finally, adjusted p-value individual hypothesis whole procedure equal maximum adjusted p-values across intersections involving hypothesis.","code":"test_results_verbose <- graph_test_closure( g, p = p_values, alpha = 0.025, verbose = TRUE ) head(test_results_verbose$details$results) #> Intersection H1 H2 H3 H4 H5 H6 adj_p_grp1 adj_p_inter reject_intersection #> 1 111111 0.5 0.5 0 0 0 0 0.026 0.026 FALSE #> 2 111110 0.5 0.5 0 0 0 NA 0.026 0.026 FALSE #> 3 111101 0.5 0.5 0 0 NA 0 0.026 0.026 FALSE #> 4 111100 0.5 0.5 0 0 NA NA 0.026 0.026 FALSE #> 5 111011 0.5 0.5 0 NA 0 0 0.026 0.026 FALSE #> 6 111010 0.5 0.5 0 NA 0 NA 0.026 0.026 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"obtain-adjusted-significance-levels","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Bonferroni tests","what":"Obtain adjusted significance levels","title":"Graphical multiple comparison procedures based on the closure principle","text":"equivalent way obtain rejections via adjusting significance levels. hypothesis rejected p-value less equal adjusted significance level. One can obtain adjusted significance levels every hypothesis every intersection hypothesis closure specifying test_values = TRUE. hypothesis rejected closed testing procedure intersection hypotheses involving rejected. intersection hypothesis rejected null hypotheses within rejected.","code":"test_results_test_values <- graph_test_closure( g, test_types = \"b\", p = p_values, alpha = 0.025, test_values = TRUE ) head(test_results_test_values$test_values$results) #> Intersection Hypothesis Test p Weight Alpha Inequality_holds #> 1 111111 H1 bonferroni 0.0150 0.5 0.025 FALSE #> 2 111111 H2 bonferroni 0.0130 0.5 0.025 FALSE #> 3 111111 H3 bonferroni 0.0100 0.0 0.025 FALSE #> 4 111111 H4 bonferroni 0.0070 0.0 0.025 FALSE #> 5 111111 H5 bonferroni 0.1000 0.0 0.025 FALSE #> 6 111111 H6 bonferroni 0.0124 0.0 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"mixed-procedures-for-graphical-approaches","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Mixed procedures for graphical approaches","title":"Graphical multiple comparison procedures based on the closure principle","text":"framework graphicalMCP allows mixture tests improve performance Bonferroni-based graphical approaches. can group hypotheses multiple subgroups perform separate test every subgroup. Currently, graphicalMCP supports Bonferroni, parametric Simes tests. connect results different subgroups hypotheses, Bonferroni tests used. , show two examples. first example applies parametric tests primary hypotheses (Xi et al. 2017), second example applies Simes tests two subgroups secondary hypotheses addition parametric tests primary hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"parametric-tests-for-primary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Mixed procedures for graphical approaches","what":"Parametric tests for primary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"example, assume test statistics primary hypotheses follow asymptotic bivariate normal distribution. null hypotheses \\(H_1\\) \\(H_2\\), mean distribution 0. correlation test statistics \\(H_1\\) \\(H_2\\) can calculated function sample size. Assume sample size control, low high doses \\(n_0\\), \\(n_1\\) \\(n_2\\), respectively. correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_2+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. intersection hypothesis \\(H_1\\cap H_2\\cap H_3\\cap H_4\\cap H_5\\cap H_6\\), hypothesis weights 0.5, 0.5, 0, 0, 0, 0, respectively \\(H_1,\\ldots, H_6\\). Assume one-sided p-values hypotheses \\(p_1,\\ldots,p_6\\), respectively. intersection hypothesis rejected Bonferroni test \\(p_1\\leq 0.5\\alpha\\) \\(p_2\\leq 0.5\\alpha\\). Alternatively, parametric test utilizes correlation test statistics \\(t_1=\\Phi^{-1}(1 - p_1)\\) \\(t_2=\\Phi^{-1}(1 - p_2)\\). intersection hypothesis can rejected \\(p_1\\leq c\\times 0.5\\alpha\\) \\(p_2\\leq c\\times 0.5\\alpha\\), \\(c\\) value adjustment due correlation \\(t_1\\) \\(t_2\\). specifically, \\(c\\) can solved solution \\(Pr\\{(p_1\\leq c\\times 0.5\\alpha)\\cup (p_2\\leq c\\times 0.5\\alpha)\\}=\\alpha\\). given correlation \\(\\rho_{12}\\), \\(c\\) value can solved using uniroot function mvtnorm package. example, \\(\\rho_{12}=0.5\\), \\(c\\) value 1.078. can obtain adjusted significance level \\(H_1\\) \\(H_2\\) \\(c\\times 0.5\\alpha\\). Alternatively, can calculate adjusted p-value \\(H_1\\cap H_2\\cap H_3\\cap H_4\\cap H_5\\cap H_6\\) \\(Pr\\{(P_1\\leq \\min{\\{p_1, p_2\\}})\\cup (P_2\\leq \\min{\\{p_1, p_2\\}})\\}\\). implement procedure, need create two subgroups: one \\(H_1\\) \\(H_2\\), one rest hypotheses. first subgroup hypotheses, apply parametric tests; second subgroup (subsets), apply Bonferroni tests. Three additional inputs needed: specify grouping information test_groups, identify types tests every subgroup test_types, provide correlation matrix parametric tests test_corr. Assume correlation 0.5 test statistics primary hypotheses. procedure rejects \\(H_1\\) \\(H_2\\), others. Compared Bonferroni-based graphical approach didn’t rejected hypothesis, illustrates power improvement using parametric tests Bonferroni tests.","code":"corr_12 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr_12) <- 1 test_results_parametric <- graph_test_closure( g, p = p_values, alpha = 0.025, test_groups = list(c(1, 2), 3:6), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(corr_12, NA), test_values = TRUE ) test_results_parametric$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.02413846 0.02413846 0.02800000 0.02800000 0.10000000 0.02800000 test_results_parametric$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> TRUE TRUE FALSE FALSE FALSE FALSE head(test_results_parametric$test_values$results) #> Intersection Hypothesis Test p c_value Weight Alpha #> 1 111111 H1 parametric 0.0150 1.0782936582 0.5 0.025 #> 2 111111 H2 parametric 0.0130 1.0782936582 0.5 0.025 #> 3 111111 H3 bonferroni 0.0100 0.0 0.025 #> 4 111111 H4 bonferroni 0.0070 0.0 0.025 #> 5 111111 H5 bonferroni 0.1000 0.0 0.025 #> 6 111111 H6 bonferroni 0.0124 0.0 0.025 #> Inequality_holds #> 1 FALSE #> 2 TRUE #> 3 FALSE #> 4 FALSE #> 5 FALSE #> 6 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"parametric-tests-for-primary-hypotheses-and-simes-tests-for-secondary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Mixed procedures for graphical approaches","what":"Parametric tests for primary hypotheses and Simes tests for secondary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"addition using parametric tests primary hypotheses, ways improve Bonferroni-based graphical approaches. One way apply Simes tests secondary hypotheses(Bretz et al. 2011; Lu 2016). Simes tests improve Bonferroni tests may reject intersection hypothesis p-values relatively small, even ’re larger adjusted significance levels Bonferroni tests. intersection hypothesis \\(H_3\\cap H_5\\), hypothesis weights 0.5 0.5, respectively \\(H_3\\) \\(H_5\\). intersection hypothesis rejected Bonferroni test \\(p_3\\leq 0.5\\alpha\\) \\(p_5\\leq 0.5\\alpha\\). addition conditions, Simes test can also reject intersection hypothesis \\(p_3\\) \\(p_5\\) less equal \\(\\alpha\\). order control Type error Simes test, distributional requirement needed, called \\(MTP_2\\) (Sarkar 1998). case, means correlation test statistics \\(H_3\\) \\(H_5\\) non-negative. illustrate possibility using mixed tests example, keep parametric tests primary hypotheses apply Simes tests secondary hypotheses. two sets secondary hypotheses: \\(H_3\\) \\(H_5\\) secondary hypotheses low dose versus control, \\(H_4\\) \\(H_6\\) secondary hypotheses high dose versus control. believed correlation test statistics \\(H_3\\) \\(H_5\\) non-negative case \\(H_4\\) \\(H_6\\). Thus one can apply Simes tests \\(H_3\\) \\(H_5\\), separately \\(H_4\\) \\(H_6\\). Note different applying Simes tests \\(H_3\\ldots,H_6\\) requires stronger \\(MTP_2\\) condition. implement procedure, create three subgroups: one \\(H_1\\) \\(H_2\\), one \\(H_3\\) \\(H_5\\), one \\(H_4\\) \\(H_6\\). first subgroup hypotheses, apply parametric tests; second third subgroups, apply separate Simes tests. Assume correlation 0.5 test statistics primary hypotheses. procedure rejects \\(H_1\\), \\(H_2\\), \\(H_4\\), \\(H_6\\), \\(H_3\\). Compared results using parametric tests primary hypotheses (Bonferroni tests secondary hypotheses), \\(H_3\\), \\(H_4\\) \\(H_6\\) additional hypotheses rejected using Simes tests, showing power improvement using Simes tests.","code":"test_results_parametric_simes <- graph_test_closure( g, p = p_values, alpha = 0.025, test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), test_values = TRUE ) test_results_parametric_simes$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.02413846 0.02413846 0.02480008 0.02480000 0.10000000 0.02480008 test_results_parametric_simes$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> TRUE TRUE TRUE TRUE FALSE TRUE head(test_results_parametric_simes$test_values$results) #> Intersection Hypothesis Test p c_value Weight Alpha #> 1 111111 H1 parametric 0.0150 1.0782936582 0.5 0.025 #> 2 111111 H2 parametric 0.0130 1.0782936582 0.5 0.025 #> 3 111111 H3 simes 0.0100 0.0 0.025 #> 4 111111 H5 simes 0.1000 0.0 0.025 #> 5 111111 H4 simes 0.0070 0.0 0.025 #> 6 111111 H6 simes 0.0124 0.0 0.025 #> Inequality_holds #> 1 FALSE #> 2 TRUE #> 3 FALSE #> 4 FALSE #> 5 FALSE #> 6 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"power-calculation","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Power calculation","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given graph, trial team often interested power trial. single null hypothesis, power probability reject null hypothesis significance level alpha alternative hypothesis true (.e. true positive). multiple null hypotheses, multiple version power. example, power reject least one hypothesis power reject hypotheses, given alternative hypotheses true. graphical multiple comparison procedures, also important understand power reject hypothesis, given multiplicity adjustment. Sometimes, team may want customize definitions power define success. Thus power calculation important aspect trial design.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-marginal-power-for-primary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Marginal power for primary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"Assume primary endpoint occurrence unfavorable clinical event. evaluate treatment effect, proportion patients event calculated lower better. Assume proportions 0.181 low high doses, 0.3 control. Using equal randomization among three treatment groups, clinical trial team chooses total sample size 600 200 per group. leads marginal power 80% \\(H_1\\) \\(H_2\\), respectively, using two-sample test difference proportions unpooled variance one-sided significance level 0.025. calculation, use marginal power combine information treatment effect, nuisance parameter, sample sizes hypothesis. Note significance level used marginal power alpha used power calculation significance level FWER control. addition, marginal power one--one relationship noncentrality parameter, illustrated .","code":"alpha <- 0.025 prop <- c(0.3, 0.181, 0.181) sample_size <- rep(200, 3) unpooled_variance <- prop[-1] * (1 - prop[-1]) / sample_size[-1] + prop[1] * (1 - prop[1]) / sample_size[1] noncentrality_parameter_primary <- -(prop[-1] - prop[1]) / sqrt(unpooled_variance) marginal_power_primary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_primary, sd = 1, lower.tail = FALSE ) names(marginal_power_primary) <- c(\"H1\", \"H2\") marginal_power_primary #> H1 H2 #> 0.8028315 0.8028315"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-marginal-power-for-secondary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Marginal power for secondary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"Assume secondary endpoint (SE1) change total medication score baseline, continuous outcome. Also assume secondary endpoint (SE2) change another medication score baseline, continuous outcome contains fewer categories compared SE1. evaluate treatment effect, mean change calculated reduction better. Assume mean change baseline SE1 reduction 7.5 8.25, respectively low high doses, 5 control. Also assume mean change baseline SE2 reduction 8 9, respectively low high doses, 6 control. assume known common standard deviation 10. Given sample size 200 per treatment group, marginal power 71% 90% \\(H_3\\) \\(H_4\\), respectively 52% 85% \\(H_5\\) \\(H_6\\), respectively using two-sample \\(z\\)-test difference means one-sided significance level 0.025.","code":"mean_change_se1 <- c(5, 7.5, 8.25) sd <- rep(10, 3) variance <- sd[-1]^2 / sample_size[-1] + sd[1]^2 / sample_size[1] noncentrality_parameter_se1 <- (mean_change_se1[-1] - mean_change_se1[1]) / sqrt(variance) marginal_power_se1 <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_se1, sd = 1, lower.tail = FALSE ) names(marginal_power_se1) <- c(\"H3\", \"H4\") marginal_power_se1 #> H3 H4 #> 0.7054139 0.9014809 mean_change_se2 <- c(6, 8, 9) noncentrality_parameter_se2 <- (mean_change_se2[-1] - mean_change_se2[1]) / sqrt(variance) marginal_power_se2 <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_se2, sd = 1, lower.tail = FALSE ) names(marginal_power_se2) <- c(\"H5\", \"H6\") marginal_power_se2 #> H5 H6 #> 0.5159678 0.8508384"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-correlation-structure-to-simulate-test-statistics","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Correlation structure to simulate test statistics","title":"Graphical multiple comparison procedures based on the closure principle","text":"addition marginal power, also need make assumptions joint distribution test statistics. example, assume follow multivariate normal distribution means ’re defined noncentrality parameters correlation matrix \\(R\\). obtain correlations, helpful understand two types correlations example. correlation two dose-control comparisons endpoint correlation endpoints. former correlation can calculated function sample size. example, correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_3+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. correlation test statistics \\(H_3\\) \\(H_4\\) \\(H_5\\) \\(H_6\\) . hand, correlation endpoints dose-control comparison often estimated based prior knowledge previous trials. Without information, assume \\(\\rho_{13}=\\rho_{15}=\\rho_{24}=\\rho_{26}=\\rho_{35}=\\rho_{46}=0.5\\). practice, one set correlation parameter try multiple values assess sensitivity assumption. Regarding correlation test statistics \\(H_1\\) \\(H_4 (H_6)\\) \\(H_2\\) \\(H_3 (H_5)\\), even difficult estimate. use simple product rule, means correlation product correlations two previously assumed correlations. example, \\(\\rho_{14}=\\rho_{12}*\\rho_{24}\\) \\(\\rho_{23}=\\rho_{12}*\\rho_{13}\\). practice, assumptions may made tested, instead using product rule.","code":"corr <- matrix(0, nrow = 6, ncol = 6) corr[1, 2] <- corr[3, 4] <- corr[5, 6] <- sqrt( sample_size[2] / sum(sample_size[1:2]) * sample_size[3] / sum(sample_size[c(1, 3)]) ) rho <- 0.5 corr[1, 3] <- corr[1, 5] <- corr[2, 4] <- corr[2, 6] <- corr[3, 5] <- corr[4, 6] <- rho corr[1, 4] <- corr[1, 6] <- corr[2, 3] <- corr[2, 5] <- corr[1, 2] * rho corr[3, 6] <- corr[1, 3] * corr[1, 6] corr[4, 5] <- corr[1, 4] * corr[1, 6] corr <- corr + t(corr) diag(corr) <- 1 colnames(corr) <- hyp_names rownames(corr) <- hyp_names corr #> H1 H2 H3 H4 H5 H6 #> H1 1.00 0.50 0.500 0.2500 0.5000 0.250 #> H2 0.50 1.00 0.250 0.5000 0.2500 0.500 #> H3 0.50 0.25 1.000 0.5000 0.5000 0.125 #> H4 0.25 0.50 0.500 1.0000 0.0625 0.500 #> H5 0.50 0.25 0.500 0.0625 1.0000 0.500 #> H6 0.25 0.50 0.125 0.5000 0.5000 1.000"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"user-defined-success-criteria","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"User-defined success criteria","title":"Graphical multiple comparison procedures based on the closure principle","text":"mentioned earlier, multiple versions “power” multiple hypotheses. Commonly used “power” definitions include: - Local power: probability hypothesis rejected (multiplicity adjustment) - Expected . rejections: expected number rejections - Power reject 1 : probability reject least one hypothesis - Power reject : probability reject hypotheses default outputs graph_calculate_power function. addition, user customize success criteria define versions “power”.","code":"success_fns <- list( # Probability to reject H1 H1 = function(x) x[1], # Expected number of rejections `Expected no. of rejections` = function(x) x[1] + x[2] + x[3] + x[4] + x[5] + x[6], # Probability to reject at least one hypothesis `AtLeast1` = function(x) x[1] | x[2] | x[3] | x[4] | x[5] | x[6], # Probability to reject all hypotheses `All` = function(x) x[1] & x[2] & x[3] & x[4] & x[5] & x[6], # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject all hypotheses for the low dose or the high dose `(H1andH3andH5)or(H2andH4andH6)` <- function(x) (x[1] & x[3] & x[5]) | (x[2] & x[4] & x[6]) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"output-calculate-power","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Output: Calculate power","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given inputs, can calculate power via simulation graphical multiple comparison procedure one-sided significance level alpha = 0.025 using sim_n = 1e5 simulations random seed 1234. three procedures compare: Bonferroni-based procedure, procedure using parametric tests primary hypotheses, procedure using parametric tests primary hypotheses Simes tests two sets secondary hypotheses separately. local power hypotheses \\(H_1, \\ldots, H_6\\) - 0.760, 0.752, 0.510, 0.665, 0.391, 0.625, respectively using Bonferroni-based procedure, - 0.764, 0.756, 0.511, 0.668, 0.392, 0.628, respectively using procedure using parametric tests primary hypotheses, - 0.764, 0.757, 0.521, 0.673, 0.402, 0.633, respectively using procedure using parametric tests primary hypotheses Simes tests two sets secondary hypotheses separately. Note local power improved hypotheses parametric tests Simes tests applied Bonferroni-based procedure. see detailed outputs simulated p-values rejection decisions hypotheses, can specify verbose = TRUE. produce lot outputs. allow flexible printing functions, user can change following: - indented space default setting indent = 2 - precision numeric values (.e., number decimal places) default setting precision = 6","code":"set.seed(1234) power_bonferroni <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), sim_success = success_fns ) round(power_bonferroni$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.760 0.752 0.510 0.665 0.391 0.625 set.seed(1234) power_parametric <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), 3:6), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(corr_12, NA), sim_success = success_fns ) round(power_parametric$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.764 0.756 0.511 0.668 0.392 0.628 set.seed(1234) power_parametric_simes <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), sim_success = success_fns ) round(power_parametric_simes$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.764 0.757 0.521 0.673 0.402 0.633 set.seed(1234) power_verbose_output_parametric_simes <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), sim_success = success_fns, verbose = TRUE ) head(power_verbose_output_parametric_simes$details$p_sim, 10) #> H1 H2 H3 H4 H5 #> [1,] 0.0236514114 6.962444e-03 3.835101e-03 0.0615622415 0.0034034237 #> [2,] 0.0367030430 4.681135e-02 6.857853e-02 0.0284812435 0.1496042440 #> [3,] 0.0157541925 6.543826e-03 1.152738e-03 0.0007655046 0.0836186744 #> [4,] 0.0053369856 8.699959e-07 9.952719e-03 0.0002429371 0.0369937655 #> [5,] 0.0342665326 1.788794e-01 6.202961e-03 0.0305855529 0.0461642736 #> [6,] 0.0011139852 1.783703e-02 6.083855e-02 0.0087065723 0.3865009844 #> [7,] 0.2540774514 2.101193e-01 2.616673e-02 0.0277425681 0.0092489689 #> [8,] 0.0908135583 4.433230e-02 1.903718e-01 0.0418782572 0.3996511810 #> [9,] 0.0739568465 4.728371e-02 3.778643e-01 0.0296172396 0.4446759145 #> [10,] 0.0003353917 1.048743e-03 1.246528e-05 0.0032298980 0.0001601294 #> H6 #> [1,] 0.0018417304 #> [2,] 0.0552141940 #> [3,] 0.0255279965 #> [4,] 0.0001345536 #> [5,] 0.0666051161 #> [6,] 0.0867387423 #> [7,] 0.0297658510 #> [8,] 0.1097032475 #> [9,] 0.0620564532 #> [10,] 0.0114581872 print(power_verbose_output_parametric_simes, indent = 4, precision = 6 ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> H5: 0.0 #> H6: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 #> H1 0.00000 0.50000 0.25000 0.00000 0.25000 0.00000 #> H2 0.50000 0.00000 0.00000 0.25000 0.00000 0.25000 #> H3 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 #> H4 0.00001 0.00000 0.00000 0.00000 0.00000 0.99999 #> H5 0.00000 0.00001 0.99999 0.00000 0.00000 0.00000 #> H6 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 #> #> Alpha = 0.025 #> #> Parametric testing correlation: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H5) #> simes: (H4, H6) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 100,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 H5 H6 #> Marginal power: 0.802831 0.802831 0.705414 0.901481 0.515968 0.850838 #> #> Correlation: H1 H2 H3 H4 H5 H6 #> H1 1.0000 0.5000 0.5000 0.2500 0.5000 0.2500 #> H2 0.5000 1.0000 0.2500 0.5000 0.2500 0.5000 #> H3 0.5000 0.2500 1.0000 0.5000 0.5000 0.1250 #> H4 0.2500 0.5000 0.5000 1.0000 0.0625 0.5000 #> H5 0.5000 0.2500 0.5000 0.0625 1.0000 0.5000 #> H6 0.2500 0.5000 0.1250 0.5000 0.5000 1.0000 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 H5 H6 #> Local power: 0.76437 0.75656 0.52086 0.67302 0.40234 0.63292 #> #> Expected no. of rejections: 3.75007 #> Power to reject 1 or more: 0.86277 #> Power to reject all: 0.32537 #> #> Success measure Power #> H1 0.76437 #> Expected no. of rejections 3.75007 #> AtLeast1 0.86277 #> All 0.32537 #> H1andH2 0.65816 #> 0.63324 #> #> Simulation details ($details) -------------------------------------------------- #> p_sim_H1 p_sim_H2 p_sim_H3 p_sim_H4 p_sim_H5 p_sim_H6 rej_H1 #> 2.36514e-02 6.96244e-03 3.83510e-03 6.15622e-02 3.40342e-03 1.84173e-03 FALSE #> 3.67030e-02 4.68113e-02 6.85785e-02 2.84812e-02 1.49604e-01 5.52142e-02 FALSE #> 1.57542e-02 6.54383e-03 1.15274e-03 7.65505e-04 8.36187e-02 2.55280e-02 TRUE #> 5.33699e-03 8.69996e-07 9.95272e-03 2.42937e-04 3.69938e-02 1.34554e-04 TRUE #> 3.42665e-02 1.78879e-01 6.20296e-03 3.05856e-02 4.61643e-02 6.66051e-02 FALSE #> 1.11399e-03 1.78370e-02 6.08385e-02 8.70657e-03 3.86501e-01 8.67387e-02 TRUE #> 2.54077e-01 2.10119e-01 2.61667e-02 2.77426e-02 9.24897e-03 2.97659e-02 FALSE #> 9.08136e-02 4.43323e-02 1.90372e-01 4.18783e-02 3.99651e-01 1.09703e-01 FALSE #> 7.39568e-02 4.72837e-02 3.77864e-01 2.96172e-02 4.44676e-01 6.20565e-02 FALSE #> 3.35392e-04 1.04874e-03 1.24653e-05 3.22990e-03 1.60129e-04 1.14582e-02 TRUE #> rej_H2 rej_H3 rej_H4 rej_H5 rej_H6 #> TRUE FALSE FALSE FALSE TRUE #> FALSE FALSE FALSE FALSE FALSE #> TRUE TRUE TRUE FALSE FALSE #> TRUE TRUE TRUE FALSE TRUE #> FALSE FALSE FALSE FALSE FALSE #> TRUE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> TRUE TRUE TRUE TRUE TRUE #> ... (Use `print(x, rows = )` for more)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Comparisons with other packages","text":"two R packages cover graphical multiple comparison procedures (MCPs): gMCP (Rohmeyer Klinglmueller 2024) lrstat (Lu 2023). development graphicalMCP benefited two packages. provide comparisons graphicalMCP packages respect key functions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"list-of-comparisons","dir":"Articles","previous_headings":"","what":"List of comparisons","title":"Comparisons with other packages","text":"graphicalMCP::graph_generate_weights() gMCP::generateWeights() graphicalMCP::graph_test_shortcut() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower() graphicalMCP::graph_test_closure() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower() graphicalMCP::graph_test_closure() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower()","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"comparisons-of-weighting-strategies","dir":"Articles","previous_headings":"","what":"Comparisons of weighting strategies","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. Weighting strategies following two functions compared: graphicalMCP::graph_generate_weights() gMCP::generateWeights(). process repeated 1000 times. Weighting strategies matched 1000 cases.","code":"set.seed(1234) identical <- NULL for (i in 1:1000) { graph <- random_graph(5) graphicalmcp_weights <- graphicalMCP::graph_generate_weights(graph) dimnames(graphicalmcp_weights) <- list(NULL, NULL) gmcp_weights <- gMCP::generateWeights(graph$transitions, graph$hypotheses) gmcp_weights <- gmcp_weights[nrow(gmcp_weights):1, ] # Reorder rows identical <- c( identical, all.equal(gmcp_weights, graphicalmcp_weights, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing","dir":"Articles","previous_headings":"Comparisons of sequentially rejective procedures based on Bonferroni tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_shortcut() gMCP::gMCP(). process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"set.seed(1234) alpha <- 0.025 identical <- NULL for (i in 1:10000) { graph <- random_graph(5) p <- runif(5, 0, alpha) graphicalmcp_test_shortcut <- graph_test_shortcut(graph, p, alpha = alpha)$outputs$adjusted_p gmcp_test_shortcut <- gMCP(as_graphMCP(graph), p, alpha = alpha)@adjPValues identical <- c( identical, all.equal(graphicalmcp_test_shortcut, gmcp_test_shortcut, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations","dir":"Articles","previous_headings":"Comparisons of sequentially rejective procedures based on Bonferroni tests","what":"Power simulations","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. set marginal power (without multiplicity adjustment) randomly generated. Local power (multiplicity adjustment) calculated compared using following functions: graphicalMCP::graph_calculate_power() gMCP::calcPower(). Since different simulation methods used, results slightly different. maximum absolute difference local power 0.0051 (0.51%) among 1000 cases, relatively small.","code":"set.seed(1234) alpha <- 0.025 sim_corr <- matrix(.5, 5, 5) diag(sim_corr) <- 1 graphicalmcp_power <- NULL gmcp_power <- NULL for (i in 1:1000) { graph <- random_graph(5) marginal_power <- runif(5, 0.5, 0.9) noncentrality_parameter <- qnorm(1 - 0.025, lower.tail = TRUE) - qnorm(1 - marginal_power, lower.tail = TRUE) set.seed(1234 + i - 1) graphicalmcp_power <- rbind( graphicalmcp_power, graph_calculate_power( graph, alpha = alpha, power_marginal = marginal_power, sim_corr = sim_corr, sim_n = 2^17 )$power$power_local ) set.seed(1234 + i - 1) gmcp_power <- rbind( gmcp_power, calcPower( graph$hypotheses, alpha = alpha, graph$transitions, mean = noncentrality_parameter, corr.sim = sim_corr, n.sim = 2^17 )$LocalPower ) } diff <- data.frame( rbind(graphicalmcp_power, gmcp_power), procedure = rep(c(\"graphicalMCP\", \"gMCP\"), each = nrow(graphicalmcp_power)) ) write.csv( diff, here::here(\"vignettes/cache/comparisons_power_shortcut.csv\"), row.names = FALSE ) diff <- read.csv(here::here(\"vignettes/cache/comparisons_power_shortcut.csv\")) graphicalmcp_power <- subset(diff, procedure == \"graphicalMCP\") gmcp_power <- subset(diff, procedure == \"gMCP\") round( max( abs( graphicalmcp_power[, -ncol(graphicalmcp_power)] - gmcp_power[, -ncol(gmcp_power)] ) ), 4 ) # Maximum difference in local power among 1000 cases"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing-1","dir":"Articles","previous_headings":"Comparisons of closed test procedures with parametric tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_closure() gMCP::gMCP(). Parametric tests used two primary hypotheses. process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) set.seed(1234) alpha <- 0.025 identical <- NULL test_corr <- rbind( c(1, 0.5, NA, NA), c(0.5, 1, NA, NA), c(NA, NA, 1, NA), c(NA, NA, NA, 1) ) for (i in 1:10000) { p <- runif(4, 0, alpha) graphicalmcp_test_parametric <- graph_test_closure( graph, p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(test_corr[1:2, 1:2], NA) )$outputs$adjusted_p gmcp_test_parametric <- gMCP( as_graphMCP(graph), p, alpha = 0.025, correlation = test_corr )@adjPValues identical <- c( identical, all.equal(graphicalmcp_test_parametric, gmcp_test_parametric, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations-1","dir":"Articles","previous_headings":"Comparisons of closed test procedures with parametric tests","what":"Power simulations","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set marginal power (without multiplicity adjustment) randomly generated. Local power (multiplicity adjustment) calculated compared using following functions: graphicalMCP::graph_calculate_power() gMCP::calcPower(). Parametric tests used two primary hypotheses. process repeated 100 times. Since different simulation methods used, results slightly different. maximum absolute difference local power 0.0142 (1.42%) among 100 cases, small.","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) test_corr <- rbind( c(1, 0.5, NA, NA), c(0.5, 1, NA, NA), c(NA, NA, 1, NA), c(NA, NA, NA, 1) ) sim_corr <- matrix(0.5, 4, 4) diag(sim_corr) <- 1 set.seed(1234) alpha <- 0.025 graphicalmcp_power_parametric <- NULL gmcp_power_parametric <- NULL for (i in 1:100) { marginal_power <- runif(4, 0.5, 0.9) noncentrality_parameter <- qnorm(1 - 0.025, lower.tail = TRUE) - qnorm(1 - marginal_power, lower.tail = TRUE) set.seed(1234 + i - 1) graphicalmcp_power_parametric <- rbind( graphicalmcp_power_parametric, graph_calculate_power( graph, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(test_corr[1:2, 1:2], NA), power_marginal = marginal_power, sim_corr = sim_corr, sim_n = 2^14 )$power$power_local ) set.seed(1234 + i - 1) gmcp_power_parametric <- rbind( gmcp_power_parametric, calcPower( graph$hypotheses, alpha = alpha, graph$transitions, corr.test = test_corr, mean = noncentrality_parameter, corr.sim = sim_corr, n.sim = 2^14 )$LocalPower ) } diff <- data.frame( rbind(graphicalmcp_power_parametric, gmcp_power_parametric), procedure = rep(c(\"graphicalMCP\", \"gMCP\"), each = nrow(gmcp_power_parametric)) ) write.csv( diff, here::here(\"vignettes/cache/comparisons_power_parametric.csv\"), row.names = FALSE ) diff <- read.csv(here::here(\"vignettes/cache/comparisons_power_parametric.csv\")) graphicalmcp_power <- subset(diff, procedure == \"graphicalMCP\") gmcp_power <- subset(diff, procedure == \"gMCP\") round( max( abs( graphicalmcp_power_parametric[, -ncol(graphicalmcp_power_parametric)] - gmcp_power_parametric[, -ncol(gmcp_power)] ) ), 4 ) # Maximum difference in local power among 100 cases"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing-2","dir":"Articles","previous_headings":"Comparisons of closed test procedures with Simes tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_closure() lrstat::fadjpsim(). Simes tests used two primary hypotheses. process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"hypotheses <- c(0.5, 0.5, 0, 0) eps <- 0.0001 transitions <- rbind( c(0, 1 - eps, eps, 0), c(1 - eps, 0, 0, eps), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) set.seed(1234) alpha <- 0.025 identical <- NULL family <- rbind( c(1, 1, 0, 0), c(0, 0, 1, 0), c(0, 0, 0, 1) ) for (i in 1:10000) { p <- runif(4, 0, alpha) graphicalmcp_test_simes <- graph_test_closure( graph, p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"simes\", \"bonferroni\") )$outputs$adjusted_p names(graphicalmcp_test_simes) <- NULL lrstat_test_simes <- fadjpsim( fwgtmat(graph$hypotheses, graph$transitions), p, family ) identical <- c( identical, all.equal(graphicalmcp_test_simes, lrstat_test_simes, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations-2","dir":"Articles","previous_headings":"Comparisons of closed test procedures with Simes tests","what":"Power simulations","title":"Comparisons with other packages","text":"Power simulations available lrstat. Thus comparison done compare graphicalMCP::graph_calculate_power() manual repetition lrstat::fadjpsim() many sets marginal power. process comparison adjusted p-values, thus omitted.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"Consider simple successive graph four hypotheses. two primary hypotheses \\(H_1\\) \\(H_2\\) two secondary hypotheses \\(H_3\\) \\(H_4\\). Initially, hypothesis weights split equally \\(H_1\\) \\(H_2\\) 0.5. Hypotheses \\(H_3\\) \\(H_4\\) receive 0 hypothesis weights \\(H_3 (H_4)\\) tested \\(H_1 (H_2)\\) rejected. Thus edge \\(H_1 (H_2)\\) \\(H_3 (H_4)\\) transition weight 1. \\(H_1\\) \\(H_3\\) rejected, hypothesis weights propagated \\(H_2\\); similarly, \\(H_2\\) \\(H_4\\) rejected, hypothesis weights propagated \\(H_1\\). Thus edge \\(H_3 (H_4)\\) \\(H_2 (H_1)\\) transition weight 1. graphical multiple comparison procedure illustrated .","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"generating-the-closure","dir":"Articles","previous_headings":"","what":"Generating the closure","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"closure multiple comparison procedure collection intersection hypotheses \\(H_1\\cap H_2\\cap H_3\\cap H_4\\), \\(H_1\\cap H_2\\cap H_3\\), \\(H_1\\cap H_2\\cap H_4\\), \\(H_1\\cap H_3\\cap H_4\\), \\(H_2\\cap H_3\\cap H_4\\ \\ldots, H_1, H_2, H_3\\), \\(H_4\\). words, intersection hypotheses consist intersections based non-empty subsets \\(\\{1, 2, 3, 4\\}\\), e.g., \\(\\{1, 2, 3\\}\\), \\(\\{1, 2, 4\\}\\), \\(\\{1, 3, 4\\}\\), \\(\\{2, 3, 4\\}\\), \\(\\ldots\\). Thus \\(2^4-1\\) intersection hypotheses. equivalent way generate intersection hypotheses use binary representation. example, intersection hypothesis \\(H_1\\cap H_2\\cap H_3\\cap H_4\\) corresponds \\((1, 1, 1, 1)\\) \\(H_1\\cap H_2\\cap H_3\\) corresponds \\((1, 1, 1, 0)\\). closure can indexed power set \\(\\{1, 2, 3, 4\\}\\) . general, one can use rev(expand.grid(rep(list(1:0), m))) general closure, \\(m\\) number hypotheses.","code":"#> H1 H2 H3 H4 #> 1 1 1 1 1 #> 2 1 1 1 0 #> 3 1 1 0 1 #> 4 1 1 0 0 #> 5 1 0 1 1 #> 6 1 0 1 0 #> 7 1 0 0 1 #> 8 1 0 0 0 #> 9 0 1 1 1 #> 10 0 1 1 0 #> 11 0 1 0 1 #> 12 0 1 0 0 #> 13 0 0 1 1 #> 14 0 0 1 0 #> 15 0 0 0 1"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"calculating-the-weighting-strategy","dir":"Articles","previous_headings":"Generating the closure","what":"Calculating the weighting strategy","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"Given closure, one can calculate hypothesis weight associated every hypothesis every intersection hypothesis using Algorithm 1 (Bretz et al. 2011). whole collection hypothesis weights called weighting strategy. example, hypothesis weights \\((0.5, 0.5, 0, 0)\\) intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\). hypothesis weights intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\) \\((0.5, 0.5, 0, 0)\\), can calculated removing \\(H_4\\) initial graph applying Algorithm 1 (Bretz et al. 2011). algorithm calculates hypothesis weights step--step fashion. example, intersection hypothesis \\(H_1\\cap H_2\\), can start \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) calculates hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\) removing \\(H_4\\) calculates hypothesis weights \\(H_1\\cap H_2\\) removing \\(H_3\\); can also start \\(H_1\\cap H_2 \\cap H_3\\) (assuming hypotheses weights stored) calculates hypothesis weights \\(H_1\\cap H_2\\) removing \\(H_3\\). Therefore, two strategies calculate weighting strategy.","code":"#> H1 H2 H3 H4 #> 1 0.50 0.50 0.00 0.00 #> 2 0.50 0.50 0.00 0.00 #> 3 0.50 0.50 0.00 0.00 #> 4 0.50 0.50 0.00 0.00 #> 5 0.75 0.00 0.00 0.25 #> 6 1.00 0.00 0.00 0.00 #> 7 0.75 0.00 0.00 0.25 #> 8 1.00 0.00 0.00 0.00 #> 9 0.00 0.75 0.25 0.00 #> 10 0.00 0.75 0.25 0.00 #> 11 0.00 1.00 0.00 0.00 #> 12 0.00 1.00 0.00 0.00 #> 13 0.00 0.00 0.50 0.50 #> 14 0.00 0.00 1.00 0.00 #> 15 0.00 0.00 0.00 1.00"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"approach-1-simple-approach","dir":"Articles","previous_headings":"Generating the closure > Calculating the weighting strategy","what":"Approach 1: Simple approach","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"first strategy utilizes initial graph starting point calculates hypothesis weights intersection hypotheses. example, calculate hypothesis weights \\(H_1\\cap H_2\\), start intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) sequentially remove \\(H_4\\) \\(H_3\\) (order). approach simple implement since hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) determined initial graph always available. approach similar one implemented gMCP R package. drawback use information reduce number calculations. example, possible hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\) calculated calculating \\(H_1\\cap H_2\\). Using information \\(H_1\\cap H_2 \\cap H_3\\) need one-step calculation, compared two-step calculation using \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"approach-2-parent-child-approach","dir":"Articles","previous_headings":"Generating the closure > Calculating the weighting strategy","what":"Approach 2: Parent-child approach","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"approach tries avoid drawback Approach 1 saving intermediate graphs. performs one-step calculation save time. general, intersection hypothesis parent intersection hypothesis, involves hypotheses involved first intersection one extra hypothesis. example, second row matrix_intersections \\(H_1\\cap H_2 \\cap H_3\\) parent intersection \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) first row; third row matrix_intersections \\(H_1\\cap H_2 \\cap H_4\\) parent intersection \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) first row. Thus can identify parent intersection hypothesis row matrix_intersections (except row 1) row number 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7. Given sequence parent hypotheses, simple obtain hypothesis weights intersection hypothesis based parent intersection hypothesis via one-step calculation. interest understand pattern obtain efficiently. First, bottom half (rows 9 - 15) top half (rows 1 - 7), row’s parent bottom half corresponding row top half, eight rows , difference flipping \\(H_1\\) 1 top half 0 bottom half. example, row 15’s parent row 15 - 8 = 7. Using observation, can determine parent hypotheses rows 9 15 1, 2, 3, 4, 5, 6, 7. similar pattern can observed rows 5 8. parent hypotheses rows 1, 2, 3, 4, respectively, flipping \\(H_2\\) 1 0. rows 3 - 4, parent hypotheses rows 1, 2, respectively, flipping \\(H_3\\) 1 0. Lastly row 2, parent hypothesis row 1. row number parent hypothesis can efficiently generated running .call(c, lapply(2^(seq_len(m) - 1), seq_len))[-2^m, ], \\(m\\) number hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"comparing-different-approaches-to-calculating-weighting-strategies","dir":"Articles","previous_headings":"Generating the closure","what":"Comparing different approaches to calculating weighting strategies","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"benchmark existing approaches calculating weighting strategies, compare following approaches: gMCP::generateWeights() (Rohmeyer Klinglmueller 2024), lrstat::fwgtmat() (Lu 2016), Approach 1 (graphicalMCP simple) Approach 2 (graphicalMCP parent-child). Random graphs generated numbers hypotheses 4, 8, 12, 16. Computing time (median log-10 milliseconds) plotted . can see gMCP::generateWeights() slowest lrstat::fwgtmat() fastest. Approach 2 (graphicalMCP parent-child) faster Approach 1 (graphicalMCP simple). Note lrstat::fwgtmat() implements calculation using C++, known faster R. less stable approaches, e.g., giving errors often others. Given computing time R-based approaches acceptable, adding Rcpp dependency considered graphicalMCP. considerations, implement Approach 2 graphicalMCP::graph_generate_weights().","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"conventional-approach-for-power-simulations","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Conventional approach for power simulations","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"conventional approach power simulations repeat following process many times, e.g., 100,000 times. Simulate set p-values Determine hypothesis can rejected Remove rejected hypothesis update graph Repeat hypotheses can rejected Note step update graph may repeat many replications, may repetitive. \\(m\\) hypotheses, \\(2^m-1\\) graphs depending hypotheses rejected. graphs correspond closure weighting strategy. Thus idea avoid redundant updating graphs utilize weighting strategy.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"power-simulations-using-parent-child-relationships","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Power simulations using parent-child relationships","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"key allow approach efficiently identify row weighting strategy, given hypotheses rejected. Remembering pattern found Approach 2, bottom half (rows 9 - 15) matrix_intersections top half (rows 1 - 7), except flipping \\(H_1\\) 1 0. means \\(H_1\\) rejected (1 \\(H_1\\) matrix_intersections), row number index top half. example, assume \\(H_2\\) \\(H_4\\) rejected index matrix_intersections \\((1, 0, 1, 0)\\). Since \\(H_1\\) 1, corresponding row top half (rows 1- 7). \\(H_2\\) 0 thus corresponding row bottom half within top half (rows 5 - 7). Since \\(H_3\\) 1 thus corresponding row top half (rows 5 - 6). \\(H_4\\) 0 thus corresponding row 6. useful way calculate row number index XXXX 2^m - sum(XXXX * 2^(m:1 - 1)). example XXXX=1010, row number (1 - 1) * 8 + (1 - 0) * 4 + (1 - 1) * 2 + (1 - 0) * 1 + 1 = 16 - 10 = 6. way efficiently identifying rows weighting_strategy, power simulations implemented follows: Obtain weighting strategy (simulations) Simulate set p-values Determine hypothesis can rejected Remove rejected hypothesis identify row weighting strategy Repeat hypotheses can rejected small modification Step 3b makes approach much faster conventional approach power simulations.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"comparing-different-approaches-to-power-simulations","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Comparing different approaches to power simulations","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"benchmark existing approaches calculating weighting strategies, compare following approaches: gMCP::calcPower(), Approach 1 (graphicalMCP conventional), Approach 2 (graphicalMCP parent-child). Holm fixed sequence procedures considered numbers hypotheses 4, 8, 12, 16. Computing time (median log-10 seconds) plotted . can see gMCP::calcPower() fastest Approach 1 (graphicalMCP conventional) lowest. Note gMCP::calcPower() implements simulation using C, known faster R easy extend situations. Given computing time Approach 2 (graphicalMCP parent-child) acceptable, implement graphicalMCP::graph_calculate_power().","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"confirmatory clinical trials, regulatory guidelines mandate strong control family-wise error rate prespecified level \\(\\alpha\\). Many multiple comparison procedures (MCPs) proposed purpose. graphical approaches general framework include many common MCPs special cases. vignette, illustrate use graphicalMCP perform common MCPs. test \\(m\\) hypotheses using graphical MCP, hypothesis \\(H_i\\) receives weight \\(0\\leq w_i\\leq 1\\) (called hypothesis weight), \\(\\sum_{=1}^{m}w_i\\leq 1\\). \\(H_i\\) \\(H_j\\), directed weighted edge \\(0\\leq g_{ij}\\leq 1\\), means \\(H_i\\) rejected, hypothesis weight propagated (transferred) \\(H_j\\) \\(g_{ij}\\) determines much propagation. also require \\(\\sum_{j=1}^{m}g_{ij}\\leq 1\\) \\(g_{ii}=0\\).","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"weighted-bonferroni-test","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Weighted Bonferroni test","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"weighted Bonferroni test splits \\(\\alpha\\) among hypotheses testing every hypothesis significance level \\(w_i\\alpha\\). Thus rejects hypothesis p-value less equal significance level. \\(w_i=w_j\\) \\(,j\\), means equal split test Bonferroni test. propagation pair hypothesis.","code":"set.seed(1234) alpha <- 0.025 m <- 3 bonferroni_graph <- bonferroni(rep(1 / m, m)) # transitions <- matrix(0, m, m) # bonferroni_graph <- graph_create(rep(1 / m, m), transitions) plot( bonferroni_graph, layout = igraph::layout_in_circle( as_igraph(bonferroni_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( bonferroni_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"holm-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Holm Procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Holm (Bonferroni-Holm) procedures improve Bonferroni tests allowing propagation (Holm 1979). words, transition weights hypotheses may zero. uniformly powerful Bonferroni tests.","code":"set.seed(1234) alpha <- 0.025 m <- 3 holm_graph <- bonferroni_holm(rep(1 / m, m)) # transitions <- matrix(1 / (m - 1), m, m) # diag(transitions) <- 0 # holm_graph <- graph_create(rep(1 / m, m), transitions) plot(holm_graph, layout = igraph::layout_in_circle( as_igraph(holm_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut(holm_graph, p = p_values, alpha = alpha) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"fixed-sequence-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Fixed sequence procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Fixed sequence (hierarchical) procedures pre-specify order testing [Maurer, Hothorn, Lehmacher (1995);westfall-2001-optimally]. example, procedure test \\(H_1\\) first. rejected, test \\(H_2\\); otherwise testing stops. \\(H_2\\) rejected, test \\(H_3\\); otherwise testing stops. hypothesis, tested full \\(\\alpha\\) level, can tested.","code":"set.seed(1234) alpha <- 0.025 m <- 3 fixed_sequence_graph <- fixed_sequence(m) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(0, 0, 0) # ) # fixed_sequence_graph <- graph_create(c(1, 0, 0), transitions) plot(fixed_sequence_graph, nrow = 1, asp = 0.05, vertex.size = 40) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fixed_sequence_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"fallback-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Fallback procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Fallback procedures one-way propagation (like fixed sequence procedures) allow hypotheses tested different significance levels (Wiens 2003). can improved allow propagation later hypotheses earlier hypotheses, possible later hypothesis rejected earlier hypothesis can rejected. two versions improvement: fallback_improved_1 due (Wiens Dmitrienko 2005) fallback_improved_2 due (Bretz et al. 2009) respectively.","code":"set.seed(1234) alpha <- 0.025 m <- 3 fallback_graph <- fallback(rep(1 / 3, 3)) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(0, 0, 0) # ) # fallback_graph <- graph_create(rep(1 / 3, 3), transitions) plot(fallback_graph, nrow = 1, asp = 0.05, vertex.size = 40) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fallback_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE set.seed(1234) alpha <- 0.025 m <- 3 fallback_improved_1_graph <- fallback_improved_1(rep(1 / 3, 3)) # hypotheses <- rep(1 / 3, 3) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(hypotheses[seq_len(m - 1)] / sum(hypotheses[seq_len(m - 1)]), 0) # ) # fallback_improved_1_graph <- graph_create(rep(1 / 3, 3), transitions) plot( fallback_improved_1_graph, nrow = 1, asp = 0.05, vertex.size = 40, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10) ) epsilon <- 0.0001 fallback_improved_2_graph <- fallback_improved_2(rep(1 / 3, 3), epsilon) # hypotheses <- rep(1 / 3, 3) # transitions <- rbind( # c(0, 1, 0), # c(1 - epsilon, 0, epsilon), # c(1, 0, 0) # ) # fallback_improved_2_graph <- graph_create(rep(1 / 3, 3), transitions) plot( fallback_improved_2_graph, nrow = 1, asp = 0.05, eps = 0.0001, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10), vertex.size = 40 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fallback_improved_2_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"serial-gatekeeping-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Serial gatekeeping procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Serial gatekeeping procedures involve ordered multiple families hypotheses, hypotheses family hypotheses must rejected proceeding test sequence. example considers primary family consisting two hypotheses \\(H_1\\) \\(H_2\\) secondary family consisting single hypothesis \\(H_3\\). primary family, Holm procedure applied. \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) can tested level \\(\\alpha\\); otherwise \\(H_3\\) rejected. allow conditional propagation \\(H_3\\), \\(\\varepsilon\\) edge used \\(H_2\\) \\(H_3\\). small transition weight \\(H_2\\) propagates hypothesis weight \\(H_1\\) (already rejected) retains small (non-zero) weight \\(H_3\\) \\(H_1\\) rejected, hypothesis weight \\(H_2\\) propagated \\(H_3\\). \\(\\varepsilon\\) assigned 0.0001 practice, value adjusted much smaller smallest p-value observed.","code":"set.seed(1234) alpha <- 0.025 m <- 3 epsilon <- 0.0001 transitions <- rbind( c(0, 1, 0), c(1 - epsilon, 0, epsilon), c(0, 0, 0) ) serial_gatekeeping_graph <- graph_create(c(0.5, 0.5, 0), transitions) plot( serial_gatekeeping_graph, nrow = 1, asp = 0.05, eps = 0.0001, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10), vertex.size = 40 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( serial_gatekeeping_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"parallel-gatekeeping-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Parallel gatekeeping procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Parallel gatekeeping procedures also involve multiple ordered families hypotheses, null hypotheses family hypotheses must rejected proceeding test sequence (Dmitrienko, Offen, Westfall 2003). example considers primary family consisting two hypotheses \\(H_1\\) \\(H_2\\) secondary family consisting two hypotheses \\(H_3\\) \\(H_4\\). primary family, Bonferroni test applied. \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) \\(H_4\\) can tested level \\(\\alpha/2\\) using Holm procedure; \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) \\(H_4\\) can tested level \\(\\alpha\\) using Holm procedure; otherwise \\(H_3\\) \\(H_4\\) rejected. parallel gatekeeping procedure can improved adding \\(\\varepsilon\\) edges secondary hypotheses primary hypotheses, possible secondary hypotheses rejected still remaining primary hypothesis rejected (Bretz et al. 2009).","code":"set.seed(1234) alpha <- 0.025 m <- 4 transitions <- rbind( c(0, 0, 0.5, 0.5), c(0, 0, 0.5, 0.5), c(0, 0, 0, 1), c(0, 0, 1, 0) ) parallel_gatekeeping_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(parallel_gatekeeping_graph, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( parallel_gatekeeping_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE set.seed(1234) alpha <- 0.025 m <- 4 epsilon <- 0.0001 transitions <- rbind( c(0, 0, 0.5, 0.5), c(0, 0, 0.5, 0.5), c(epsilon, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0) ) parallel_gatekeeping_improved_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(parallel_gatekeeping_improved_graph, eps = 0.0001, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( parallel_gatekeeping_improved_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"successive-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Successive procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Successive procedures incorporate successive relationships hypotheses. example, secondary hypothesis tested primary hypothesis rejected. similar using fixed sequence procedure component graph. example considers two primary hypotheses \\(H_1\\) \\(H_2\\) two secondary hypotheses \\(H_3\\) \\(H_4\\). Primary hypotheses \\(H_1\\) \\(H_2\\) receive equal hypothesis weight 0.5; secondary hypotheses \\(H_3\\) \\(H_4\\) receive hypothesis weight 0. secondary hypothesis \\(H_3 (H_4)\\) can tested corresponding primary hypothesis \\(H_1 (H_2)\\) rejected. represents successive relationships \\(H_1\\) \\(H_3\\), \\(H_2\\) \\(H_4\\), respectively (Maurer, Glimm, Bretz 2011). \\(H_1\\) \\(H_3\\) rejected, hypothesis weights propagated \\(H_2\\) \\(H_4\\), vice versa. graph generalized allow propagation primary hypotheses (Maurer, Glimm, Bretz 2011). general successive graph illustrate variable determine propagation \\(H_1\\) \\(H_2\\).","code":"set.seed(1234) alpha <- 0.025 m <- 4 simple_successive_graph <- simple_successive_1() # transitions <- rbind( # c(0, 0, 1, 0), # c(0, 0, 0, 1), # c(0, 1, 0, 0), # c(1, 0, 0, 0) # ) # simple_successive_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(simple_successive_graph, layout = \"grid\", nrow = 2, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( simple_successive_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE set.seed(1234) alpha <- 0.025 m <- 4 successive_var <- simple_successive_var <- function(gamma) { graph_create( c(0.5, 0.5, 0, 0), rbind( c(0, gamma, 1 - gamma, 0), c(gamma, 0, 0, 1 - gamma), c(0, 1, 0, 0), c(1, 0, 0, 0) ) ) } successive_var_graph <- successive_var(0.5) plot(successive_var_graph, layout = \"grid\", nrow = 2, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( successive_var_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE FALSE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"hommel-procedure","dir":"Articles","previous_headings":"Simes-based procedures","what":"Hommel procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Hommel procedure (Hommel 1988) closed test procedure uses Simes tests every intersection hypothesis. According Xi Bretz (2019), graph Hommel procedures graph Holm procedures. Thus perform Hommel procedure, just need specify test_type simes.","code":"set.seed(1234) alpha <- 0.025 m <- 3 hommel_graph <- bonferroni_holm(rep(1 / m, m)) plot( hommel_graph, layout = igraph::layout_in_circle( as_igraph(hommel_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_closure( hommel_graph, p = p_values, alpha = alpha, test_types = \"simes\" ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"dunnett-procedure","dir":"Articles","previous_headings":"Parametric procedures","what":"Dunnett procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Step-Dunnett procedures closed test procedure improvement Holm procedures incorporating correlation structure test statistics (Dunnett Tamhane 1991). Thus graph Holm procedures. Assume equi-correlated case, correlation pair test statistics , e.g., 0.5. can perform step-Dunnett procedure specifying test_type parametric providing correlation matrix.","code":"set.seed(1234) alpha <- 0.025 m <- 3 dunnett_graph <- bonferroni_holm(rep(1 / m, m)) plot( dunnett_graph, layout = igraph::layout_in_circle( as_igraph(dunnett_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) corr <- matrix(0.5, m, m) diag(corr) <- 1 test_results <- graph_test_closure( dunnett_graph, p = p_values, alpha = alpha, test_types = \"parametric\", test_corr = list(corr) ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Get started","text":"Graphical approaches multiple comparison procedures (MCPs) general framework control familywise error rate strongly pre-specified significance level \\(0<\\alpha<1\\). approach includes many commonly used MCPs special cases transparent visualizing MCPs better communications. graphicalMCP designed design analyze graphical MCPs flexible, informative efficient way.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"initial-graph","dir":"Articles","previous_headings":"Basic usage","what":"Initial graph","title":"Get started","text":"base object graphicalMCP initial_graph, consists vector hypothesis weights matrix transition weights (Bretz et al. 2009). object can created via graph_create(). graphical representation, hypotheses denoted nodes (vertices) associated hypothesis weights. directed edge hypothesis another indicates direction propagation hypothesis weight origin hypothesis end hypothesis. edge weighted transition weight indicating proportion propagation.","code":"library(graphicalMCP) # A graph of two primary hypotheses (H1 and H2) and two secondary hypotheses (H3 and H4) hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\") example_graph <- graph_create(hypotheses, transitions, hyp_names) example_graph #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 plot(example_graph, vertex.size = 60)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"update-graph","dir":"Articles","previous_headings":"Basic usage","what":"Update graph","title":"Get started","text":"hypothesis removed graph, hypothesis transition weights remaining hypotheses updated according Algorithm 1 Bretz et al. (2011). example, assume hypotheses H1, H2 H4 removed graph. updated graph removing three hypotheses .","code":"updated_example <- graph_update( example_graph, delete = c(TRUE, TRUE, FALSE, TRUE) ) updated_example #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 1, 2, 4 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA plot(updated_example, vertex.size = 60)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"perform-graphical-mcps","dir":"Articles","previous_headings":"","what":"Perform graphical MCPs","title":"Get started","text":"Given set p-values hypotheses, graphical MCPs can performed using graph_test_shortcut() determine hypotheses can rejected significance level alpha. Assume p-values 0.01, 0.005, 0.03, 0.01 hypotheses H1-H4. one-sided significance level alpha = 0.025, rejected hypotheses H1, H2, H4. details shortcut testing can found vignette(\"shortcut-testing\"). similar testing procedure can performed using closure principle. allow tests intersection hypotheses, e.g., Simes, parametric mixture . test type Bonferroni, resulting closed procedure equivalent shortcut procedure . Additional details closed testing can found vignette(\"closed-testing\").","code":"test_results <- graph_test_shortcut( example_graph, p = c(0.01, 0.005, 0.03, 0.01), alpha = 0.025 ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE test_results_closed <- graph_test_closure( example_graph, p = c(0.01, 0.005, 0.03, 0.01), alpha = 0.025, test_types = \"bonferroni\", test_groups = list(1:4) ) test_results_closed$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"power-simulations","dir":"Articles","previous_headings":"","what":"Power simulations","title":"Get started","text":"multiplicity adjustment, graphical MCPs, “power” reject hypothesis affected, compared marginal power. latter power rejected hypothesis significance level alpha without multiplicity adjustment. marginal power usually obtained pieces statistical software. graph_calculate_power() performs power simulations assess power adjusting graphical MCP (Bretz, Maurer, Hommel 2011). Assume marginal power reject H1-H4 90%, 90%, 80%, 80% test statistics independent . local power multiplicity adjustment 87.7%, 87.7%, 67.2%, 67.2% respectively H1-H4. Additional details power simulations can found vignette(\"shortcut-testing\") vignette(\"closed-testing\").","code":"set.seed(1234) power_results <- graph_calculate_power( example_graph, sim_n = 1e6, power_marginal = c(0.9, 0.9, 0.8, 0.8) ) power_results$power$power_local #> H1 H2 H3 H4 #> 0.875760 0.876295 0.670470 0.671431"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Consider confirmatory clinical trial comparing test treatment (treatment) control treatment (control) disease. two doses treatment: low dose high dose. two endpoints included multiplicity adjustment strategy, primary endpoint (PE) secondary endpoint (SE). total, four null hypotheses: \\(H_1\\) \\(H_3\\) primary secondary hypotheses respectively low dose versus control; \\(H_2\\) \\(H_4\\) primary secondary hypotheses respectively high dose versus control. clinical considerations constrain structure multiple comparison procedures, can flexibly incorporated using graphical approaches. First, low high doses considered equally important, means rejecting primary hypothesis either dose versus control leads successful trial. Regarding secondary hypotheses, one tested corresponding primary hypothesis rejected. means \\(H_3\\) tested \\(H_1\\) rejected; \\(H_4\\) tested \\(H_2\\) rejected. addition, statistical considerations complete graph. primary hypotheses \\(H_1\\) \\(H_2\\) equal hypothesis weight 0.5. secondary hypotheses hypothesis weight 0. primary hypothesis rejected, weight propagated along two outgoing edges: One primary hypothesis one descendant secondary hypothesis. two edges equal transition weight 0.5. primary secondary hypotheses rejected dose-control comparison, hypothesis weights propagated primary hypothesis dose-control comparison. specifications, can create following graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"create-the-graph","dir":"Articles","previous_headings":"","what":"Create the graph","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\") g <- graph_create(hypotheses, transitions, hyp_names) plot(g, vertex.size = 60)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"adjusted-p-values-and-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Adjusted p-values and rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given set p-values \\(H_1, \\ldots, H_4\\), graphical multiple comparison procedure can performed control familywise error rate (FWER) significance level alpha. graph_test_shortcut function agnostic one-sided two-sided tests. one-sided p-values, alpha often set 0.025 (default); two-sided p-values, alpha often set 0.05. consider one-sided tests . hypothesis rejected adjusted p-value less equal alpha. running procedure, hypotheses \\(H_1\\), \\(H_2\\), \\(H_4\\) rejected adjusted p-value calculated.","code":"p_values <- c(0.018, 0.01, 0.105, 0.006) test_results <- graph_test_shortcut(g, p = p_values, alpha = 0.025) test_results$outputs$adjusted_p # Adjusted p-values #> H1 H2 H3 H4 #> 0.024 0.020 0.105 0.024 test_results$outputs$rejected # Rejections #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-final-and-intermediate-graphs-after-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain final and intermediate graphs after rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"final graph graph removing rejected hypotheses \\(H_1\\), \\(H_2\\), \\(H_4\\). can obtained via test_results$outputs$graph. Rejected hypotheses get hypothesis weight NA transition weight NA. based printing method print.updated_graph. can also obtain non-NA graph calling hypothesis weights transition weights separately via test_results$outputs$graph$hypotheses test_results$outputs$graph$transitions. Note case, rejected hypotheses get 0 hypothesis weight 0 transition weight. mainly internal calculation updating graphs. also interested intermediate graphs - example, graph \\(H_2\\) \\(H_1\\) rejected - can specify verbose = TRUE graph_test_shortcut. Note intermediate graphs depend order rejections, .e., sequence hypotheses rejected. default order defined increasing adjusted p-values, followed earlier hypothesis numbering case ties. example, default order rejection \\(H_2\\rightarrow H_1\\rightarrow H_4\\). obtain intermediate graphs based order rejection, one can specify test_results_verbose$details$results. example, graph \\(H_2\\) \\(H_1\\) rejected given test_results_verbose$details$results[[3]].","code":"test_results$outputs$graph # Final graph after H1, H2 and H4 rejected (as NA's) #> Updated graph #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA test_results$outputs$graph$hypotheses # Hypothesis weights of the final graph #> H1 H2 H3 H4 #> 0 0 1 0 test_results$outputs$graph$transitions # Transition weights of the final graph #> H1 H2 H3 H4 #> H1 0 0 0 0 #> H2 0 0 0 0 #> H3 0 0 0 0 #> H4 0 0 0 0 test_results_verbose <- graph_test_shortcut( g, p = p_values, alpha = 0.025, verbose = TRUE ) # Intermediate graph after H1 and H2 rejected test_results_verbose$details$results[[3]] #> Updated graph #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 0.5 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 1 #> H4 NA NA 1 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-possible-orders-of-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain possible orders of rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"order rejections may unique orders valid. example, rejected hypotheses \\(H_1\\), \\(H_2\\) \\(H_4\\). default order rejections \\(H_2 \\rightarrow H_1 \\rightarrow H_4\\). Another valid order rejections \\(H_2 \\rightarrow H_4 \\rightarrow H_1\\). However, first rejected hypothesis can \\(H_1\\) \\(H_4\\). obtain possible rejection orders, one can use function graph_rejection_orderings. intermediate final graphs can obtained using function graph_update particular order rejections.","code":"# Obtain all valid orders of rejections orders <- graph_rejection_orderings(test_results)$valid_orderings orders #> [[1]] #> H2 H1 H4 #> 2 1 4 #> #> [[2]] #> H2 H4 H1 #> 2 4 1 # Intermediate graphs following the order of H2 and H4 graph_update(g, delete = orders[[2]])$intermediate_graphs[[3]] #> Updated graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: NA #> H3: 0 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 NA #> H2 NA NA NA NA #> H3 1 NA 0 NA #> H4 NA NA NA NA"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-adjusted-significance-levels","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain adjusted significance levels","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"equivalent way obtain rejections adjusting significance levels. hypothesis rejected p-value less equal adjusted significance level. adjusted significance levels calculated order adjusted p-values: \\(H_2 \\rightarrow H_1 \\rightarrow H_4\\), four steps checking rejections. First, \\(H_2\\) rejected adjusted significance level 0.5 * alpha. Second, \\(H_1\\) rejected adjusted significance level 0.75 * alpha, \\(H_2\\) rejected. Third, \\(H_4\\) rejected adjusted significance level 0.5 * alpha, \\(H_1\\) \\(H_2\\) rejected. Fourth finally, \\(H_3\\) rejected adjusted significance level alpha, \\(H_1\\), \\(H_2\\) \\(H_4\\) rejected. results can obtained specifying test_values = TRUE.","code":"test_results_test_values <- graph_test_shortcut( g, p = p_values, alpha = 0.025, test_values = TRUE ) test_results_test_values$test_values$results #> Step Hypothesis p Weight Alpha Inequality_holds #> 1 1 H2 0.010 0.50 0.025 TRUE #> 2 2 H1 0.018 0.75 0.025 TRUE #> 3 3 H4 0.006 0.50 0.025 TRUE #> 4 4 H3 0.105 1.00 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"power-simulation","dir":"Articles","previous_headings":"","what":"Power simulation","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given graph, interested “power” trial. single null hypothesis, power probability true positive - , rejecting null hypothesis significance level alpha alternative hypothesis true. multiple null hypotheses, multiple versions “power”. example, power reject least one hypothesis vs power reject hypotheses, given alternative hypotheses true. graphical multiple comparison procedures, also important understand power reject hypothesis, given multiplicity adjustment. Sometimes, may want customize definitions power define success. Thus power calculation important aspect trial design.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-marginal-power-for-primary-hypotheses","dir":"Articles","previous_headings":"Power simulation","what":"Input: Marginal power for primary hypotheses","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Assume primary endpoint occurrence unfavorable clinical event. evaluate treatment effect, proportion patients event calculated, lower proportion preferred. Assume proportions 0.181 low high doses, 0.3 control. Using equal randomization among three treatment groups, clinical trial team chooses total sample size 600 200 per group. leads marginal power 80% \\(H_1\\) \\(H_2\\), respectively, using two-sample test difference proportions unpooled variance one-sided significance level 0.025. calculation, use marginal power combine information treatment effect, nuisance parameter, sample sizes hypothesis. Note significance level used marginal power calculation must alpha, used significance level FWER control. addition, marginal power one--one relationship noncentrality parameter, illustrated .","code":"alpha <- 0.025 prop <- c(0.3, 0.181, 0.181) sample_size <- rep(200, 3) unpooled_variance <- prop[-1] * (1 - prop[-1]) / sample_size[-1] + prop[1] * (1 - prop[1]) / sample_size[1] noncentrality_parameter_primary <- -(prop[-1] - prop[1]) / sqrt(unpooled_variance) power_marginal_primary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_primary, sd = 1, lower.tail = FALSE ) names(power_marginal_primary) <- c(\"H1\", \"H2\") power_marginal_primary #> H1 H2 #> 0.8028315 0.8028315"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-marginal-power-for-secondary-hypotheses","dir":"Articles","previous_headings":"Power simulation","what":"Input: Marginal power for secondary hypotheses","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Assume secondary endpoint change total medication score baseline, continuous outcome. evaluate treatment effect, mean change calculated, greater reduction preferred. Assume mean change baseline reduction 7.5 8.25, respectively low high doses, 5 control. assume known common standard deviation 10. Given sample size 200 per treatment group, marginal power 71% 90% \\(H_3\\) \\(H_4\\), respectively, using two-sample \\(z\\)-test difference means one-sided significance level 0.025.","code":"mean_change <- c(5, 7.5, 8.25) sd <- rep(10, 3) variance <- sd[-1]^2 / sample_size[-1] + sd[1]^2 / sample_size[1] noncentrality_parameter_secondary <- (mean_change[-1] - mean_change[1]) / sqrt(variance) power_marginal_secondary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_secondary, sd = 1, lower.tail = FALSE ) names(power_marginal_secondary) <- c(\"H3\", \"H4\") power_marginal_secondary #> H3 H4 #> 0.7054139 0.9014809"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-correlation-structure-to-simulate-test-statistics","dir":"Articles","previous_headings":"Power simulation","what":"Input: Correlation structure to simulate test statistics","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"addition marginal power, also need make assumptions joint distribution test statistics. example, assume follow multivariate normal distribution means defined noncentrality parameters correlation matrix \\(R\\). obtain correlations, helpful understand two types correlations example. correlation two dose-control comparisons endpoint correlation endpoints. former correlation can calculated function sample size. example, correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_3+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. correlation test statistics \\(H_3\\) \\(H_4\\) . hand, correlation endpoints dose-control comparison often estimated based prior knowledge previous trials. Without information, assume \\(\\rho_{13}=\\rho_{24}=0.5\\). practice, one set correlation parameter try multiple values assess sensitivity assumption. Regarding correlation test statistics \\(H_1\\) \\(H_4\\) \\(H_2\\) \\(H_3\\), even difficult estimate. use simple product rule, means correlation product correlations two previously assumed correlations. example, \\(\\rho_{14}=\\rho_{12}*\\rho_{24}\\) \\(\\rho_{23}=\\rho_{12}*\\rho_{13}\\). practice, one may make assumptions instead using product rule.","code":"corr <- matrix(0, nrow = 4, ncol = 4) corr[1, 2] <- corr[3, 4] <- sqrt( sample_size[2] / sum(sample_size[1:2]) * sample_size[3] / sum(sample_size[c(1, 3)]) ) rho <- 0.5 corr[1, 3] <- corr[2, 4] <- rho corr[1, 4] <- corr[2, 3] <- corr[1, 2] * rho corr <- corr + t(corr) diag(corr) <- 1 colnames(corr) <- hyp_names rownames(corr) <- hyp_names corr #> H1 H2 H3 H4 #> H1 1.00 0.50 0.50 0.25 #> H2 0.50 1.00 0.25 0.50 #> H3 0.50 0.25 1.00 0.50 #> H4 0.25 0.50 0.50 1.00"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"user-defined-success-criteria","dir":"Articles","previous_headings":"Power simulation","what":"User-defined success criteria","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"mentioned earlier, multiple versions “power” multiple hypotheses. Commonly used “power” definitions include: Local power: probability hypothesis rejected (multiplicity adjustment) Expected . rejections: expected number rejections Power reject 1 : probability reject least one hypothesis Power reject : probability reject hypotheses default outputs graph_calculate_power function. addition, user can customize success criteria define versions “power”.","code":"success_fns <- list( # Probability to reject H1 H1 = function(x) x[1], # Expected number of rejections `Expected no. of rejections` = function(x) x[1] + x[2] + x[3] + x[4], # Probability to reject at least one hypothesis `AtLeast1` = function(x) x[1] | x[2] | x[3] | x[4], # Probability to reject all hypotheses `All` = function(x) x[1] & x[2] & x[3] & x[4], # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both hypotheses for the low dose or the high dose `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"output-simulate-power","dir":"Articles","previous_headings":"Power simulation","what":"Output: Simulate power","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given inputs, can estimate “power” via simulation graphical multiple comparison procedure one-sided significance level alpha = 0.025 using sim_n = 1e5 simulations random seed 1234. local power 0.758, 0.765, 0.689, 0.570, respectively \\(H_1, \\ldots, H_4\\). Note local power lower marginal power former adjusted multiplicity. power reject least one hypothesis 0.856 power reject hypotheses 0.512. expected number rejections 2.782. last two user-defined success criteria, probability reject \\(H_1\\) \\(H_2\\) 0.667, probability reject least one pair \\((H_1\\) \\(H_3)\\) \\((H_2\\) \\(H_4)\\) 0.747. see detailed outputs simulated p-values rejection decisions hypotheses, specify verbose = TRUE. produce lot outputs. allow flexible printing functions, user can change following: indented space default setting indent = 2 precision numeric values (.e., number significant digits) default setting precision = 4","code":"set.seed(1234) power_output <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c(power_marginal_primary, power_marginal_secondary), sim_success = success_fns ) power_output$power #> $power_local #> H1 H2 H3 H4 #> 0.76396 0.75887 0.56767 0.69133 #> #> $rejection_expected #> [1] 2.78183 #> #> $power_at_least_1 #> [1] 0.85557 #> #> $power_all #> [1] 0.51205 #> #> $power_success #> H1 Expected no. of rejections #> 0.76396 2.78183 #> AtLeast1 All #> 0.85557 0.51205 #> H1andH2 (H1andH3)or(H2andH4) #> 0.66726 0.74695 set.seed(1234) power_verbose_output <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c(power_marginal_primary, power_marginal_secondary), sim_success = success_fns, verbose = TRUE ) head(power_verbose_output$details$p_sim, 10) #> H1 H2 H3 H4 #> [1,] 0.0308204265 0.0120653993 0.0041185823 9.324338e-02 #> [2,] 0.0007933716 0.0006499046 0.0245177515 2.965604e-03 #> [3,] 0.0302991819 0.0595395828 0.0543082956 2.625834e-02 #> [4,] 0.0097433244 0.0033185711 0.0007417213 4.024688e-04 #> [5,] 0.0197134942 0.0086161835 0.0164182765 2.418325e-07 #> [6,] 0.0031206572 0.0067023099 0.0137441457 2.751703e-04 #> [7,] 0.0302208038 0.1423757994 0.0060382838 2.117403e-02 #> [8,] 0.0024975725 0.0294025573 0.0004142729 2.207786e-03 #> [9,] 0.0618994292 0.0387257108 0.3166125781 5.699791e-02 #> [10,] 0.3677921053 0.1895975134 0.0702264885 1.189651e-02 print(power_verbose_output, indent = 4, precision = 6) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 100,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 #> Marginal power: 0.802831 0.802831 0.705414 0.901481 #> #> Correlation: H1 H2 H3 H4 #> H1 1.00 0.50 0.50 0.25 #> H2 0.50 1.00 0.25 0.50 #> H3 0.50 0.25 1.00 0.50 #> H4 0.25 0.50 0.50 1.00 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 #> Local power: 0.76396 0.75887 0.56767 0.69133 #> #> Expected no. of rejections: 2.78183 #> Power to reject 1 or more: 0.85557 #> Power to reject all: 0.51205 #> #> Success measure Power #> H1 0.76396 #> Expected no. of rejections 2.78183 #> AtLeast1 0.85557 #> All 0.51205 #> H1andH2 0.66726 #> (H1andH3)or(H2andH4) 0.74695 #> #> Simulation details ($details) -------------------------------------------------- #> p_sim_H1 p_sim_H2 p_sim_H3 p_sim_H4 rej_H1 rej_H2 rej_H3 rej_H4 #> 3.08204e-02 1.20654e-02 4.11858e-03 9.32434e-02 FALSE TRUE FALSE FALSE #> 7.93372e-04 6.49905e-04 2.45178e-02 2.96560e-03 TRUE TRUE TRUE TRUE #> 3.02992e-02 5.95396e-02 5.43083e-02 2.62583e-02 FALSE FALSE FALSE FALSE #> 9.74332e-03 3.31857e-03 7.41721e-04 4.02469e-04 TRUE TRUE TRUE TRUE #> 1.97135e-02 8.61618e-03 1.64183e-02 2.41833e-07 TRUE TRUE TRUE TRUE #> 3.12066e-03 6.70231e-03 1.37441e-02 2.75170e-04 TRUE TRUE TRUE TRUE #> 3.02208e-02 1.42376e-01 6.03828e-03 2.11740e-02 FALSE FALSE FALSE FALSE #> 2.49757e-03 2.94026e-02 4.14273e-04 2.20779e-03 TRUE FALSE TRUE FALSE #> 6.18994e-02 3.87257e-02 3.16613e-01 5.69979e-02 FALSE FALSE FALSE FALSE #> 3.67792e-01 1.89598e-01 7.02265e-02 1.18965e-02 FALSE FALSE FALSE FALSE #> ... (Use `print(x, rows = )` for more)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Dong Xi. Author, maintainer. Ethan Brockmann. Author. Gilead Sciences, Inc.. Copyright holder, funder.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Xi D, Brockmann E (2024). graphicalMCP: Graphical multiple comparison procedures, version 0.2.2 edition. https://github.com/Gilead-BioStats/graphicalMCP.","code":"@Manual{, title = {{graphicalMCP}: Graphical multiple comparison procedures}, author = {Dong Xi and Ethan Brockmann}, edition = {version 0.2.2}, year = {2024}, url = {https://github.com/Gilead-BioStats/graphicalMCP}, }"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Graphical Multiple Comparison Procedures","text":"Graphical approaches multiple comparison procedures (MCPs) general framework control family-wise error rate strongly pre-specified significance level 0 < α < 1. approach includes many commonly used MCPs special cases transparent visualizing MCPs better communications. graphicalMCP designed design analyze graphical MCPs flexible, informative efficient way.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Graphical Multiple Comparison Procedures","text":"graphicalMCP currently CRAN can installed GitHub using following code:","code":"# install.packages(\"pak\") pak::pak(\"Gilead-BioStats/graphicalMCP\")"},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Graphical Multiple Comparison Procedures","text":"basic usage instructions, see vignette(\"graphicalMCP\") become familiar graphical MCP terminologies, see vignette(\"glossary\") see vignette(\"shortcut-testing\") sequentially rejective graphical multiple comparison procedures based Bonferroni tests see vignette(\"closed-testing\") graphical multiple comparison procedures based closure principle see vignette(\"graph-examples\") common multiple comparison procedures illustrated using graphicalMCP see vignette(\"generate-closure\") rationales generate closure weighting strategy graph see vignette(\"comparisons\") comparisons R packages view vignettes R properly installing graphicalMCP GitHub, can build vignettes devtools::install(build_vignettes = TRUE), use browseVignettes(\"graphicalMCP\") view full list vignettes","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"related-work","dir":"","previous_headings":"","what":"Related work","title":"Graphical Multiple Comparison Procedures","text":"Graphical MCPs - gMCP Lighter version gMCP removes rJava dependency - gMCPLite Graphical MCPs Simes tests - lrstat Built upon packages, hope implement graphical MCPs general framework, fewer dependencies simpler S3 classes, without losing computational efficiency.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Graphical Multiple Comparison Procedures","text":"Along authors contributors, thanks following people suggestions inspirations package: Frank Bretz, Willi Maurer, Ekkehard Glimm, Nan Chen, Jeremy Wildfire, Spencer Childress, Colleen McLaughlin, Matt Roumaya, Chelsea Dickens, Ron Yu owe debt gratitude authors gMCP pioneering work, without package nearly extensive .","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate adjusted p-values — adjust_p_bonferroni","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"intersection hypothesis, adjusted p-value smallest significance level intersection hypothesis can rejected. intersection hypothesis can rejected adjusted p-value less equal \\(\\alpha\\). Currently, three test types supported: Bonferroni tests graphicalMCP:::adjust_p_bonferroni(), Parametric tests graphicalMCP:::adjust_p_parametric(), Note one-sided tests required parametric tests. Simes tests graphicalMCP:::adjust_p_simes().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"","code":"adjust_p_bonferroni(p, hypotheses) adjust_p_parametric( p, hypotheses, test_corr = NULL, maxpts = 25000, abseps = 1e-06, releps = 0 ) adjust_p_simes(p, hypotheses)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match length hypotheses. hypotheses numeric vector hypothesis weights. Must vector values 0 & 1 (inclusive). length match length p. sum hypothesis weights exceed 1. test_corr (Optional) numeric matrix correlations test statistics, needed perform parametric tests using graphicalMCP:::adjust_p_parametric(). number rows columns correlation matrix match length p. maxpts (Optional) integer scalar maximum number function values, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 25000. abseps (Optional) numeric scalar absolute error tolerance, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 1e-6. releps (Optional) numeric scalar relative error tolerance double, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 0.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"single adjusted p-value intersection hypothesis.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"","code":"set.seed(1234) hypotheses <- c(H1 = 0.5, H2 = 0.25, H3 = 0.25) p <- c(0.019, 0.025, 0.05) # Bonferroni test graphicalMCP:::adjust_p_bonferroni(p, hypotheses) #> [1] 0.038 # Simes test graphicalMCP:::adjust_p_simes(p, hypotheses) #> [1] 0.03333333 # Parametric test # Using the `mvtnorm::GenzBretz` algorithm corr <- matrix(0.5, nrow = 3, ncol = 3) diag(corr) <- 1 graphicalMCP:::adjust_p_parametric(p, hypotheses, corr) #> [1] 0.03343516"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate adjusted hypothesis weights — adjust_weights_parametric","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"intersection hypothesis can rejected p-values less equal adjusted significance levels, adjusted hypothesis weights times \\(\\alpha\\). Bonferroni tests, adjusted hypothesis weights hypothesis weights intersection hypothesis. Additional adjustment needed parametric Simes tests: Parametric tests graphicalMCP:::adjust_weights_parametric(), Note one-sided tests required parametric tests. Simes tests graphicalMCP:::adjust_weights_simes().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"","code":"adjust_weights_parametric( matrix_weights, matrix_intersections, test_corr, alpha, test_groups, maxpts = 25000, abseps = 1e-06, releps = 0 ) adjust_weights_simes(matrix_weights, p, test_groups) c_value_function( x, hypotheses, test_corr, alpha, maxpts = 25000, abseps = 1e-06, releps = 0 ) solve_c_parametric( hypotheses, test_corr, alpha, maxpts = 25000, abseps = 1e-06, releps = 0 )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"matrix_weights (Optional) matrix hypothesis weights intersection hypotheses. can obtained second half columns output graph_generate_weights(). matrix_intersections (Optional) matrix hypothesis indicators intersection hypotheses. can obtained first half columns output graph_generate_weights(). test_corr (Optional) numeric matrix correlations test statistics, needed perform parametric tests using graphicalMCP:::adjust_p_parametric(). number rows columns correlation matrix match length p. alpha (Optional) numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups (Optional) list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. maxpts (Optional) integer scalar maximum number function values, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 25000. abseps (Optional) numeric scalar absolute error tolerance, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 1e-6. releps (Optional) numeric scalar relative error tolerance double, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 0. p (Optional) numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match length hypotheses. x root solve stats::uniroot(). hypotheses (Optional) numeric vector hypothesis weights. Must vector values 0 & 1 (inclusive). length match length p. sum hypothesis weights exceed 1.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"graphicalMCP:::adjust_weights_parametric() returns matrix dimensions matrix_weights, whose hypothesis weights adjusted according parametric tests. graphicalMCP:::adjust_weights_simes() returns matrix dimensions matrix_weights, whose hypothesis weights adjusted according Simes tests. graphicalMCP:::c_value_function() returns difference \\(\\alpha\\) Type error parametric test \\(c\\) value x, adjusted correlation test statistics using parametric tests based equation (6) Xi et al. (2017). graphicalMCP:::solve_c_parametric() returns c value adjusted correlation test statistics using parametric tests based equation (6) Xi et al. (2017).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"","code":"set.seed(1234) alpha <- 0.025 p <- c(0.018, 0.01, 0.105, 0.006) num_hyps <- length(p) g <- bonferroni_holm(rep(1 / 4, 4)) weighting_strategy <- graph_generate_weights(g) matrix_intersections <- weighting_strategy[, seq_len(num_hyps)] matrix_weights <- weighting_strategy[, -seq_len(num_hyps)] set.seed(1234) graphicalMCP:::adjust_weights_parametric( matrix_weights = matrix_weights, matrix_intersections = matrix_intersections, test_corr = diag(4), alpha = alpha, test_groups = list(1:4) ) #> H1 H2 H3 H4 #> 1 0.2523785 0.2523785 0.2523785 0.2523785 #> 2 0.3361503 0.3361503 0.3361503 0.0000000 #> 3 0.3361503 0.3361503 0.0000000 0.3361503 #> 4 0.5031647 0.5031647 0.0000000 0.0000000 #> 5 0.3361503 0.0000000 0.3361503 0.3361503 #> 6 0.5031647 0.0000000 0.5031647 0.0000000 #> 7 0.5031647 0.0000000 0.0000000 0.5031647 #> 8 1.0000000 0.0000000 0.0000000 0.0000000 #> 9 0.0000000 0.3361503 0.3361503 0.3361503 #> 10 0.0000000 0.5031647 0.5031647 0.0000000 #> 11 0.0000000 0.5031647 0.0000000 0.5031647 #> 12 0.0000000 1.0000000 0.0000000 0.0000000 #> 13 0.0000000 0.0000000 0.5031647 0.5031647 #> 14 0.0000000 0.0000000 1.0000000 0.0000000 #> 15 0.0000000 0.0000000 0.0000000 1.0000000 graphicalMCP:::adjust_weights_simes( matrix_weights = matrix_weights, p = p, test_groups = list(1:4) ) #> H4 H2 H1 H3 #> 1 0.2500000 0.5000000 0.7500000 1 #> 2 0.0000000 0.3333333 0.6666667 1 #> 3 0.3333333 0.6666667 1.0000000 1 #> 4 0.0000000 0.5000000 1.0000000 1 #> 5 0.3333333 0.3333333 0.6666667 1 #> 6 0.0000000 0.0000000 0.5000000 1 #> 7 0.5000000 0.5000000 1.0000000 1 #> 8 0.0000000 0.0000000 1.0000000 1 #> 9 0.3333333 0.6666667 0.6666667 1 #> 10 0.0000000 0.5000000 0.5000000 1 #> 11 0.5000000 1.0000000 1.0000000 1 #> 12 0.0000000 1.0000000 1.0000000 1 #> 13 0.5000000 0.5000000 0.5000000 1 #> 14 0.0000000 0.0000000 0.0000000 1 #> 15 1.0000000 1.0000000 1.0000000 1 graphicalMCP:::solve_c_parametric( hypotheses = matrix_weights[1, ], test_corr = diag(4), alpha = alpha ) #> [1] 1.009514"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"Graph objects different structures attributes graphicalMCP, gMCP, igraph R packages. functions convert different classes increase compatibility. Note igraph gMCP additional attributes vertices, edges, graph . conversion functions handle attributes related hypothesis names, hypothesis weights transition weights. attributes dropped converting.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"","code":"as_initial_graph(graph) # S3 method for graphMCP as_initial_graph(graph) # S3 method for igraph as_initial_graph(graph) as_graphMCP(graph) # S3 method for initial_graph as_graphMCP(graph) as_igraph(graph) # S3 method for initial_graph as_igraph(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"graph initial_graph object graphicalMCP package, graphMCP object gMCP package, igraph object igraph package, depending conversion type.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"as_graphMCP() returns graphMCP object gMCP package. as_igraph() returns igraph object igraph package. as_initial_graph() returns initial_graph object graphicalMCP package.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"Csardi, G., Nepusz, T., Traag, V., Horvat, S., Zanini, F., Noom, D., Mueller, K. (2024). igraph: Network analysis visualization R. R package version 2.0.3. https://CRAN.R-project.org/package=igraph. Rohmeyer, K., Klinglmueller, K. (2024). gMCP: Graph based multiple test procedures. R package version 0.8-17. https://cran.r-project.org/package=gMCP.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"","code":"g_graphicalMCP <- random_graph(5) if (requireNamespace(\"gMCP\", quietly = TRUE)) { g_gMCP <- as_graphMCP(g_graphicalMCP) all.equal(g_graphicalMCP, as_initial_graph(g_gMCP)) } #> [1] TRUE if (requireNamespace(\"igraph\", quietly = TRUE)) { g_igraph <- as_igraph(g_graphicalMCP) all.equal(g_graphicalMCP, as_initial_graph(g_igraph)) } #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":null,"dir":"Reference","previous_headings":"","what":"Find pairs of vertices that are connected in both directions — edge_pairs","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"initial graph, find pairs hypotheses connected directions. used plot graphs using plot.initial_graph().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"","code":"edge_pairs(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"graph initial graph returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"list vertex pairs connected directions. NULL pairs found.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"","code":"graphicalMCP:::edge_pairs(bonferroni_holm(hypotheses = rep(1 / 3, 3))) #> [[1]] #> [1] \"H2|H1\" #> #> [[2]] #> [1] \"H3|H1\" #> #> [[3]] #> [1] \"H1|H2\" #> #> [[4]] #> [1] \"H3|H2\" #> #> [[5]] #> [1] \"H1|H3\" #> #> [[6]] #> [1] \"H2|H3\" #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":null,"dir":"Reference","previous_headings":"","what":"Example graphs of commonly used multiple comparison procedures — bonferroni","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"Built-functions quickly generate select graphical multiple comparison procedures.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"","code":"bonferroni(hypotheses, hyp_names = NULL) bonferroni_holm(hypotheses, hyp_names = NULL) huque_etal(hyp_names = NULL) fallback(hypotheses, hyp_names = NULL) fallback_improved_1(hypotheses, hyp_names = NULL) fallback_improved_2(hypotheses, epsilon = 1e-04, hyp_names = NULL) fixed_sequence(num_hyps, hyp_names = NULL) simple_successive_1(hyp_names = NULL) simple_successive_2(hyp_names = NULL) random_graph(num_hyps, hyp_names = NULL) two_doses_two_primary_two_secondary(hyp_names = NULL) three_doses_two_primary_two_secondary(hyp_names = NULL)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"hypotheses (Optional) numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match num_hyps length hyp_names. sum hypothesis weights exceed 1. hyp_names (Optional) character vector hypothesis names. length match num_hyps length hypotheses. hyp_names specified, hypotheses named sequentially H1, H2, ....... epsilon (Optional) numeric scalar indicating value \\(\\epsilon\\) edge. much smaller value hypothesis transition weights. default 1e-4. num_hyps (Optional) Number hypotheses graphical multiple comparison procedure.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"S3 object returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Huque, M. F., Alosh, M., Bhore, R. (2011). Addressing multiplicity issues composite endpoint components clinical trials. Journal Biopharmaceutical Statistics, 21(4), 610-634. Maurer, W., Hothorn, L., Lehmacher, W. (1995). Multiple comparisons drug clinical trials preclinical assays: -priori ordered hypotheses. Biometrie der chemisch-pharmazeutischen Industrie, 6, 3-18. Westfall, P. H., Krishen, . (2001). Optimally weighted, fixed sequence gatekeeper multiple testing procedures. Journal Statistical Planning Inference, 99(1), 25-40. Wiens, B. L. (2003). fixed sequence Bonferroni procedure testing multiple endpoints. Pharmaceutical Statistics, 2(3), 211-215. Wiens, B. L., Dmitrienko, . (2005). fallback procedure evaluating single family hypotheses. Journal Biopharmaceutical Statistics, 15(6), 929-942. Xi, D., Bretz, F. (2019). Symmetric graphs equally weighted tests, application Hochberg procedure. Statistics Medicine, 38(27), 5268-5282.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"","code":"# Bretz et al. (2009) bonferroni(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 0 0 #> H2 0 0 0 #> H3 0 0 0 # Bretz et al. (2009) bonferroni_holm(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0 0.5 0.5 #> H2 0.5 0.0 0.5 #> H3 0.5 0.5 0.0 # Huque et al. (2011) huque_etal() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: 0 #> H3: 0 #> H4: 0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.0 0.0 0.0 1.0 #> H3 0.0 0.5 0.0 0.5 #> H4 0.0 1.0 0.0 0.0 # Wiens (2003) fallback(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 1 0 #> H2 0 0 1 #> H3 0 0 0 # Wiens and Dmitrienko (2005) fallback_improved_1(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0 1.0 0.0 #> H2 0.0 0.0 1.0 #> H3 0.5 0.5 0.0 # Bretz et al. (2009) fallback_improved_2(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0000 1.0000 0.0000 #> H2 0.9999 0.0000 0.0001 #> H3 1.0000 0.0000 0.0000 # Maurer et al. (1995); Westfall and Krishen (2001) fixed_sequence(num_hyps = 3) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: 0 #> H3: 0 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 1 0 #> H2 0 0 1 #> H3 0 0 0 # Figure 1 in Bretz et al. (2011) simple_successive_1() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 # Figure 4 in Bretz et al. (2011) simple_successive_2() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 # Create a random graph with three hypotheses random_graph(num_hyps = 3) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.250 #> H2: 0.375 #> H3: 0.375 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0000 0.3333 0.6667 #> H2 0.7500 0.0000 0.2500 #> H3 0.7500 0.2500 0.0000 # Figure 6 in Xi and Bretz et al. (2019) two_doses_two_primary_two_secondary() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.0 #> H3: 0.0 #> H4: 0.5 #> H5: 0.0 #> H6: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 #> H1 0.0000 0.5000 0.5000 0.0000 0.0000 0.0000 #> H2 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 #> H3 0.0000 0.9999 0.0000 0.0001 0.0000 0.0000 #> H4 0.0000 0.0000 0.0000 0.0000 0.5000 0.5000 #> H5 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000 #> H6 0.0001 0.0000 0.0000 0.0000 0.9999 0.0000 # Add another dose to Figure 6 in Xi and Bretz et al. (2019) three_doses_two_primary_two_secondary() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.0000 #> H3: 0.0000 #> H4: 0.3333 #> H5: 0.0000 #> H6: 0.0000 #> H7: 0.3333 #> H8: 0.0000 #> H9: 0.0000 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 H7 H8 H9 #> H1 0.00000 0.50000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> H2 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> H3 0.00000 0.99990 0.00000 0.00005 0.00000 0.00000 0.00005 0.00000 0.00000 #> H4 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 0.00000 0.00000 0.00000 #> H5 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 #> H6 0.00005 0.00000 0.00000 0.00000 0.99990 0.00000 0.00005 0.00000 0.00000 #> H7 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 #> H8 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 #> H9 0.00005 0.00000 0.00000 0.00005 0.00000 0.00000 0.00000 0.99990 0.00000"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"alternative hypotheses, distribution test statistics assumed multivariate normal distribution. Given distribution, function calculates power values graphical multiple comparison procedure. default, calculate local power, probability reject individual hypothesis, probability reject least one hypothesis, probability reject hypotheses, expected number rejections, probability user-defined success criteria. See vignette(\"shortcut-testing\") vignette(\"closed-testing\") illustration power calculation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"","code":"graph_calculate_power( graph, alpha = 0.025, power_marginal = rep(alpha, length(graph$hypotheses)), test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr = rep(list(NA), length(test_types)), sim_n = 1e+05, sim_corr = diag(length(graph$hypotheses)), sim_success = NULL, verbose = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"graph initial graph returned graph_create(). alpha numeric value one-sided overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing. Note one-sided tests supported. power_marginal numeric vector marginal power values use simulating p-values. See Details simulation process. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. sim_n integer scalar specifying number simulations. default 1e5. sim_corr numeric matrix correlations test statistics hypotheses. dimensions match number hypotheses graph. sim_success list user-defined functions specify success criteria. Functions must take one simulation's logical vector results input, return length-one logical vector. instance, \"success\" means rejecting hypotheses 1 2, use sim_success = list(\"1 2\" = function(x) x[1] && x[2]). list named, function body used name. Lambda functions also work starting R 4.1, e.g. sim_success = list(\\(x) x[3] || x[4]). verbose logical scalar specifying whether details power simulations included results. default verbose = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"power_report object list 3 elements: inputs - Input parameters, list : graph - Initial graph, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, test_types - Different types tests, test_corr - Correlation matrices parametric tests, sim_n - Number simulations, power_marginal - Marginal power hypotheses sim_corr - Correlation matrices simulations, sim_success - User-defined success criteria. power - list power values power_local - Local power hypotheses, proportion simulations hypothesis rejected, rejection_expected - Expected (average) number rejected hypotheses, power_at_least_1 - Power reject least one hypothesis, power_all - Power reject hypotheses, power_success - Power user-defined success, proportion simulations user-defined success criterion sim_success met. details - optional list datasets showing simulated p-values results simulation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"simulation-details","dir":"Reference","previous_headings":"","what":"Simulation details","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"power calculation based simulations. distribution simulate determined multivariate normal distribution power_marginal sim_corr. particular, power_marginal vector marginal power values hypotheses. marginal power power reject null hypothesis significance level alpha without multiplicity adjustment. value readily available standard software R packages. can determine mean multivariate normal distribution $$\\Phi^{-1}\\left(1-\\alpha\\right)-\\Phi^{-1}\\left(1-d_i\\right)$$, often called non-centrality parameter drift parameter. \\(d_i\\) marginal power power_marginal hypothesis \\(\\). Given correlation matrix sim_corr, can simulate multivariate normal distribution using mvtnorm R package (Genz Bretz, 2009). set simulated values can used calculate corresponding one-sided p-values. set p-values plugged graphical multiple comparison procedure determine hypotheses rejected. process repeated n_sim times produce power values proportion simulations particular success criterion met.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Bretz, F., Maurer, W., Hommel, G. (2011b). Test power considerations multiple endpoint analyses using sequentially rejective graphical procedures. Statistics Medicine, 30(13), 1489-1501. Genz, ., Bretz, F. (2009). Computation Multivariate Normal t Probabilities, series Lecture Notes Statistics. Springer-Verlag, Heidelberg. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011a). alpha <- 0.025 hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) marginal_power <- c(0.8, 0.8, 0.7, 0.9) corr1 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr1) <- 1 corr <- rbind( cbind(corr1, 0.5 * corr1), cbind(0.5 * corr1, corr1) ) success_fns <- list( # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both (H1 and H3) or (H2 and H4) `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) ) set.seed(1234) # Bonferroni tests power_output <- graph_calculate_power( g, alpha, sim_corr = corr, sim_n = 1e5, power_marginal = marginal_power, sim_success = success_fns ) # Parametric tests for H1 and H2; Simes tests for H3 and H4 # User-defined success: to reject H1 or H2; to reject H1 and H2 # Reduce the number of simulations to save time for package compilation graph_calculate_power( g, alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"simes\"), test_corr = list(corr1, NA), sim_n = 1e3, sim_success = list( function(.) .[1] || .[2], function(.) .[1] && .[2] ) ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> Parametric testing correlation: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H4) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 1,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 #> Marginal power: 0.025 0.025 0.025 0.025 #> #> Correlation: H1 H2 H3 H4 #> H1 1 0 0 0 #> H2 0 1 0 0 #> H3 0 0 1 0 #> H4 0 0 0 1 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 #> Local power: 0.020 0.011 0.000 0.000 #> #> Expected no. of rejections: 0.031 #> Power to reject 1 or more: 0.03 #> Power to reject all: 0 #> #> Success measure Power #> .[1] || .[2] 0.030 #> .[1] && .[2] 0.001 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the initial graph for a multiple comparison procedure — graph_create","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"graphical multiple comparison procedure represented 1) vector initial hypothesis weights hypotheses, 2) matrix initial transition weights transitions. function creates initial graph object using hypothesis weights transition weights.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"","code":"graph_create(hypotheses, transitions, hyp_names = NULL)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"hypotheses numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match row column lengths transitions. sum hypothesis weights exceed 1. transitions numeric matrix transition weights hypotheses graphical multiple comparison procedure. Must square matrix values 0 & 1 (inclusive). row column lengths match length hypotheses. row (Transition weights leaving hypothesis) can sum 1. diagonal entries (Transition weights hypothesis ) must 0s. hyp_names (Optional) character vector hypothesis names. provided, names hypotheses transitions used. names specified, hypotheses named sequentially H1, H2, .......","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"S3 object class initial_graph list 2 elements: Hypothesis weights hypotheses. Transition weights transitions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"validation-of-inputs","dir":"Reference","previous_headings":"","what":"Validation of inputs","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"Inputs also validated make sure validity graph: Hypothesis weights hypotheses numeric. Transition weights transitions numeric. Length hypotheses dimensions transitions match. Hypothesis weights hypotheses must non-negative sum 1. Transition weights transitions: Values must non-negative. Rows must sum 1. Diagonal entries must 0. Hypothesis names hyp_names override names hypotheses transitions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H11\", \"H12\", \"H21\", \"H22\") g <- graph_create(hypotheses, transitions, hyp_names) g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0 # Explicit names override names in `hypotheses` (with a warning) hypotheses <- c(h1 = 0.5, h2 = 0.5, h3 = 0, h4 = 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions, hyp_names) #> Warning: Hypothesis names specified - overriding names in #> `hypotheses` and `transitions` g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0 # Use names in `transitions` hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( H1 = c(0, 0, 1, 0), H2 = c(0, 0, 0, 1), H3 = c(0, 1, 0, 0), H4 = c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) g #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 # Unmatched names in `hypotheses` and `transitions` (with an error) hypotheses <- c(h1 = 0.5, h2 = 0.5, h3 = 0, h4 = 0) transitions <- rbind( H1 = c(0, 0, 1, 0), H2 = c(0, 0, 0, 1), H3 = c(0, 1, 0, 0), H4 = c(1, 0, 0, 0) ) # g <- graph_create(hypotheses, transitions) # When names are not specified, hypotheses are numbered sequentially as # H1, H2, ... hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) g #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"graphical multiple comparison procedure defines closed test procedure, tests intersection hypothesis reject individual hypothesis intersection hypotheses involving rejected. intersection hypothesis represents parameter space individual null hypotheses involved true simultaneously. closure based graph consists updated graphs (corresponding intersection hypotheses) combinations hypotheses deleted. graphical multiple comparison procedure \\(m\\) hypotheses, \\(2^{m}-1\\) updated graphs (intersection hypotheses), including initial graph (overall intersection hypothesis). weighting strategy graph consists hypothesis weights \\(2^{m}-1\\) updated graphs (intersection hypotheses). algorithm derive weighting strategy based Algorithm 1 Bretz et al. (2011).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"","code":"graph_generate_weights(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"graph initial graph returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"numeric matrix intersection hypotheses hypothesis weights. graphical multiple comparison procedure \\(m\\) hypotheses, number rows \\(2^{m}-1\\), corresponds intersection hypothesis. number columns \\(2\\cdot m\\). first \\(m\\) columns indicate individual hypotheses included given intersection hypothesis second half columns provide hypothesis weights individual hypothesis given intersection hypothesis.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"performance","dir":"Reference","previous_headings":"","what":"Performance","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"Generation intersection hypotheses closely related power set given set indices. number hypotheses increases, memory time usage can grow quickly (e.g., rate \\(O(2^n)\\)). also multiple ways implement Algorithm 1 Bretz et al. (2011). See vignette(\"generate-closure\") information generating intersection hypotheses comparisons different approaches calculate weighting strategies.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) graph_generate_weights(g) #> H1 H2 H3 H4 H1 H2 H3 H4 #> 1 1 1 1 1 0.5 0.5 0.0 0.0 #> 2 1 1 1 0 0.5 0.5 0.0 0.0 #> 3 1 1 0 1 0.5 0.5 0.0 0.0 #> 4 1 1 0 0 0.5 0.5 0.0 0.0 #> 5 1 0 1 1 0.5 0.0 0.0 0.5 #> 6 1 0 1 0 1.0 0.0 0.0 0.0 #> 7 1 0 0 1 0.5 0.0 0.0 0.5 #> 8 1 0 0 0 1.0 0.0 0.0 0.0 #> 9 0 1 1 1 0.0 0.5 0.5 0.0 #> 10 0 1 1 0 0.0 0.5 0.5 0.0 #> 11 0 1 0 1 0.0 1.0 0.0 0.0 #> 12 0 1 0 0 0.0 1.0 0.0 0.0 #> 13 0 0 1 1 0.0 0.0 0.5 0.5 #> 14 0 0 1 0 0.0 0.0 1.0 0.0 #> 15 0 0 0 1 0.0 0.0 0.0 1.0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":null,"dir":"Reference","previous_headings":"","what":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"multiple hypotheses rejected using graph_test_shortcut(), may multiple orderings sequences hypotheses rejected one one. default order graph_test_shortcut() based adjusted p-values, smallest largest. function graph_rejection_orderings() provides possible valid orders (sequences) rejections. Although order rejection affect final rejection decisions Bretz et al. (2009), different sequences offer different ways explain step--step process shortcut graphical multiple comparison procedures.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"","code":"graph_rejection_orderings(shortcut_test_result)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"shortcut_test_result graph_report object returned graph_test_shortcut().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"modified graph_report object containing valid orderings rejections hypotheses","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 shortcut_testing <- graph_test_shortcut(g, p, alpha, verbose = TRUE) # Reject H1, H2, and H4 shortcut_testing$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE # Default order of rejections: H2, H1, H4 shortcut_testing$details$del_seq #> [1] \"H2\" \"H1\" \"H4\" # There is another valid sequence of rejection: H2, H4, H1 graph_rejection_orderings(shortcut_testing)$valid_orderings #> [[1]] #> H2 H1 H4 #> 2 1 4 #> #> [[2]] #> H2 H4 H1 #> 2 4 1 #> # Finally, intermediate updated graphs can be obtained by providing the order # of rejections into `[graph_update()]` graph_update(g, delete = c(2, 4, 1)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Updated graph after deleting hypotheses 2, 4, 1 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.75 #> H2: NA #> H3: 0.00 #> H4: 0.25 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.000000 NA 0.666667 0.333333 #> H2 NA NA NA NA #> H3 0.500000 NA 0.000000 0.500000 #> H4 1.000000 NA 0.000000 0.000000 #> #> Step 2: Updated graph after removing hypotheses 2, 4 #> #> --- Hypothesis weights --- #> H1: 1 #> H2: NA #> H3: 0 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 NA #> H2 NA NA NA NA #> H3 1 NA 0 NA #> H4 NA NA NA NA #> #> Step 3: Updated graph after removing hypotheses 2, 4, 1 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform closed graphical multiple comparison procedures — graph_test_closure","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Closed graphical multiple comparison procedures, graphical multiple comparison procedures based closure, generate closure based graph consisting intersection hypotheses. tests intersection hypothesis rejects individual hypothesis intersection hypotheses involving rejected. intersection hypothesis represents parameter space individual null hypotheses involved true simultaneously. graphical multiple comparison procedure $m$ hypotheses, \\(2^m-1\\) intersection hypotheses. intersection hypothesis, test type chosen determine reject intersection hypothesis. Current choices test types include Bonferroni, Simes parametric. implementation offers general framework covering Bretz et al. (2011), Lu (2016), Xi et al. (2017). See vignette(\"closed-testing\") illustration closed test procedures interpretation outputs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"","code":"graph_test_closure( graph, p, alpha = 0.025, test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr = rep(list(NA), length(test_types)), verbose = FALSE, test_values = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. verbose logical scalar specifying whether details adjusted p-value calculations included results. verbose = TRUE, adjusted p-values provided intersection hypothesis. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. default test_values = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"graph_report object list 4 elements: inputs - Input parameters, list : graph - Initial graph, p - (Unadjusted raw) p-values, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, test_types - Different types tests, test_corr - Correlation matrices parametric tests. outputs - Output parameters, list : adjusted_p - Adjusted p-values, rejected - Rejected hypotheses, graph - Updated graph deleting rejected hypotheses. details - Verbose outputs adjusted p-values intersection hypotheses, verbose = TRUE. test_values - Adjusted significance levels, test_values = TRUE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"details-for-test-specification","dir":"Reference","previous_headings":"","what":"Details for test specification","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Test specification includes three components: test_groups, test_types, test_corr. Alignment among entries components important correct implementation. two ways provide test specification. first approach \"unnamed\" approach, assumes 3 components ordered way, .e., $n$-th element test_types test_corr apply $n$-th group test_groups. second \"named\" approach uses name element component connect element test_types test_corr correct element test_groups. Consistency ensured correct implementation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses # (H1 and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 # Closed graphical multiple comparison procedure using Bonferroni tests # Same results as `graph_test_shortcut(g, p, alpha)` graph_test_closure(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.024 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.024 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # Closed graphical multiple comparison procedure using parametric tests for # H1 and H2, and Bonferroni tests for H3 and H4 set.seed(1234) corr_list <- list(matrix(c(1, 0.5, 0.5, 1), nrow = 2), NA) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> bonferroni: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # The \"named\" approach to obtain the same results # Note that \"group2\" appears before \"group1\" in `test_groups` set.seed(1234) corr_list <- list(group1 = matrix(c(1, 0.5, 0.5, 1), nrow = 2), group2 = NA) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(group1 = 1:2, group2 = 3:4), test_types = c(group2 = \"bonferroni\", group1 = \"parametric\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> bonferroni: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # Closed graphical multiple comparison procedure using parametric tests for # H1 and H2, and Simes tests for H3 and H4 set.seed(1234) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(group1 = 1:2, group2 = 3:4), test_types = c(group1 = \"parametric\", group2 = \"simes\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"functions performs similarly graph_test_closure() graph_test_shortcut() optimized efficiently calculating power. example, generating weights calculating adjusted weights can done . Vectorization applied possible.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"","code":"graph_test_closure_fast(p, alpha, adjusted_weights, matrix_intersections) graph_test_shortcut_fast(p, alpha, adjusted_weights)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"p numeric vector one-sided p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value one-sided overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing. Note one-sided tests supported. adjusted_weights adjusted hypothesis weights, second half columns graph_generate_weights() output, adjusted appropriate test types (Bonferroni, Simes, parametric). matrix_intersections matrix hypothesis indicators weighting strategy, first half graph_generate_weights() output.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"logical integer vector indicating whether hypothesis can rejected .","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"","code":"set.seed(1234) alpha <- 0.025 p <- c(0.018, 0.01, 0.105, 0.006) num_hyps <- length(p) g <- bonferroni_holm(rep(1 / 4, 4)) weighting_strategy <- graph_generate_weights(g) matrix_intersections <- weighting_strategy[, seq_len(num_hyps), drop = FALSE] adjusted_weights <- weighting_strategy[, -seq_len(num_hyps), drop = FALSE] graphicalMCP:::graph_test_closure_fast( p, alpha, adjusted_weights, matrix_intersections ) #> H1 H2 H3 H4 #> FALSE FALSE FALSE TRUE graphicalMCP:::graph_test_shortcut_fast( p, alpha, adjusted_weights ) #> H1 H2 H3 H4 #> FALSE FALSE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"Shortcut graphical multiple comparison procedures sequentially rejective procedure based Bretz et al. (2009). $m$ hypotheses, $m$ steps obtain rejection decisions. procedure equivalent closed graphical multiple comparison procedures using Bonferroni tests intersection hypotheses, shortcut procedures faster perform. See vignette(\"shortcut-testing\") illustration shortcut procedures interpretation outputs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"","code":"graph_test_shortcut( graph, p, alpha = 0.025, verbose = FALSE, test_values = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric scalar overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. verbose logical scalar specifying whether details intermediate update graphs included results. verbose = TRUE, intermediate update graphs provided deleting hypothesis, rejected. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. order rejection based order adjusted p-values smallest largest. default test_values = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"S3 object class graph_report list 4 elements: inputs - Input parameters, list : graph - Initial graph, *p - (Unadjusted raw) p-values, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, list hypotheses graph_test_shortcut(), test_types - Different types tests, \"bonferroni\" graph_test_shortcut(). Output parameters outputs, list : adjusted_p - Adjusted p-values, rejected - Rejected hypotheses, graph - Updated graph deleting rejected hypotheses. details - Verbose outputs intermediate updated graphs, verbose = TRUE. test_values - Adjusted significance levels, test_values = TRUE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 graph_test_shortcut(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.020 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.020 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"hypothesis deleted, initial graph updated. deleted hypothesis hypothesis weight 0 transition weight 0. Remaining hypotheses updated hypothesis weights transition weights according Algorithm 1 Bretz et al. (2009).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"","code":"graph_update(graph, delete)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"graph initial graph returned graph_create(). delete logical integer vector, denoting hypotheses delete. logical vector results \"unordered mode\", means hypotheses corresponding TRUE delete deleted. sequence deletion follow sequence TRUE's delete. case, length logical vector must match number hypotheses graph. integer vector results \"ordered mode\", means delete specifies sequence hypotheses deleted indicating location deleted hypotheses, e.g., 1st, 2nd, etc. case, integer vector can length, must contain valid hypothesis numbers (greater 0, less equal number hypotheses graph).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"S3 object class updated_graph list 4 elements: initial_graph: initial graph object. updated_graph: updated graph object specified hypotheses deleted. deleted: numeric vector indicating hypotheses deleted. intermediate_graphs: using ordered mode, list intermediate updated graphs hypothesis deleted according sequence specified delete.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"sequence-of-deletion","dir":"Reference","previous_headings":"","what":"Sequence of deletion","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"multiple hypotheses deleted graph, many sequences deletion initial graph updated updated graph. interest updated graph hypotheses specified delete deleted, updated graph matter sequence deletion used. property proved Bretz et al. (2009). interest intermediate updated graph hypothesis deleted according sequence specified delete, integer vector delete specified detailed outputs provided.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" graph_update(g, delete = c(FALSE, TRUE, TRUE, FALSE)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 # Equivalent way in the \"ordered mode\" to obtain the updated graph after # deleting the second and third hypotheses # Additional intermediate updated graphs are also provided graph_update(g, delete = 2:3) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: 0.0 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 0 #> H2 NA NA NA NA #> H3 0 NA 0 1 #> H4 1 NA 0 0 #> #> Step 2: Updated graph after removing hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graphicalMCP-package.html","id":null,"dir":"Reference","previous_headings":"","what":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","title":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","text":"Graphical multiple comparison procedures (MCPs) control familywise error rate. class includes many commonly used procedures special cases. package low-dependency implementation graphical MCPs allow mixed types tests. also includes power simulations visualization graphical MCPs.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graphicalMCP-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","text":"Maintainer: Dong Xi dong.xi1@gilead.com Authors: Ethan Brockmann ethan.brockmann@atorusresearch.com contributors: Gilead Sciences, Inc. [copyright holder, funder]","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate inputs for testing and power simulations — test_input_val","title":"Validate inputs for testing and power simulations — test_input_val","text":"Validate inputs testing power simulations","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate inputs for testing and power simulations — test_input_val","text":"","code":"test_input_val( graph, p, alpha, test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr, verbose, test_values ) power_input_val(graph, sim_n, power_marginal, test_corr, success)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate inputs for testing and power simulations — test_input_val","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. verbose logical scalar specifying whether details adjusted p-value calculations included results. verbose = TRUE, adjusted p-values provided intersection hypothesis. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. default test_values = FALSE. sim_n integer scalar specifying number simulations. default 1e5. power_marginal numeric vector marginal power values use simulating p-values. See Details simulation process. success list user-defined functions specify success criteria. Functions must take one simulation's logical vector results input, return length-one logical vector. instance, \"success\" means rejecting hypotheses 1 2, use sim_success = list(\"1 2\" = function(x) x[1] && x[2]). list named, function body used name. Lambda functions also work starting R 4.1, e.g. sim_success = list(\\(x) x[3] || x[4]).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate inputs for testing and power simulations — test_input_val","text":"Returns graph invisibly","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 plot method for class initial_graph — plot.initial_graph","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"plot initial_graph translates hypotheses vertices transitions edges create network plot. Vertices labeled hypothesis names hypothesis weights, edges labeled transition weights. See vignette(\"graph-examples\") illustration commonly used multiple comparison procedure using graphs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"","code":"# S3 method for initial_graph plot( x, ..., v_palette = c(\"#6baed6\", \"#cccccc\"), layout = \"grid\", nrow = NULL, ncol = NULL, edge_curves = NULL, precision = 4, eps = NULL, background_color = \"white\", margins = c(0, 0, 0, 0) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"x object class initial_graph plot. ... arguments passed igraph::plot.igraph(). v_palette character vector length two specifying colors retained deleted hypotheses. extensive color customization must done vertex.color. layout igraph layout specification (See ?igraph.plotting), \"grid\", lays hypotheses left--right top--bottom. nrow ncol control grid shape. nrow integer scalar specifying number rows vertex grid. row column counts specified, vertices laid close square possible. ncol integer scalar specifying number columns vertex grid. row column counts specified, vertices laid close square possible. edge_curves named numeric vector specifying curvature specific edges. Edge pairs (two vertices share edge possible direction) detected automatically get 0.25 curvature. Adjust edges adding entry name \"vertex1|vertex2, adjust default edge pairs curvature adding entry name \"pairs\" - edge_curves = c(\"pairs\" = 0.5, \"H1|H3\" = 0.25, \"H3|H4\" = 0.75). precision integer scalar indicating number decimal places display. eps numeric scalar. transition weight eps displayed \\(\\epsilon\\), indicates edges infinitesimally small weights. See Bretz et al. (2009) details. background_color character scalar specifying background color whole plotting area. Passed directly graphics::par() (bg). margins length 4 numeric vector specifying margins plot. Defaults 0, since igraph plots tend large margins. passed directly graphics::par() (mar).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"NULL, plotting initial graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"customization-of-graphs","dir":"Reference","previous_headings":"","what":"Customization of graphs","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"values igraph::plot.igraph() get defaults changed graphicalMCP. values can still changed passing arguments plot.initial_graph(). new defaults: vertex.color = \"#6baed6\", vertex.label.color = \"black\", vertex.size = 20, edge.arrow.size = 1, edge.arrow.width = 1, edge.label.color = \"black\" asp = 0. Neither graphicalMCP igraph anything overlapping edge labels. run problem, vertices practically moved enough avoid collisions edge labels, using edge curves can help. igraph puts edge labels closer tail edge edge straight, closer head edge curved. setting edge's curve small value, effectively straight edge can shifted new position.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Xi, D., Bretz, F. (2019). Symmetric graphs equally weighted tests, application Hochberg procedure. Statistics Medicine, 38(27), 5268-5282.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) plot(g) # A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and four secondary hypotheses (H31, H32, H41, and H42) # See Figure 6 in Xi and Bretz (2019). hypotheses <- c(0.5, 0.5, 0, 0, 0, 0) epsilon <- 1e-5 transitions <- rbind( c(0, 0.5, 0.25, 0, 0.25, 0), c(0.5, 0, 0, 0.25, 0, 0.25), c(0, 0, 0, 0, 1, 0), c(epsilon, 0, 0, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0, 0, 0), c(0, 0, 0, 1, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H31\", \"H32\", \"H41\", \"H42\") g <- graph_create(hypotheses, transitions, hyp_names) plot_layout <- rbind( c(0.15, 0.5), c(0.65, 0.5), c(0, 0), c(0.5, 0), c(0.3, 0), c(0.8, 0) ) plot(g, layout = plot_layout, eps = epsilon, edge_curves = c(pairs = .5))"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 plot method for the class updated_graph — plot.updated_graph","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"Plotting updated graph light wrapper around plot.initial_graph(), changing default vertex color use gray deleted hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"","code":"# S3 method for updated_graph plot(x, ...)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"x object class updated_graph plot. ... Arguments passed plot.initial_graph v_palette character vector length two specifying colors retained deleted hypotheses. extensive color customization must done vertex.color. layout igraph layout specification (See ?igraph.plotting), \"grid\", lays hypotheses left--right top--bottom. nrow ncol control grid shape. nrow integer scalar specifying number rows vertex grid. row column counts specified, vertices laid close square possible. ncol integer scalar specifying number columns vertex grid. row column counts specified, vertices laid close square possible. edge_curves named numeric vector specifying curvature specific edges. Edge pairs (two vertices share edge possible direction) detected automatically get 0.25 curvature. Adjust edges adding entry name \"vertex1|vertex2, adjust default edge pairs curvature adding entry name \"pairs\" - edge_curves = c(\"pairs\" = 0.5, \"H1|H3\" = 0.25, \"H3|H4\" = 0.75). precision integer scalar indicating number decimal places display. eps numeric scalar. transition weight eps displayed \\(\\epsilon\\), indicates edges infinitesimally small weights. See Bretz et al. (2009) details. background_color character scalar specifying background color whole plotting area. Passed directly graphics::par() (bg). margins length 4 numeric vector specifying margins plot. Defaults 0, since igraph plots tend large margins. passed directly graphics::par() (mar).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"NULL, plotting updated graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" plot( graph_update( g, c(FALSE, TRUE, TRUE, FALSE) ), layout = \"grid\" )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class graph_report — print.graph_report","title":"S3 print method for the class graph_report — print.graph_report","text":"printed graph_report displays initial graph, p-values significance levels, rejection decisions, optional detailed test results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class graph_report — print.graph_report","text":"","code":"# S3 method for graph_report print(x, ..., precision = 4, indent = 2, rows = 10)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class graph_report — print.graph_report","text":"x object class graph_report print. ... values passed methods (currently unused) precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results. rows integer scalar indicating many rows detailed test results print.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class graph_report — print.graph_report","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class graph_report — print.graph_report","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 graph_test_shortcut(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.020 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.020 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class initial_graph — print.initial_graph","title":"S3 print method for the class initial_graph — print.initial_graph","text":"printed initial_graph displays header stating \"Initial graph\", hypothesis weights, transition weights.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class initial_graph — print.initial_graph","text":"","code":"# S3 method for initial_graph print(x, ..., precision = 4, indent = 0)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class initial_graph — print.initial_graph","text":"x object class initial_graph print. ... values passed methods (currently unused). precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 print method for the class initial_graph — print.initial_graph","text":"NULL, printing initial graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class initial_graph — print.initial_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class initial_graph — print.initial_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H11\", \"H12\", \"H21\", \"H22\") g <- graph_create(hypotheses, transitions, hyp_names) g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class power_report — print.power_report","title":"S3 print method for the class power_report — print.power_report","text":"printed power_report displays initial graph, testing simulation options, power outputs, optional detailed simulations test results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class power_report — print.power_report","text":"","code":"# S3 method for power_report print(x, ..., precision = 4, indent = 2, rows = 10)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class power_report — print.power_report","text":"x object class power_report print ... values passed methods (currently unused) precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results. rows integer scalar indicating many rows detailed test results print.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class power_report — print.power_report","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Bretz, F., Maurer, W., Hommel, G. (2011b). Test power considerations multiple endpoint analyses using sequentially rejective graphical procedures. Statistics Medicine, 30(13), 1489-1501.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class power_report — print.power_report","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). alpha <- 0.025 hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) marginal_power <- c(0.8, 0.8, 0.7, 0.9) corr1 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr1) <- 1 corr <- rbind( cbind(corr1, 0.5 * corr1), cbind(0.5 * corr1, corr1) ) success_fns <- list( # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both (H1 and H3) or (H2 and H4) `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) ) set.seed(1234) # Bonferroni tests power_output <- graph_calculate_power( g, alpha, sim_corr = corr, sim_n = 1e5, power_marginal = marginal_power, sim_success = success_fns )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class updated_graph — print.updated_graph","title":"S3 print method for the class updated_graph — print.updated_graph","text":"printed updated_graph displays initial graph, (final) updated graph, sequence intermediate updated graphs hypotheses deleted (available).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class updated_graph — print.updated_graph","text":"","code":"# S3 method for updated_graph print(x, ..., precision = 6, indent = 2)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class updated_graph — print.updated_graph","text":"x object class updated_graph print. ... values passed methods (currently unused). precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 print method for the class updated_graph — print.updated_graph","text":"NULL, printing updated graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class updated_graph — print.updated_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class updated_graph — print.updated_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" graph_update(g, delete = c(FALSE, TRUE, TRUE, FALSE)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 # Equivalent way in the \"ordered mode\" to obtain the updated graph after # deleting the second and third hypotheses # Additional intermediate updated graphs are also provided graph_update(g, delete = 2:3) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: 0.0 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 0 #> H2 NA NA NA NA #> H3 0 NA 0 1 #> H4 1 NA 0 0 #> #> Step 2: Updated graph after removing hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests for an intersection hypothesis — test_values_bonferroni","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"Tests intersection hypothesis","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"","code":"test_values_bonferroni(p, hypotheses, alpha, intersection = NA) test_values_parametric(p, hypotheses, alpha, intersection = NA, test_corr) test_values_simes(p, hypotheses, alpha, intersection = NA)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. hypotheses numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match row column lengths transitions. sum hypothesis weights exceed 1. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. intersection (optional) numeric scalar used name intersection hypothesis weighting strategy. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"data frame rows corresponding individual hypotheses involved intersection hypothesis hypothesis weights hypotheses. following columns: Intersection - Name intersection hypothesis, Hypothesis - Name individual hypothesis, Test - Test type individual hypothesis, p - (Unadjusted raw) p-values individual hypothesis, c_value- C value parametric tests, Weight - Hypothesis weight individual hypothesis, Alpha - Overall significance level \\(\\alpha\\), Inequality_holds - Indicator show p-value less equal significance level. Bonferroni Simes tests, significance level hypothesis weight times \\(\\alpha\\). parametric tests, significance level c value times hypothesis weight times \\(\\alpha\\).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"","code":"alpha <- 0.025 hypotheses <- c(H1 = 0.5, H2 = 0.5, H3 = 0, H4 = 0) p <- c(0.018, 0.01, 0.105, 0.006) graphicalMCP:::test_values_bonferroni(p, hypotheses, alpha) #> Intersection Hypothesis Test p c_value Weight Alpha #> H1 NA H1 bonferroni 0.018 0.5 0.025 #> H2 NA H2 bonferroni 0.010 0.5 0.025 #> H3 NA H3 bonferroni 0.105 0.0 0.025 #> H4 NA H4 bonferroni 0.006 0.0 0.025 #> Inequality_holds #> H1 FALSE #> H2 TRUE #> H3 FALSE #> H4 FALSE graphicalMCP:::test_values_parametric( p, hypotheses, alpha, test_corr = diag(4) ) #> Intersection Hypothesis Test p c_value Weight Alpha #> H1 NA H1 parametric 0.018 1.006329 0.5 0.025 #> H2 NA H2 parametric 0.010 1.006329 0.5 0.025 #> H3 NA H3 parametric 0.105 1.006329 0.0 0.025 #> H4 NA H4 parametric 0.006 1.006329 0.0 0.025 #> Inequality_holds #> H1 FALSE #> H2 TRUE #> H3 FALSE #> H4 FALSE graphicalMCP:::test_values_simes(p, hypotheses, alpha) #> Intersection Hypothesis Test p c_value Weight Alpha Inequality_holds #> 1 NA H1 simes 0.018 1.0 0.025 TRUE #> 2 NA H2 simes 0.010 0.5 0.025 TRUE #> 3 NA H3 simes 0.105 1.0 0.025 FALSE #> 4 NA H4 simes 0.006 0.0 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-010","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.0","title":"graphicalMCP 0.1.0","text":"First release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-011","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.1","title":"graphicalMCP 0.1.1","text":"Added compilation vignettes (#73) Removed duplicated columns “*” test values (#75)","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-012","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.2","title":"graphicalMCP 0.1.2","text":"Updated function documentation Updated references","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-020","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.0","title":"graphicalMCP 0.2.0","text":"Corrected typos Updated function documentation CRAN release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-021","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.1","title":"graphicalMCP 0.2.1","text":"Corrected typos First CRAN release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-022","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.2","title":"graphicalMCP 0.2.2","text":"Updated citations Resubmission first CRAN release","code":""}] +[{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"Apache License","title":"Apache License","text":"Version 2.0, January 2004 ","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_1-definitions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"1. Definitions","title":"Apache License","text":"“License” shall mean terms conditions use, reproduction, distribution defined Sections 1 9 document. “Licensor” shall mean copyright owner entity authorized copyright owner granting License. “Legal Entity” shall mean union acting entity entities control, controlled , common control entity. purposes definition, “control” means () power, direct indirect, cause direction management entity, whether contract otherwise, (ii) ownership fifty percent (50%) outstanding shares, (iii) beneficial ownership entity. “” (“”) shall mean individual Legal Entity exercising permissions granted License. “Source” form shall mean preferred form making modifications, including limited software source code, documentation source, configuration files. “Object” form shall mean form resulting mechanical transformation translation Source form, including limited compiled object code, generated documentation, conversions media types. “Work” shall mean work authorship, whether Source Object form, made available License, indicated copyright notice included attached work (example provided Appendix ). “Derivative Works” shall mean work, whether Source Object form, based (derived ) Work editorial revisions, annotations, elaborations, modifications represent, whole, original work authorship. purposes License, Derivative Works shall include works remain separable , merely link (bind name) interfaces , Work Derivative Works thereof. “Contribution” shall mean work authorship, including original version Work modifications additions Work Derivative Works thereof, intentionally submitted Licensor inclusion Work copyright owner individual Legal Entity authorized submit behalf copyright owner. purposes definition, “submitted” means form electronic, verbal, written communication sent Licensor representatives, including limited communication electronic mailing lists, source code control systems, issue tracking systems managed , behalf , Licensor purpose discussing improving Work, excluding communication conspicuously marked otherwise designated writing copyright owner “Contribution.” “Contributor” shall mean Licensor individual Legal Entity behalf Contribution received Licensor subsequently incorporated within Work.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_2-grant-of-copyright-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"2. Grant of Copyright License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable copyright license reproduce, prepare Derivative Works , publicly display, publicly perform, sublicense, distribute Work Derivative Works Source Object form.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_3-grant-of-patent-license","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"3. Grant of Patent License","title":"Apache License","text":"Subject terms conditions License, Contributor hereby grants perpetual, worldwide, non-exclusive, -charge, royalty-free, irrevocable (except stated section) patent license make, made, use, offer sell, sell, import, otherwise transfer Work, license applies patent claims licensable Contributor necessarily infringed Contribution(s) alone combination Contribution(s) Work Contribution(s) submitted. institute patent litigation entity (including cross-claim counterclaim lawsuit) alleging Work Contribution incorporated within Work constitutes direct contributory patent infringement, patent licenses granted License Work shall terminate date litigation filed.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_4-redistribution","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"4. Redistribution","title":"Apache License","text":"may reproduce distribute copies Work Derivative Works thereof medium, without modifications, Source Object form, provided meet following conditions: () must give recipients Work Derivative Works copy License; (b) must cause modified files carry prominent notices stating changed files; (c) must retain, Source form Derivative Works distribute, copyright, patent, trademark, attribution notices Source form Work, excluding notices pertain part Derivative Works; (d) Work includes “NOTICE” text file part distribution, Derivative Works distribute must include readable copy attribution notices contained within NOTICE file, excluding notices pertain part Derivative Works, least one following places: within NOTICE text file distributed part Derivative Works; within Source form documentation, provided along Derivative Works; , within display generated Derivative Works, wherever third-party notices normally appear. contents NOTICE file informational purposes modify License. may add attribution notices within Derivative Works distribute, alongside addendum NOTICE text Work, provided additional attribution notices construed modifying License. may add copyright statement modifications may provide additional different license terms conditions use, reproduction, distribution modifications, Derivative Works whole, provided use, reproduction, distribution Work otherwise complies conditions stated License.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_5-submission-of-contributions","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"5. Submission of Contributions","title":"Apache License","text":"Unless explicitly state otherwise, Contribution intentionally submitted inclusion Work Licensor shall terms conditions License, without additional terms conditions. Notwithstanding , nothing herein shall supersede modify terms separate license agreement may executed Licensor regarding Contributions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_6-trademarks","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"6. Trademarks","title":"Apache License","text":"License grant permission use trade names, trademarks, service marks, product names Licensor, except required reasonable customary use describing origin Work reproducing content NOTICE file.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_7-disclaimer-of-warranty","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"7. Disclaimer of Warranty","title":"Apache License","text":"Unless required applicable law agreed writing, Licensor provides Work (Contributor provides Contributions) “” BASIS, WITHOUT WARRANTIES CONDITIONS KIND, either express implied, including, without limitation, warranties conditions TITLE, NON-INFRINGEMENT, MERCHANTABILITY, FITNESS PARTICULAR PURPOSE. solely responsible determining appropriateness using redistributing Work assume risks associated exercise permissions License.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_8-limitation-of-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"8. Limitation of Liability","title":"Apache License","text":"event legal theory, whether tort (including negligence), contract, otherwise, unless required applicable law (deliberate grossly negligent acts) agreed writing, shall Contributor liable damages, including direct, indirect, special, incidental, consequential damages character arising result License use inability use Work (including limited damages loss goodwill, work stoppage, computer failure malfunction, commercial damages losses), even Contributor advised possibility damages.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"id_9-accepting-warranty-or-additional-liability","dir":"","previous_headings":"Terms and Conditions for use, reproduction, and distribution","what":"9. Accepting Warranty or Additional Liability","title":"Apache License","text":"redistributing Work Derivative Works thereof, may choose offer, charge fee , acceptance support, warranty, indemnity, liability obligations /rights consistent License. However, accepting obligations, may act behalf sole responsibility, behalf Contributor, agree indemnify, defend, hold Contributor harmless liability incurred , claims asserted , Contributor reason accepting warranty additional liability. END TERMS CONDITIONS","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/LICENSE.html","id":"appendix-how-to-apply-the-apache-license-to-your-work","dir":"","previous_headings":"","what":"APPENDIX: How to apply the Apache License to your work","title":"Apache License","text":"apply Apache License work, attach following boilerplate notice, fields enclosed brackets [] replaced identifying information. (Don’t include brackets!) text enclosed appropriate comment syntax file format. also recommend file class name description purpose included “printed page” copyright notice easier identification within third-party archives.","code":"Copyright 2023 Gilead Sciences Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Graphical multiple comparison procedures based on the closure principle","text":"Consider confirmatory clinical trial comparing test treatment (treatment) control treatment (control) disease. two doses treatment: low dose high dose. three endpoints included multiplicity adjustment strategy, primary endpoint (PE) two secondary endpoints (SE1 SE2). total, six null hypotheses: \\(H_1\\), \\(H_3\\) \\(H_5\\) primary hypothesis two secondary hypotheses respectively low dose versus control; \\(H_2\\), \\(H_4\\) \\(H_6\\) primary hypothesis two secondary hypotheses respectively high dose versus control. clinical considerations constrain structure multiple comparison procedures, can flexibly incorporated using graphical approaches. First, low high doses considered equally important, means rejecting primary hypothesis either dose versus control leads successful trial. Regarding secondary hypotheses, one tested corresponding primary hypothesis rejected. means \\(H_3\\) \\(H_5\\) tested \\(H_1\\) rejected; \\(H_4\\) \\(H_6\\) tested \\(H_2\\) rejected. addition, statistical considerations complete graph. primary hypotheses \\(H_1\\) \\(H_2\\) equal hypothesis weight 0.5. secondary hypotheses hypothesis weight 0. primary hypothesis rejected, weight propagate along three outgoing edges: one primary hypothesis two descendant secondary hypotheses. edge primary hypothesis transition weight 0.5; two edges descendant secondary hypotheses equal transition weight 0.25. secondary hypotheses dose-control comparison, edge transition weight 1 (close 1 allow \\(\\epsilon\\) edges). hypothesis weights dose-control comparison group propagated primary hypothesis dose-control comparison, hypotheses first dose-control comparison group deleted. specifications, can create following graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"create-a-graph","dir":"Articles","previous_headings":"Motivating example","what":"Create a graph","title":"Graphical multiple comparison procedures based on the closure principle","text":"","code":"hypotheses <- c(0.5, 0.5, 0, 0, 0, 0) epsilon <- 1e-5 transitions <- rbind( c(0, 0.5, 0.25, 0, 0.25, 0), c(0.5, 0, 0, 0.25, 0, 0.25), c(0, 0, 0, 0, 1, 0), c(epsilon, 0, 0, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0, 0, 0), c(0, 0, 0, 1, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\", \"H5\", \"H6\") g <- graph_create(hypotheses, transitions, hyp_names) plot_layout <- rbind( c(0.15, 0.5), c(0.65, 0.5), c(0, 0), c(0.5, 0), c(0.3, 0), c(0.8, 0) ) plot( g, layout = plot_layout, eps = epsilon, edge_curves = c(pairs = 0.8), vertex.size = 35 )"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"bonferroni-tests","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Bonferroni tests","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given set p-values \\(H_1, \\ldots, H_6\\), graphical multiple comparison procedure can performed control family-wise error rate (FWER) significance level alpha. one-sided p-values, alpha often set 0.025 (default). First, perform Bonferroni-based procedure using closure principle (Bretz et al. 2009). running procedure, none hypotheses rejected. results identical using graph_test_shortcut().","code":"p_values <- c(0.015, 0.013, 0.01, 0.007, 0.1, 0.0124) test_results <- graph_test_closure( g, p = p_values, alpha = 0.025, verbose = TRUE, test_values = TRUE ) test_results$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.026 0.026 0.028 0.028 0.100 0.028 test_results$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> FALSE FALSE FALSE FALSE FALSE FALSE # Same testing results as # 'graph_test_shortcut(g, p = p_values, alpha = 0.025)$outputs$rejected'"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"obtain-the-closure","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Bonferroni tests","what":"Obtain the closure","title":"Graphical multiple comparison procedures based on the closure principle","text":"investigate closure every intersection hypothesis rejected, one obtain detailed output specifying verbose = TRUE. hypotheses tested using Bonferroni tests, adjusted p-value every intersection hypothesis adjusted p-value group 1 (meaning hypotheses group Bonferroni tests). intersection hypothesis rejected adjusted p-value less equal alpha. Adjusted p-values initially calculated groups hypotheses. case one group, includes hypotheses, can . adjusted p-value intersection hypothesis minimum across groups within intersection. Finally, adjusted p-value individual hypothesis whole procedure equal maximum adjusted p-values across intersections involving hypothesis.","code":"test_results_verbose <- graph_test_closure( g, p = p_values, alpha = 0.025, verbose = TRUE ) head(test_results_verbose$details$results) #> Intersection H1 H2 H3 H4 H5 H6 adj_p_grp1 adj_p_inter reject_intersection #> 1 111111 0.5 0.5 0 0 0 0 0.026 0.026 FALSE #> 2 111110 0.5 0.5 0 0 0 NA 0.026 0.026 FALSE #> 3 111101 0.5 0.5 0 0 NA 0 0.026 0.026 FALSE #> 4 111100 0.5 0.5 0 0 NA NA 0.026 0.026 FALSE #> 5 111011 0.5 0.5 0 NA 0 0 0.026 0.026 FALSE #> 6 111010 0.5 0.5 0 NA 0 NA 0.026 0.026 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"obtain-adjusted-significance-levels","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Bonferroni tests","what":"Obtain adjusted significance levels","title":"Graphical multiple comparison procedures based on the closure principle","text":"equivalent way obtain rejections via adjusting significance levels. hypothesis rejected p-value less equal adjusted significance level. One can obtain adjusted significance levels every hypothesis every intersection hypothesis closure specifying test_values = TRUE. hypothesis rejected closed testing procedure intersection hypotheses involving rejected. intersection hypothesis rejected null hypotheses within rejected.","code":"test_results_test_values <- graph_test_closure( g, test_types = \"b\", p = p_values, alpha = 0.025, test_values = TRUE ) head(test_results_test_values$test_values$results) #> Intersection Hypothesis Test p Weight Alpha Inequality_holds #> 1 111111 H1 bonferroni 0.0150 0.5 0.025 FALSE #> 2 111111 H2 bonferroni 0.0130 0.5 0.025 FALSE #> 3 111111 H3 bonferroni 0.0100 0.0 0.025 FALSE #> 4 111111 H4 bonferroni 0.0070 0.0 0.025 FALSE #> 5 111111 H5 bonferroni 0.1000 0.0 0.025 FALSE #> 6 111111 H6 bonferroni 0.0124 0.0 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"mixed-procedures-for-graphical-approaches","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Mixed procedures for graphical approaches","title":"Graphical multiple comparison procedures based on the closure principle","text":"framework graphicalMCP allows mixture tests improve performance Bonferroni-based graphical approaches. can group hypotheses multiple subgroups perform separate test every subgroup. Currently, graphicalMCP supports Bonferroni, parametric Simes tests. connect results different subgroups hypotheses, Bonferroni tests used. , show two examples. first example applies parametric tests primary hypotheses (Xi et al. 2017), second example applies Simes tests two subgroups secondary hypotheses addition parametric tests primary hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"parametric-tests-for-primary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Mixed procedures for graphical approaches","what":"Parametric tests for primary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"example, assume test statistics primary hypotheses follow asymptotic bivariate normal distribution. null hypotheses \\(H_1\\) \\(H_2\\), mean distribution 0. correlation test statistics \\(H_1\\) \\(H_2\\) can calculated function sample size. Assume sample size control, low high doses \\(n_0\\), \\(n_1\\) \\(n_2\\), respectively. correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_2+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. intersection hypothesis \\(H_1\\cap H_2\\cap H_3\\cap H_4\\cap H_5\\cap H_6\\), hypothesis weights 0.5, 0.5, 0, 0, 0, 0, respectively \\(H_1,\\ldots, H_6\\). Assume one-sided p-values hypotheses \\(p_1,\\ldots,p_6\\), respectively. intersection hypothesis rejected Bonferroni test \\(p_1\\leq 0.5\\alpha\\) \\(p_2\\leq 0.5\\alpha\\). Alternatively, parametric test utilizes correlation test statistics \\(t_1=\\Phi^{-1}(1 - p_1)\\) \\(t_2=\\Phi^{-1}(1 - p_2)\\). intersection hypothesis can rejected \\(p_1\\leq c\\times 0.5\\alpha\\) \\(p_2\\leq c\\times 0.5\\alpha\\), \\(c\\) value adjustment due correlation \\(t_1\\) \\(t_2\\). specifically, \\(c\\) can solved solution \\(Pr\\{(p_1\\leq c\\times 0.5\\alpha)\\cup (p_2\\leq c\\times 0.5\\alpha)\\}=\\alpha\\). given correlation \\(\\rho_{12}\\), \\(c\\) value can solved using uniroot function mvtnorm package. example, \\(\\rho_{12}=0.5\\), \\(c\\) value 1.078. can obtain adjusted significance level \\(H_1\\) \\(H_2\\) \\(c\\times 0.5\\alpha\\). Alternatively, can calculate adjusted p-value \\(H_1\\cap H_2\\cap H_3\\cap H_4\\cap H_5\\cap H_6\\) \\(Pr\\{(P_1\\leq \\min{\\{p_1, p_2\\}})\\cup (P_2\\leq \\min{\\{p_1, p_2\\}})\\}\\). implement procedure, need create two subgroups: one \\(H_1\\) \\(H_2\\), one rest hypotheses. first subgroup hypotheses, apply parametric tests; second subgroup (subsets), apply Bonferroni tests. Three additional inputs needed: specify grouping information test_groups, identify types tests every subgroup test_types, provide correlation matrix parametric tests test_corr. Assume correlation 0.5 test statistics primary hypotheses. procedure rejects \\(H_1\\) \\(H_2\\), others. Compared Bonferroni-based graphical approach didn’t rejected hypothesis, illustrates power improvement using parametric tests Bonferroni tests.","code":"corr_12 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr_12) <- 1 test_results_parametric <- graph_test_closure( g, p = p_values, alpha = 0.025, test_groups = list(c(1, 2), 3:6), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(corr_12, NA), test_values = TRUE ) test_results_parametric$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.02413846 0.02413846 0.02800000 0.02800000 0.10000000 0.02800000 test_results_parametric$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> TRUE TRUE FALSE FALSE FALSE FALSE head(test_results_parametric$test_values$results) #> Intersection Hypothesis Test p c_value Weight Alpha #> 1 111111 H1 parametric 0.0150 1.0782936582 0.5 0.025 #> 2 111111 H2 parametric 0.0130 1.0782936582 0.5 0.025 #> 3 111111 H3 bonferroni 0.0100 0.0 0.025 #> 4 111111 H4 bonferroni 0.0070 0.0 0.025 #> 5 111111 H5 bonferroni 0.1000 0.0 0.025 #> 6 111111 H6 bonferroni 0.0124 0.0 0.025 #> Inequality_holds #> 1 FALSE #> 2 TRUE #> 3 FALSE #> 4 FALSE #> 5 FALSE #> 6 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"parametric-tests-for-primary-hypotheses-and-simes-tests-for-secondary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Mixed procedures for graphical approaches","what":"Parametric tests for primary hypotheses and Simes tests for secondary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"addition using parametric tests primary hypotheses, ways improve Bonferroni-based graphical approaches. One way apply Simes tests secondary hypotheses(Bretz et al. 2011; Lu 2016). Simes tests improve Bonferroni tests may reject intersection hypothesis p-values relatively small, even ’re larger adjusted significance levels Bonferroni tests. intersection hypothesis \\(H_3\\cap H_5\\), hypothesis weights 0.5 0.5, respectively \\(H_3\\) \\(H_5\\). intersection hypothesis rejected Bonferroni test \\(p_3\\leq 0.5\\alpha\\) \\(p_5\\leq 0.5\\alpha\\). addition conditions, Simes test can also reject intersection hypothesis \\(p_3\\) \\(p_5\\) less equal \\(\\alpha\\). order control Type error Simes test, distributional requirement needed, called \\(MTP_2\\) (Sarkar 1998). case, means correlation test statistics \\(H_3\\) \\(H_5\\) non-negative. illustrate possibility using mixed tests example, keep parametric tests primary hypotheses apply Simes tests secondary hypotheses. two sets secondary hypotheses: \\(H_3\\) \\(H_5\\) secondary hypotheses low dose versus control, \\(H_4\\) \\(H_6\\) secondary hypotheses high dose versus control. believed correlation test statistics \\(H_3\\) \\(H_5\\) non-negative case \\(H_4\\) \\(H_6\\). Thus one can apply Simes tests \\(H_3\\) \\(H_5\\), separately \\(H_4\\) \\(H_6\\). Note different applying Simes tests \\(H_3\\ldots,H_6\\) requires stronger \\(MTP_2\\) condition. implement procedure, create three subgroups: one \\(H_1\\) \\(H_2\\), one \\(H_3\\) \\(H_5\\), one \\(H_4\\) \\(H_6\\). first subgroup hypotheses, apply parametric tests; second third subgroups, apply separate Simes tests. Assume correlation 0.5 test statistics primary hypotheses. procedure rejects \\(H_1\\), \\(H_2\\), \\(H_4\\), \\(H_6\\), \\(H_3\\). Compared results using parametric tests primary hypotheses (Bonferroni tests secondary hypotheses), \\(H_3\\), \\(H_4\\) \\(H_6\\) additional hypotheses rejected using Simes tests, showing power improvement using Simes tests.","code":"test_results_parametric_simes <- graph_test_closure( g, p = p_values, alpha = 0.025, test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), test_values = TRUE ) test_results_parametric_simes$outputs$adjusted_p #> H1 H2 H3 H4 H5 H6 #> 0.02413846 0.02413846 0.02480008 0.02480000 0.10000000 0.02480008 test_results_parametric_simes$outputs$rejected #> H1 H2 H3 H4 H5 H6 #> TRUE TRUE TRUE TRUE FALSE TRUE head(test_results_parametric_simes$test_values$results) #> Intersection Hypothesis Test p c_value Weight Alpha #> 1 111111 H1 parametric 0.0150 1.0782936582 0.5 0.025 #> 2 111111 H2 parametric 0.0130 1.0782936582 0.5 0.025 #> 3 111111 H3 simes 0.0100 0.0 0.025 #> 4 111111 H5 simes 0.1000 0.0 0.025 #> 5 111111 H4 simes 0.0070 0.0 0.025 #> 6 111111 H6 simes 0.0124 0.0 0.025 #> Inequality_holds #> 1 FALSE #> 2 TRUE #> 3 FALSE #> 4 FALSE #> 5 FALSE #> 6 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"power-calculation","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle","what":"Power calculation","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given graph, trial team often interested power trial. single null hypothesis, power probability reject null hypothesis significance level alpha alternative hypothesis true (.e. true positive). multiple null hypotheses, multiple version power. example, power reject least one hypothesis power reject hypotheses, given alternative hypotheses true. graphical multiple comparison procedures, also important understand power reject hypothesis, given multiplicity adjustment. Sometimes, team may want customize definitions power define success. Thus power calculation important aspect trial design.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-marginal-power-for-primary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Marginal power for primary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"Assume primary endpoint occurrence unfavorable clinical event. evaluate treatment effect, proportion patients event calculated lower better. Assume proportions 0.181 low high doses, 0.3 control. Using equal randomization among three treatment groups, clinical trial team chooses total sample size 600 200 per group. leads marginal power 80% \\(H_1\\) \\(H_2\\), respectively, using two-sample test difference proportions unpooled variance one-sided significance level 0.025. calculation, use marginal power combine information treatment effect, nuisance parameter, sample sizes hypothesis. Note significance level used marginal power alpha used power calculation significance level FWER control. addition, marginal power one--one relationship noncentrality parameter, illustrated .","code":"alpha <- 0.025 prop <- c(0.3, 0.181, 0.181) sample_size <- rep(200, 3) unpooled_variance <- prop[-1] * (1 - prop[-1]) / sample_size[-1] + prop[1] * (1 - prop[1]) / sample_size[1] noncentrality_parameter_primary <- -(prop[-1] - prop[1]) / sqrt(unpooled_variance) marginal_power_primary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_primary, sd = 1, lower.tail = FALSE ) names(marginal_power_primary) <- c(\"H1\", \"H2\") marginal_power_primary #> H1 H2 #> 0.8028315 0.8028315"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-marginal-power-for-secondary-hypotheses","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Marginal power for secondary hypotheses","title":"Graphical multiple comparison procedures based on the closure principle","text":"Assume secondary endpoint (SE1) change total medication score baseline, continuous outcome. Also assume secondary endpoint (SE2) change another medication score baseline, continuous outcome contains fewer categories compared SE1. evaluate treatment effect, mean change calculated reduction better. Assume mean change baseline SE1 reduction 7.5 8.25, respectively low high doses, 5 control. Also assume mean change baseline SE2 reduction 8 9, respectively low high doses, 6 control. assume known common standard deviation 10. Given sample size 200 per treatment group, marginal power 71% 90% \\(H_3\\) \\(H_4\\), respectively 52% 85% \\(H_5\\) \\(H_6\\), respectively using two-sample \\(z\\)-test difference means one-sided significance level 0.025.","code":"mean_change_se1 <- c(5, 7.5, 8.25) sd <- rep(10, 3) variance <- sd[-1]^2 / sample_size[-1] + sd[1]^2 / sample_size[1] noncentrality_parameter_se1 <- (mean_change_se1[-1] - mean_change_se1[1]) / sqrt(variance) marginal_power_se1 <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_se1, sd = 1, lower.tail = FALSE ) names(marginal_power_se1) <- c(\"H3\", \"H4\") marginal_power_se1 #> H3 H4 #> 0.7054139 0.9014809 mean_change_se2 <- c(6, 8, 9) noncentrality_parameter_se2 <- (mean_change_se2[-1] - mean_change_se2[1]) / sqrt(variance) marginal_power_se2 <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_se2, sd = 1, lower.tail = FALSE ) names(marginal_power_se2) <- c(\"H5\", \"H6\") marginal_power_se2 #> H5 H6 #> 0.5159678 0.8508384"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"input-correlation-structure-to-simulate-test-statistics","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Input: Correlation structure to simulate test statistics","title":"Graphical multiple comparison procedures based on the closure principle","text":"addition marginal power, also need make assumptions joint distribution test statistics. example, assume follow multivariate normal distribution means ’re defined noncentrality parameters correlation matrix \\(R\\). obtain correlations, helpful understand two types correlations example. correlation two dose-control comparisons endpoint correlation endpoints. former correlation can calculated function sample size. example, correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_3+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. correlation test statistics \\(H_3\\) \\(H_4\\) \\(H_5\\) \\(H_6\\) . hand, correlation endpoints dose-control comparison often estimated based prior knowledge previous trials. Without information, assume \\(\\rho_{13}=\\rho_{15}=\\rho_{24}=\\rho_{26}=\\rho_{35}=\\rho_{46}=0.5\\). practice, one set correlation parameter try multiple values assess sensitivity assumption. Regarding correlation test statistics \\(H_1\\) \\(H_4 (H_6)\\) \\(H_2\\) \\(H_3 (H_5)\\), even difficult estimate. use simple product rule, means correlation product correlations two previously assumed correlations. example, \\(\\rho_{14}=\\rho_{12}*\\rho_{24}\\) \\(\\rho_{23}=\\rho_{12}*\\rho_{13}\\). practice, assumptions may made tested, instead using product rule.","code":"corr <- matrix(0, nrow = 6, ncol = 6) corr[1, 2] <- corr[3, 4] <- corr[5, 6] <- sqrt( sample_size[2] / sum(sample_size[1:2]) * sample_size[3] / sum(sample_size[c(1, 3)]) ) rho <- 0.5 corr[1, 3] <- corr[1, 5] <- corr[2, 4] <- corr[2, 6] <- corr[3, 5] <- corr[4, 6] <- rho corr[1, 4] <- corr[1, 6] <- corr[2, 3] <- corr[2, 5] <- corr[1, 2] * rho corr[3, 6] <- corr[1, 3] * corr[1, 6] corr[4, 5] <- corr[1, 4] * corr[1, 6] corr <- corr + t(corr) diag(corr) <- 1 colnames(corr) <- hyp_names rownames(corr) <- hyp_names corr #> H1 H2 H3 H4 H5 H6 #> H1 1.00 0.50 0.500 0.2500 0.5000 0.250 #> H2 0.50 1.00 0.250 0.5000 0.2500 0.500 #> H3 0.50 0.25 1.000 0.5000 0.5000 0.125 #> H4 0.25 0.50 0.500 1.0000 0.0625 0.500 #> H5 0.50 0.25 0.500 0.0625 1.0000 0.500 #> H6 0.25 0.50 0.125 0.5000 0.5000 1.000"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"user-defined-success-criteria","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"User-defined success criteria","title":"Graphical multiple comparison procedures based on the closure principle","text":"mentioned earlier, multiple versions “power” multiple hypotheses. Commonly used “power” definitions include: - Local power: probability hypothesis rejected (multiplicity adjustment) - Expected . rejections: expected number rejections - Power reject 1 : probability reject least one hypothesis - Power reject : probability reject hypotheses default outputs graph_calculate_power function. addition, user customize success criteria define versions “power”.","code":"success_fns <- list( # Probability to reject H1 H1 = function(x) x[1], # Expected number of rejections `Expected no. of rejections` = function(x) x[1] + x[2] + x[3] + x[4] + x[5] + x[6], # Probability to reject at least one hypothesis `AtLeast1` = function(x) x[1] | x[2] | x[3] | x[4] | x[5] | x[6], # Probability to reject all hypotheses `All` = function(x) x[1] & x[2] & x[3] & x[4] & x[5] & x[6], # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject all hypotheses for the low dose or the high dose `(H1andH3andH5)or(H2andH4andH6)` <- function(x) (x[1] & x[3] & x[5]) | (x[2] & x[4] & x[6]) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/closed-testing.html","id":"output-calculate-power","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure based on the closure principle > Power calculation","what":"Output: Calculate power","title":"Graphical multiple comparison procedures based on the closure principle","text":"Given inputs, can calculate power via simulation graphical multiple comparison procedure one-sided significance level alpha = 0.025 using sim_n = 1e5 simulations random seed 1234. three procedures compare: Bonferroni-based procedure, procedure using parametric tests primary hypotheses, procedure using parametric tests primary hypotheses Simes tests two sets secondary hypotheses separately. local power hypotheses \\(H_1, \\ldots, H_6\\) - 0.760, 0.752, 0.510, 0.665, 0.391, 0.625, respectively using Bonferroni-based procedure, - 0.764, 0.756, 0.511, 0.668, 0.392, 0.628, respectively using procedure using parametric tests primary hypotheses, - 0.764, 0.757, 0.521, 0.673, 0.402, 0.633, respectively using procedure using parametric tests primary hypotheses Simes tests two sets secondary hypotheses separately. Note local power improved hypotheses parametric tests Simes tests applied Bonferroni-based procedure. see detailed outputs simulated p-values rejection decisions hypotheses, can specify verbose = TRUE. produce lot outputs. allow flexible printing functions, user can change following: - indented space default setting indent = 2 - precision numeric values (.e., number decimal places) default setting precision = 6","code":"set.seed(1234) power_bonferroni <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), sim_success = success_fns ) round(power_bonferroni$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.760 0.752 0.510 0.665 0.391 0.625 set.seed(1234) power_parametric <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), 3:6), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(corr_12, NA), sim_success = success_fns ) round(power_parametric$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.764 0.756 0.511 0.668 0.392 0.628 set.seed(1234) power_parametric_simes <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), sim_success = success_fns ) round(power_parametric_simes$power$power_local, 3) #> H1 H2 H3 H4 H5 H6 #> 0.764 0.757 0.521 0.673 0.402 0.633 set.seed(1234) power_verbose_output_parametric_simes <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c( marginal_power_primary, marginal_power_se1, marginal_power_se2 ), test_groups = list(c(1, 2), c(3, 5), c(4, 6)), test_types = c(\"parametric\", \"simes\", \"simes\"), test_corr = list(corr_12, NA, NA), sim_success = success_fns, verbose = TRUE ) head(power_verbose_output_parametric_simes$details$p_sim, 10) #> H1 H2 H3 H4 H5 #> [1,] 0.0236514114 6.962444e-03 3.835101e-03 0.0615622415 0.0034034237 #> [2,] 0.0367030430 4.681135e-02 6.857853e-02 0.0284812435 0.1496042440 #> [3,] 0.0157541925 6.543826e-03 1.152738e-03 0.0007655046 0.0836186744 #> [4,] 0.0053369856 8.699959e-07 9.952719e-03 0.0002429371 0.0369937655 #> [5,] 0.0342665326 1.788794e-01 6.202961e-03 0.0305855529 0.0461642736 #> [6,] 0.0011139852 1.783703e-02 6.083855e-02 0.0087065723 0.3865009844 #> [7,] 0.2540774514 2.101193e-01 2.616673e-02 0.0277425681 0.0092489689 #> [8,] 0.0908135583 4.433230e-02 1.903718e-01 0.0418782572 0.3996511810 #> [9,] 0.0739568465 4.728371e-02 3.778643e-01 0.0296172396 0.4446759145 #> [10,] 0.0003353917 1.048743e-03 1.246528e-05 0.0032298980 0.0001601294 #> H6 #> [1,] 0.0018417304 #> [2,] 0.0552141940 #> [3,] 0.0255279965 #> [4,] 0.0001345536 #> [5,] 0.0666051161 #> [6,] 0.0867387423 #> [7,] 0.0297658510 #> [8,] 0.1097032475 #> [9,] 0.0620564532 #> [10,] 0.0114581872 print(power_verbose_output_parametric_simes, indent = 4, precision = 6 ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> H5: 0.0 #> H6: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 #> H1 0.00000 0.50000 0.25000 0.00000 0.25000 0.00000 #> H2 0.50000 0.00000 0.00000 0.25000 0.00000 0.25000 #> H3 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 #> H4 0.00001 0.00000 0.00000 0.00000 0.00000 0.99999 #> H5 0.00000 0.00001 0.99999 0.00000 0.00000 0.00000 #> H6 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 #> #> Alpha = 0.025 #> #> Parametric testing correlation: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H5) #> simes: (H4, H6) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 100,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 H5 H6 #> Marginal power: 0.802831 0.802831 0.705414 0.901481 0.515968 0.850838 #> #> Correlation: H1 H2 H3 H4 H5 H6 #> H1 1.0000 0.5000 0.5000 0.2500 0.5000 0.2500 #> H2 0.5000 1.0000 0.2500 0.5000 0.2500 0.5000 #> H3 0.5000 0.2500 1.0000 0.5000 0.5000 0.1250 #> H4 0.2500 0.5000 0.5000 1.0000 0.0625 0.5000 #> H5 0.5000 0.2500 0.5000 0.0625 1.0000 0.5000 #> H6 0.2500 0.5000 0.1250 0.5000 0.5000 1.0000 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 H5 H6 #> Local power: 0.76437 0.75656 0.52086 0.67302 0.40234 0.63292 #> #> Expected no. of rejections: 3.75007 #> Power to reject 1 or more: 0.86277 #> Power to reject all: 0.32537 #> #> Success measure Power #> H1 0.76437 #> Expected no. of rejections 3.75007 #> AtLeast1 0.86277 #> All 0.32537 #> H1andH2 0.65816 #> 0.63324 #> #> Simulation details ($details) -------------------------------------------------- #> p_sim_H1 p_sim_H2 p_sim_H3 p_sim_H4 p_sim_H5 p_sim_H6 rej_H1 #> 2.36514e-02 6.96244e-03 3.83510e-03 6.15622e-02 3.40342e-03 1.84173e-03 FALSE #> 3.67030e-02 4.68113e-02 6.85785e-02 2.84812e-02 1.49604e-01 5.52142e-02 FALSE #> 1.57542e-02 6.54383e-03 1.15274e-03 7.65505e-04 8.36187e-02 2.55280e-02 TRUE #> 5.33699e-03 8.69996e-07 9.95272e-03 2.42937e-04 3.69938e-02 1.34554e-04 TRUE #> 3.42665e-02 1.78879e-01 6.20296e-03 3.05856e-02 4.61643e-02 6.66051e-02 FALSE #> 1.11399e-03 1.78370e-02 6.08385e-02 8.70657e-03 3.86501e-01 8.67387e-02 TRUE #> 2.54077e-01 2.10119e-01 2.61667e-02 2.77426e-02 9.24897e-03 2.97659e-02 FALSE #> 9.08136e-02 4.43323e-02 1.90372e-01 4.18783e-02 3.99651e-01 1.09703e-01 FALSE #> 7.39568e-02 4.72837e-02 3.77864e-01 2.96172e-02 4.44676e-01 6.20565e-02 FALSE #> 3.35392e-04 1.04874e-03 1.24653e-05 3.22990e-03 1.60129e-04 1.14582e-02 TRUE #> rej_H2 rej_H3 rej_H4 rej_H5 rej_H6 #> TRUE FALSE FALSE FALSE TRUE #> FALSE FALSE FALSE FALSE FALSE #> TRUE TRUE TRUE FALSE FALSE #> TRUE TRUE TRUE FALSE TRUE #> FALSE FALSE FALSE FALSE FALSE #> TRUE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> FALSE FALSE FALSE FALSE FALSE #> TRUE TRUE TRUE TRUE TRUE #> ... (Use `print(x, rows = )` for more)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Comparisons with other packages","text":"two R packages cover graphical multiple comparison procedures (MCPs): gMCP (Rohmeyer Klinglmueller 2024) lrstat (Lu 2023). development graphicalMCP benefited two packages. provide comparisons graphicalMCP packages respect key functions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"list-of-comparisons","dir":"Articles","previous_headings":"","what":"List of comparisons","title":"Comparisons with other packages","text":"graphicalMCP::graph_generate_weights() gMCP::generateWeights() graphicalMCP::graph_test_shortcut() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower() graphicalMCP::graph_test_closure() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower() graphicalMCP::graph_test_closure() gMCP::gMCP() graphicalMCP::graph_calculate_power() gMCP::calcPower()","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"comparisons-of-weighting-strategies","dir":"Articles","previous_headings":"","what":"Comparisons of weighting strategies","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. Weighting strategies following two functions compared: graphicalMCP::graph_generate_weights() gMCP::generateWeights(). process repeated 1000 times. Weighting strategies matched 1000 cases.","code":"set.seed(1234) identical <- NULL for (i in 1:1000) { graph <- random_graph(5) graphicalmcp_weights <- graphicalMCP::graph_generate_weights(graph) dimnames(graphicalmcp_weights) <- list(NULL, NULL) gmcp_weights <- gMCP::generateWeights(graph$transitions, graph$hypotheses) gmcp_weights <- gmcp_weights[nrow(gmcp_weights):1, ] # Reorder rows identical <- c( identical, all.equal(gmcp_weights, graphicalmcp_weights, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing","dir":"Articles","previous_headings":"Comparisons of sequentially rejective procedures based on Bonferroni tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_shortcut() gMCP::gMCP(). process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"set.seed(1234) alpha <- 0.025 identical <- NULL for (i in 1:10000) { graph <- random_graph(5) p <- runif(5, 0, alpha) graphicalmcp_test_shortcut <- graph_test_shortcut(graph, p, alpha = alpha)$outputs$adjusted_p gmcp_test_shortcut <- gMCP(as_graphMCP(graph), p, alpha = alpha)@adjPValues identical <- c( identical, all.equal(graphicalmcp_test_shortcut, gmcp_test_shortcut, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations","dir":"Articles","previous_headings":"Comparisons of sequentially rejective procedures based on Bonferroni tests","what":"Power simulations","title":"Comparisons with other packages","text":"random graph five hypotheses generated used comparison. set marginal power (without multiplicity adjustment) randomly generated. Local power (multiplicity adjustment) calculated compared using following functions: graphicalMCP::graph_calculate_power() gMCP::calcPower(). Since different simulation methods used, results slightly different. maximum absolute difference local power 0.0051 (0.51%) among 1000 cases, relatively small.","code":"set.seed(1234) alpha <- 0.025 sim_corr <- matrix(.5, 5, 5) diag(sim_corr) <- 1 graphicalmcp_power <- NULL gmcp_power <- NULL for (i in 1:1000) { graph <- random_graph(5) marginal_power <- runif(5, 0.5, 0.9) noncentrality_parameter <- qnorm(1 - 0.025, lower.tail = TRUE) - qnorm(1 - marginal_power, lower.tail = TRUE) set.seed(1234 + i - 1) graphicalmcp_power <- rbind( graphicalmcp_power, graph_calculate_power( graph, alpha = alpha, power_marginal = marginal_power, sim_corr = sim_corr, sim_n = 2^17 )$power$power_local ) set.seed(1234 + i - 1) gmcp_power <- rbind( gmcp_power, calcPower( graph$hypotheses, alpha = alpha, graph$transitions, mean = noncentrality_parameter, corr.sim = sim_corr, n.sim = 2^17 )$LocalPower ) } diff <- data.frame( rbind(graphicalmcp_power, gmcp_power), procedure = rep(c(\"graphicalMCP\", \"gMCP\"), each = nrow(graphicalmcp_power)) ) write.csv( diff, here::here(\"vignettes/cache/comparisons_power_shortcut.csv\"), row.names = FALSE ) diff <- read.csv(here::here(\"vignettes/cache/comparisons_power_shortcut.csv\")) graphicalmcp_power <- subset(diff, procedure == \"graphicalMCP\") gmcp_power <- subset(diff, procedure == \"gMCP\") round( max( abs( graphicalmcp_power[, -ncol(graphicalmcp_power)] - gmcp_power[, -ncol(gmcp_power)] ) ), 4 ) # Maximum difference in local power among 1000 cases"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing-1","dir":"Articles","previous_headings":"Comparisons of closed test procedures with parametric tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_closure() gMCP::gMCP(). Parametric tests used two primary hypotheses. process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) set.seed(1234) alpha <- 0.025 identical <- NULL test_corr <- rbind( c(1, 0.5, NA, NA), c(0.5, 1, NA, NA), c(NA, NA, 1, NA), c(NA, NA, NA, 1) ) for (i in 1:10000) { p <- runif(4, 0, alpha) graphicalmcp_test_parametric <- graph_test_closure( graph, p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(test_corr[1:2, 1:2], NA) )$outputs$adjusted_p gmcp_test_parametric <- gMCP( as_graphMCP(graph), p, alpha = 0.025, correlation = test_corr )@adjPValues identical <- c( identical, all.equal(graphicalmcp_test_parametric, gmcp_test_parametric, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations-1","dir":"Articles","previous_headings":"Comparisons of closed test procedures with parametric tests","what":"Power simulations","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set marginal power (without multiplicity adjustment) randomly generated. Local power (multiplicity adjustment) calculated compared using following functions: graphicalMCP::graph_calculate_power() gMCP::calcPower(). Parametric tests used two primary hypotheses. process repeated 100 times. Since different simulation methods used, results slightly different. maximum absolute difference local power 0.0142 (1.42%) among 100 cases, small.","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) test_corr <- rbind( c(1, 0.5, NA, NA), c(0.5, 1, NA, NA), c(NA, NA, 1, NA), c(NA, NA, NA, 1) ) sim_corr <- matrix(0.5, 4, 4) diag(sim_corr) <- 1 set.seed(1234) alpha <- 0.025 graphicalmcp_power_parametric <- NULL gmcp_power_parametric <- NULL for (i in 1:100) { marginal_power <- runif(4, 0.5, 0.9) noncentrality_parameter <- qnorm(1 - 0.025, lower.tail = TRUE) - qnorm(1 - marginal_power, lower.tail = TRUE) set.seed(1234 + i - 1) graphicalmcp_power_parametric <- rbind( graphicalmcp_power_parametric, graph_calculate_power( graph, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = list(test_corr[1:2, 1:2], NA), power_marginal = marginal_power, sim_corr = sim_corr, sim_n = 2^14 )$power$power_local ) set.seed(1234 + i - 1) gmcp_power_parametric <- rbind( gmcp_power_parametric, calcPower( graph$hypotheses, alpha = alpha, graph$transitions, corr.test = test_corr, mean = noncentrality_parameter, corr.sim = sim_corr, n.sim = 2^14 )$LocalPower ) } diff <- data.frame( rbind(graphicalmcp_power_parametric, gmcp_power_parametric), procedure = rep(c(\"graphicalMCP\", \"gMCP\"), each = nrow(gmcp_power_parametric)) ) write.csv( diff, here::here(\"vignettes/cache/comparisons_power_parametric.csv\"), row.names = FALSE ) diff <- read.csv(here::here(\"vignettes/cache/comparisons_power_parametric.csv\")) graphicalmcp_power <- subset(diff, procedure == \"graphicalMCP\") gmcp_power <- subset(diff, procedure == \"gMCP\") round( max( abs( graphicalmcp_power_parametric[, -ncol(graphicalmcp_power_parametric)] - gmcp_power_parametric[, -ncol(gmcp_power)] ) ), 4 ) # Maximum difference in local power among 100 cases"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"adjusted-p-values-for-testing-2","dir":"Articles","previous_headings":"Comparisons of closed test procedures with Simes tests","what":"Adjusted p-values for testing","title":"Comparisons with other packages","text":"successive graph two primary two secondary hypotheses generated used comparison. set p-values randomly generated used graphical MCP. Adjusted p-values calculated compared using following functions: graphicalMCP::graph_test_closure() lrstat::fadjpsim(). Simes tests used two primary hypotheses. process repeated 10000 times. Adjusted p-values matched 10000 cases.","code":"hypotheses <- c(0.5, 0.5, 0, 0) eps <- 0.0001 transitions <- rbind( c(0, 1 - eps, eps, 0), c(1 - eps, 0, 0, eps), c(0, 1, 0, 0), c(1, 0, 0, 0) ) graph <- graph_create(hypotheses, transitions) set.seed(1234) alpha <- 0.025 identical <- NULL family <- rbind( c(1, 1, 0, 0), c(0, 0, 1, 0), c(0, 0, 0, 1) ) for (i in 1:10000) { p <- runif(4, 0, alpha) graphicalmcp_test_simes <- graph_test_closure( graph, p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"simes\", \"bonferroni\") )$outputs$adjusted_p names(graphicalmcp_test_simes) <- NULL lrstat_test_simes <- fadjpsim( fwgtmat(graph$hypotheses, graph$transitions), p, family ) identical <- c( identical, all.equal(graphicalmcp_test_simes, lrstat_test_simes, tolerance = 1e-7) ) } all(identical) #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/comparisons.html","id":"power-simulations-2","dir":"Articles","previous_headings":"Comparisons of closed test procedures with Simes tests","what":"Power simulations","title":"Comparisons with other packages","text":"Power simulations available lrstat. Thus comparison done compare graphicalMCP::graph_calculate_power() manual repetition lrstat::fadjpsim() many sets marginal power. process comparison adjusted p-values, thus omitted.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"Consider simple successive graph four hypotheses. two primary hypotheses \\(H_1\\) \\(H_2\\) two secondary hypotheses \\(H_3\\) \\(H_4\\). Initially, hypothesis weights split equally \\(H_1\\) \\(H_2\\) 0.5. Hypotheses \\(H_3\\) \\(H_4\\) receive 0 hypothesis weights \\(H_3 (H_4)\\) tested \\(H_1 (H_2)\\) rejected. Thus edge \\(H_1 (H_2)\\) \\(H_3 (H_4)\\) transition weight 1. \\(H_1\\) \\(H_3\\) rejected, hypothesis weights propagated \\(H_2\\); similarly, \\(H_2\\) \\(H_4\\) rejected, hypothesis weights propagated \\(H_1\\). Thus edge \\(H_3 (H_4)\\) \\(H_2 (H_1)\\) transition weight 1. graphical multiple comparison procedure illustrated .","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"generating-the-closure","dir":"Articles","previous_headings":"","what":"Generating the closure","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"closure multiple comparison procedure collection intersection hypotheses \\(H_1\\cap H_2\\cap H_3\\cap H_4\\), \\(H_1\\cap H_2\\cap H_3\\), \\(H_1\\cap H_2\\cap H_4\\), \\(H_1\\cap H_3\\cap H_4\\), \\(H_2\\cap H_3\\cap H_4\\ \\ldots, H_1, H_2, H_3\\), \\(H_4\\). words, intersection hypotheses consist intersections based non-empty subsets \\(\\{1, 2, 3, 4\\}\\), e.g., \\(\\{1, 2, 3\\}\\), \\(\\{1, 2, 4\\}\\), \\(\\{1, 3, 4\\}\\), \\(\\{2, 3, 4\\}\\), \\(\\ldots\\). Thus \\(2^4-1\\) intersection hypotheses. equivalent way generate intersection hypotheses use binary representation. example, intersection hypothesis \\(H_1\\cap H_2\\cap H_3\\cap H_4\\) corresponds \\((1, 1, 1, 1)\\) \\(H_1\\cap H_2\\cap H_3\\) corresponds \\((1, 1, 1, 0)\\). closure can indexed power set \\(\\{1, 2, 3, 4\\}\\) . general, one can use rev(expand.grid(rep(list(1:0), m))) general closure, \\(m\\) number hypotheses.","code":"#> H1 H2 H3 H4 #> 1 1 1 1 1 #> 2 1 1 1 0 #> 3 1 1 0 1 #> 4 1 1 0 0 #> 5 1 0 1 1 #> 6 1 0 1 0 #> 7 1 0 0 1 #> 8 1 0 0 0 #> 9 0 1 1 1 #> 10 0 1 1 0 #> 11 0 1 0 1 #> 12 0 1 0 0 #> 13 0 0 1 1 #> 14 0 0 1 0 #> 15 0 0 0 1"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"calculating-the-weighting-strategy","dir":"Articles","previous_headings":"Generating the closure","what":"Calculating the weighting strategy","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"Given closure, one can calculate hypothesis weight associated every hypothesis every intersection hypothesis using Algorithm 1 (Bretz et al. 2011). whole collection hypothesis weights called weighting strategy. example, hypothesis weights \\((0.5, 0.5, 0, 0)\\) intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\). hypothesis weights intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\) \\((0.5, 0.5, 0, 0)\\), can calculated removing \\(H_4\\) initial graph applying Algorithm 1 (Bretz et al. 2011). algorithm calculates hypothesis weights step--step fashion. example, intersection hypothesis \\(H_1\\cap H_2\\), can start \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) calculates hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\) removing \\(H_4\\) calculates hypothesis weights \\(H_1\\cap H_2\\) removing \\(H_3\\); can also start \\(H_1\\cap H_2 \\cap H_3\\) (assuming hypotheses weights stored) calculates hypothesis weights \\(H_1\\cap H_2\\) removing \\(H_3\\). Therefore, two strategies calculate weighting strategy.","code":"#> H1 H2 H3 H4 #> 1 0.50 0.50 0.00 0.00 #> 2 0.50 0.50 0.00 0.00 #> 3 0.50 0.50 0.00 0.00 #> 4 0.50 0.50 0.00 0.00 #> 5 0.75 0.00 0.00 0.25 #> 6 1.00 0.00 0.00 0.00 #> 7 0.75 0.00 0.00 0.25 #> 8 1.00 0.00 0.00 0.00 #> 9 0.00 0.75 0.25 0.00 #> 10 0.00 0.75 0.25 0.00 #> 11 0.00 1.00 0.00 0.00 #> 12 0.00 1.00 0.00 0.00 #> 13 0.00 0.00 0.50 0.50 #> 14 0.00 0.00 1.00 0.00 #> 15 0.00 0.00 0.00 1.00"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"approach-1-simple-approach","dir":"Articles","previous_headings":"Generating the closure > Calculating the weighting strategy","what":"Approach 1: Simple approach","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"first strategy utilizes initial graph starting point calculates hypothesis weights intersection hypotheses. example, calculate hypothesis weights \\(H_1\\cap H_2\\), start intersection hypothesis \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) sequentially remove \\(H_4\\) \\(H_3\\) (order). approach simple implement since hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) determined initial graph always available. approach similar one implemented gMCP R package. drawback use information reduce number calculations. example, possible hypothesis weights \\(H_1\\cap H_2 \\cap H_3\\) calculated calculating \\(H_1\\cap H_2\\). Using information \\(H_1\\cap H_2 \\cap H_3\\) need one-step calculation, compared two-step calculation using \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"approach-2-parent-child-approach","dir":"Articles","previous_headings":"Generating the closure > Calculating the weighting strategy","what":"Approach 2: Parent-child approach","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"approach tries avoid drawback Approach 1 saving intermediate graphs. performs one-step calculation save time. general, intersection hypothesis parent intersection hypothesis, involves hypotheses involved first intersection one extra hypothesis. example, second row matrix_intersections \\(H_1\\cap H_2 \\cap H_3\\) parent intersection \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) first row; third row matrix_intersections \\(H_1\\cap H_2 \\cap H_4\\) parent intersection \\(H_1\\cap H_2 \\cap H_3\\cap H_4\\) first row. Thus can identify parent intersection hypothesis row matrix_intersections (except row 1) row number 1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7. Given sequence parent hypotheses, simple obtain hypothesis weights intersection hypothesis based parent intersection hypothesis via one-step calculation. interest understand pattern obtain efficiently. First, bottom half (rows 9 - 15) top half (rows 1 - 7), row’s parent bottom half corresponding row top half, eight rows , difference flipping \\(H_1\\) 1 top half 0 bottom half. example, row 15’s parent row 15 - 8 = 7. Using observation, can determine parent hypotheses rows 9 15 1, 2, 3, 4, 5, 6, 7. similar pattern can observed rows 5 8. parent hypotheses rows 1, 2, 3, 4, respectively, flipping \\(H_2\\) 1 0. rows 3 - 4, parent hypotheses rows 1, 2, respectively, flipping \\(H_3\\) 1 0. Lastly row 2, parent hypothesis row 1. row number parent hypothesis can efficiently generated running .call(c, lapply(2^(seq_len(m) - 1), seq_len))[-2^m, ], \\(m\\) number hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"comparing-different-approaches-to-calculating-weighting-strategies","dir":"Articles","previous_headings":"Generating the closure","what":"Comparing different approaches to calculating weighting strategies","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"benchmark existing approaches calculating weighting strategies, compare following approaches: gMCP::generateWeights() (Rohmeyer Klinglmueller 2024), lrstat::fwgtmat() (Lu 2016), Approach 1 (graphicalMCP simple) Approach 2 (graphicalMCP parent-child). Random graphs generated numbers hypotheses 4, 8, 12, 16. Computing time (median log-10 milliseconds) plotted . can see gMCP::generateWeights() slowest lrstat::fwgtmat() fastest. Approach 2 (graphicalMCP parent-child) faster Approach 1 (graphicalMCP simple). Note lrstat::fwgtmat() implements calculation using C++, known faster R. less stable approaches, e.g., giving errors often others. Given computing time R-based approaches acceptable, adding Rcpp dependency considered graphicalMCP. considerations, implement Approach 2 graphicalMCP::graph_generate_weights().","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"conventional-approach-for-power-simulations","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Conventional approach for power simulations","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"conventional approach power simulations repeat following process many times, e.g., 100,000 times. Simulate set p-values Determine hypothesis can rejected Remove rejected hypothesis update graph Repeat hypotheses can rejected Note step update graph may repeat many replications, may repetitive. \\(m\\) hypotheses, \\(2^m-1\\) graphs depending hypotheses rejected. graphs correspond closure weighting strategy. Thus idea avoid redundant updating graphs utilize weighting strategy.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"power-simulations-using-parent-child-relationships","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Power simulations using parent-child relationships","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"key allow approach efficiently identify row weighting strategy, given hypotheses rejected. Remembering pattern found Approach 2, bottom half (rows 9 - 15) matrix_intersections top half (rows 1 - 7), except flipping \\(H_1\\) 1 0. means \\(H_1\\) rejected (1 \\(H_1\\) matrix_intersections), row number index top half. example, assume \\(H_2\\) \\(H_4\\) rejected index matrix_intersections \\((1, 0, 1, 0)\\). Since \\(H_1\\) 1, corresponding row top half (rows 1- 7). \\(H_2\\) 0 thus corresponding row bottom half within top half (rows 5 - 7). Since \\(H_3\\) 1 thus corresponding row top half (rows 5 - 6). \\(H_4\\) 0 thus corresponding row 6. useful way calculate row number index XXXX 2^m - sum(XXXX * 2^(m:1 - 1)). example XXXX=1010, row number (1 - 1) * 8 + (1 - 0) * 4 + (1 - 1) * 2 + (1 - 0) * 1 + 1 = 16 - 10 = 6. way efficiently identifying rows weighting_strategy, power simulations implemented follows: Obtain weighting strategy (simulations) Simulate set p-values Determine hypothesis can rejected Remove rejected hypothesis identify row weighting strategy Repeat hypotheses can rejected small modification Step 3b makes approach much faster conventional approach power simulations.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/generate-closure.html","id":"comparing-different-approaches-to-power-simulations","dir":"Articles","previous_headings":"Improving power simulations using parent-child relationships","what":"Comparing different approaches to power simulations","title":"Rationales to generate the closure and the weighting strategy of a graph","text":"benchmark existing approaches calculating weighting strategies, compare following approaches: gMCP::calcPower(), Approach 1 (graphicalMCP conventional), Approach 2 (graphicalMCP parent-child). Holm fixed sequence procedures considered numbers hypotheses 4, 8, 12, 16. Computing time (median log-10 seconds) plotted . can see gMCP::calcPower() fastest Approach 1 (graphicalMCP conventional) lowest. Note gMCP::calcPower() implements simulation using C, known faster R easy extend situations. Given computing time Approach 2 (graphicalMCP parent-child) acceptable, implement graphicalMCP::graph_calculate_power().","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"confirmatory clinical trials, regulatory guidelines mandate strong control family-wise error rate prespecified level \\(\\alpha\\). Many multiple comparison procedures (MCPs) proposed purpose. graphical approaches general framework include many common MCPs special cases. vignette, illustrate use graphicalMCP perform common MCPs. test \\(m\\) hypotheses using graphical MCP, hypothesis \\(H_i\\) receives weight \\(0\\leq w_i\\leq 1\\) (called hypothesis weight), \\(\\sum_{=1}^{m}w_i\\leq 1\\). \\(H_i\\) \\(H_j\\), directed weighted edge \\(0\\leq g_{ij}\\leq 1\\), means \\(H_i\\) rejected, hypothesis weight propagated (transferred) \\(H_j\\) \\(g_{ij}\\) determines much propagation. also require \\(\\sum_{j=1}^{m}g_{ij}\\leq 1\\) \\(g_{ii}=0\\).","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"weighted-bonferroni-test","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Weighted Bonferroni test","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"weighted Bonferroni test splits \\(\\alpha\\) among hypotheses testing every hypothesis significance level \\(w_i\\alpha\\). Thus rejects hypothesis p-value less equal significance level. \\(w_i=w_j\\) \\(,j\\), means equal split test Bonferroni test. propagation pair hypothesis.","code":"set.seed(1234) alpha <- 0.025 m <- 3 bonferroni_graph <- bonferroni(rep(1 / m, m)) # transitions <- matrix(0, m, m) # bonferroni_graph <- graph_create(rep(1 / m, m), transitions) plot( bonferroni_graph, layout = igraph::layout_in_circle( as_igraph(bonferroni_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( bonferroni_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"holm-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Holm Procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Holm (Bonferroni-Holm) procedures improve Bonferroni tests allowing propagation (Holm 1979). words, transition weights hypotheses may zero. uniformly powerful Bonferroni tests.","code":"set.seed(1234) alpha <- 0.025 m <- 3 holm_graph <- bonferroni_holm(rep(1 / m, m)) # transitions <- matrix(1 / (m - 1), m, m) # diag(transitions) <- 0 # holm_graph <- graph_create(rep(1 / m, m), transitions) plot(holm_graph, layout = igraph::layout_in_circle( as_igraph(holm_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut(holm_graph, p = p_values, alpha = alpha) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"fixed-sequence-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Fixed sequence procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Fixed sequence (hierarchical) procedures pre-specify order testing [Maurer, Hothorn, Lehmacher (1995);westfall-2001-optimally]. example, procedure test \\(H_1\\) first. rejected, test \\(H_2\\); otherwise testing stops. \\(H_2\\) rejected, test \\(H_3\\); otherwise testing stops. hypothesis, tested full \\(\\alpha\\) level, can tested.","code":"set.seed(1234) alpha <- 0.025 m <- 3 fixed_sequence_graph <- fixed_sequence(m) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(0, 0, 0) # ) # fixed_sequence_graph <- graph_create(c(1, 0, 0), transitions) plot(fixed_sequence_graph, nrow = 1, asp = 0.05, vertex.size = 40) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fixed_sequence_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"fallback-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Fallback procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Fallback procedures one-way propagation (like fixed sequence procedures) allow hypotheses tested different significance levels (Wiens 2003). can improved allow propagation later hypotheses earlier hypotheses, possible later hypothesis rejected earlier hypothesis can rejected. two versions improvement: fallback_improved_1 due (Wiens Dmitrienko 2005) fallback_improved_2 due (Bretz et al. 2009) respectively.","code":"set.seed(1234) alpha <- 0.025 m <- 3 fallback_graph <- fallback(rep(1 / 3, 3)) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(0, 0, 0) # ) # fallback_graph <- graph_create(rep(1 / 3, 3), transitions) plot(fallback_graph, nrow = 1, asp = 0.05, vertex.size = 40) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fallback_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE set.seed(1234) alpha <- 0.025 m <- 3 fallback_improved_1_graph <- fallback_improved_1(rep(1 / 3, 3)) # hypotheses <- rep(1 / 3, 3) # transitions <- rbind( # c(0, 1, 0), # c(0, 0, 1), # c(hypotheses[seq_len(m - 1)] / sum(hypotheses[seq_len(m - 1)]), 0) # ) # fallback_improved_1_graph <- graph_create(rep(1 / 3, 3), transitions) plot( fallback_improved_1_graph, nrow = 1, asp = 0.05, vertex.size = 40, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10) ) epsilon <- 0.0001 fallback_improved_2_graph <- fallback_improved_2(rep(1 / 3, 3), epsilon) # hypotheses <- rep(1 / 3, 3) # transitions <- rbind( # c(0, 1, 0), # c(1 - epsilon, 0, epsilon), # c(1, 0, 0) # ) # fallback_improved_2_graph <- graph_create(rep(1 / 3, 3), transitions) plot( fallback_improved_2_graph, nrow = 1, asp = 0.05, eps = 0.0001, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10), vertex.size = 40 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( fallback_improved_2_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"serial-gatekeeping-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Serial gatekeeping procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Serial gatekeeping procedures involve ordered multiple families hypotheses, hypotheses family hypotheses must rejected proceeding test sequence. example considers primary family consisting two hypotheses \\(H_1\\) \\(H_2\\) secondary family consisting single hypothesis \\(H_3\\). primary family, Holm procedure applied. \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) can tested level \\(\\alpha\\); otherwise \\(H_3\\) rejected. allow conditional propagation \\(H_3\\), \\(\\varepsilon\\) edge used \\(H_2\\) \\(H_3\\). small transition weight \\(H_2\\) propagates hypothesis weight \\(H_1\\) (already rejected) retains small (non-zero) weight \\(H_3\\) \\(H_1\\) rejected, hypothesis weight \\(H_2\\) propagated \\(H_3\\). \\(\\varepsilon\\) assigned 0.0001 practice, value adjusted much smaller smallest p-value observed.","code":"set.seed(1234) alpha <- 0.025 m <- 3 epsilon <- 0.0001 transitions <- rbind( c(0, 1, 0), c(1 - epsilon, 0, epsilon), c(0, 0, 0) ) serial_gatekeeping_graph <- graph_create(c(0.5, 0.5, 0), transitions) plot( serial_gatekeeping_graph, nrow = 1, asp = 0.05, eps = 0.0001, edge_curves = c(\"pairs\" = 7, \"H3|H1\" = -10), vertex.size = 40 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( serial_gatekeeping_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"parallel-gatekeeping-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Parallel gatekeeping procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Parallel gatekeeping procedures also involve multiple ordered families hypotheses, null hypotheses family hypotheses must rejected proceeding test sequence (Dmitrienko, Offen, Westfall 2003). example considers primary family consisting two hypotheses \\(H_1\\) \\(H_2\\) secondary family consisting two hypotheses \\(H_3\\) \\(H_4\\). primary family, Bonferroni test applied. \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) \\(H_4\\) can tested level \\(\\alpha/2\\) using Holm procedure; \\(H_1\\) \\(H_2\\) rejected, \\(H_3\\) \\(H_4\\) can tested level \\(\\alpha\\) using Holm procedure; otherwise \\(H_3\\) \\(H_4\\) rejected. parallel gatekeeping procedure can improved adding \\(\\varepsilon\\) edges secondary hypotheses primary hypotheses, possible secondary hypotheses rejected still remaining primary hypothesis rejected (Bretz et al. 2009).","code":"set.seed(1234) alpha <- 0.025 m <- 4 transitions <- rbind( c(0, 0, 0.5, 0.5), c(0, 0, 0.5, 0.5), c(0, 0, 0, 1), c(0, 0, 1, 0) ) parallel_gatekeeping_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(parallel_gatekeeping_graph, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( parallel_gatekeeping_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE set.seed(1234) alpha <- 0.025 m <- 4 epsilon <- 0.0001 transitions <- rbind( c(0, 0, 0.5, 0.5), c(0, 0, 0.5, 0.5), c(epsilon, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0) ) parallel_gatekeeping_improved_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(parallel_gatekeeping_improved_graph, eps = 0.0001, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( parallel_gatekeeping_improved_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"successive-procedure","dir":"Articles","previous_headings":"Bonferroni-based procedures","what":"Successive procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Successive procedures incorporate successive relationships hypotheses. example, secondary hypothesis tested primary hypothesis rejected. similar using fixed sequence procedure component graph. example considers two primary hypotheses \\(H_1\\) \\(H_2\\) two secondary hypotheses \\(H_3\\) \\(H_4\\). Primary hypotheses \\(H_1\\) \\(H_2\\) receive equal hypothesis weight 0.5; secondary hypotheses \\(H_3\\) \\(H_4\\) receive hypothesis weight 0. secondary hypothesis \\(H_3 (H_4)\\) can tested corresponding primary hypothesis \\(H_1 (H_2)\\) rejected. represents successive relationships \\(H_1\\) \\(H_3\\), \\(H_2\\) \\(H_4\\), respectively (Maurer, Glimm, Bretz 2011). \\(H_1\\) \\(H_3\\) rejected, hypothesis weights propagated \\(H_2\\) \\(H_4\\), vice versa. graph generalized allow propagation primary hypotheses (Maurer, Glimm, Bretz 2011). general successive graph illustrate variable determine propagation \\(H_1\\) \\(H_2\\).","code":"set.seed(1234) alpha <- 0.025 m <- 4 simple_successive_graph <- simple_successive_1() # transitions <- rbind( # c(0, 0, 1, 0), # c(0, 0, 0, 1), # c(0, 1, 0, 0), # c(1, 0, 0, 0) # ) # simple_successive_graph <- graph_create(c(0.5, 0.5, 0, 0), transitions) plot(simple_successive_graph, layout = \"grid\", nrow = 2, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( simple_successive_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE FALSE FALSE FALSE set.seed(1234) alpha <- 0.025 m <- 4 successive_var <- simple_successive_var <- function(gamma) { graph_create( c(0.5, 0.5, 0, 0), rbind( c(0, gamma, 1 - gamma, 0), c(gamma, 0, 0, 1 - gamma), c(0, 1, 0, 0), c(1, 0, 0, 0) ) ) } successive_var_graph <- successive_var(0.5) plot(successive_var_graph, layout = \"grid\", nrow = 2, vertex.size = 70) p_values <- runif(m, 0, alpha) test_results <- graph_test_shortcut( successive_var_graph, p = p_values, alpha = alpha ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE FALSE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"hommel-procedure","dir":"Articles","previous_headings":"Simes-based procedures","what":"Hommel procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Hommel procedure (Hommel 1988) closed test procedure uses Simes tests every intersection hypothesis. According Xi Bretz (2019), graph Hommel procedures graph Holm procedures. Thus perform Hommel procedure, just need specify test_type simes.","code":"set.seed(1234) alpha <- 0.025 m <- 3 hommel_graph <- bonferroni_holm(rep(1 / m, m)) plot( hommel_graph, layout = igraph::layout_in_circle( as_igraph(hommel_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) test_results <- graph_test_closure( hommel_graph, p = p_values, alpha = alpha, test_types = \"simes\" ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE TRUE TRUE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graph-examples.html","id":"dunnett-procedure","dir":"Articles","previous_headings":"Parametric procedures","what":"Dunnett procedure","title":"Common multiple comparison procedures illustrated using graphicalMCP","text":"Step-Dunnett procedures closed test procedure improvement Holm procedures incorporating correlation structure test statistics (Dunnett Tamhane 1991). Thus graph Holm procedures. Assume equi-correlated case, correlation pair test statistics , e.g., 0.5. can perform step-Dunnett procedure specifying test_type parametric providing correlation matrix.","code":"set.seed(1234) alpha <- 0.025 m <- 3 dunnett_graph <- bonferroni_holm(rep(1 / m, m)) plot( dunnett_graph, layout = igraph::layout_in_circle( as_igraph(dunnett_graph), order = c(2, 1, 3) ), vertex.size = 70 ) p_values <- runif(m, 0, alpha) corr <- matrix(0.5, m, m) diag(corr) <- 1 test_results <- graph_test_closure( dunnett_graph, p = p_values, alpha = alpha, test_types = \"parametric\", test_corr = list(corr) ) test_results$outputs$rejected #> H1 H2 H3 #> TRUE FALSE FALSE"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Get started","text":"Graphical approaches multiple comparison procedures (MCPs) general framework control familywise error rate strongly pre-specified significance level \\(0<\\alpha<1\\). approach includes many commonly used MCPs special cases transparent visualizing MCPs better communications. graphicalMCP designed design analyze graphical MCPs flexible, informative efficient way.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"initial-graph","dir":"Articles","previous_headings":"Basic usage","what":"Initial graph","title":"Get started","text":"base object graphicalMCP initial_graph, consists vector hypothesis weights matrix transition weights (Bretz et al. 2009). object can created via graph_create(). graphical representation, hypotheses denoted nodes (vertices) associated hypothesis weights. directed edge hypothesis another indicates direction propagation hypothesis weight origin hypothesis end hypothesis. edge weighted transition weight indicating proportion propagation.","code":"library(graphicalMCP) # A graph of two primary hypotheses (H1 and H2) and two secondary hypotheses (H3 and H4) hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\") example_graph <- graph_create(hypotheses, transitions, hyp_names) example_graph #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 plot(example_graph, vertex.size = 60)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"update-graph","dir":"Articles","previous_headings":"Basic usage","what":"Update graph","title":"Get started","text":"hypothesis removed graph, hypothesis transition weights remaining hypotheses updated according Algorithm 1 Bretz et al. (2011). example, assume hypotheses H1, H2 H4 removed graph. updated graph removing three hypotheses .","code":"updated_example <- graph_update( example_graph, delete = c(TRUE, TRUE, FALSE, TRUE) ) updated_example #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 1, 2, 4 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA plot(updated_example, vertex.size = 60)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"perform-graphical-mcps","dir":"Articles","previous_headings":"","what":"Perform graphical MCPs","title":"Get started","text":"Given set p-values hypotheses, graphical MCPs can performed using graph_test_shortcut() determine hypotheses can rejected significance level alpha. Assume p-values 0.01, 0.005, 0.03, 0.01 hypotheses H1-H4. one-sided significance level alpha = 0.025, rejected hypotheses H1, H2, H4. details shortcut testing can found vignette(\"shortcut-testing\"). similar testing procedure can performed using closure principle. allow tests intersection hypotheses, e.g., Simes, parametric mixture . test type Bonferroni, resulting closed procedure equivalent shortcut procedure . Additional details closed testing can found vignette(\"closed-testing\").","code":"test_results <- graph_test_shortcut( example_graph, p = c(0.01, 0.005, 0.03, 0.01), alpha = 0.025 ) test_results$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE test_results_closed <- graph_test_closure( example_graph, p = c(0.01, 0.005, 0.03, 0.01), alpha = 0.025, test_types = \"bonferroni\", test_groups = list(1:4) ) test_results_closed$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/graphicalMCP.html","id":"power-simulations","dir":"Articles","previous_headings":"","what":"Power simulations","title":"Get started","text":"multiplicity adjustment, graphical MCPs, “power” reject hypothesis affected, compared marginal power. latter power rejected hypothesis significance level alpha without multiplicity adjustment. marginal power usually obtained pieces statistical software. graph_calculate_power() performs power simulations assess power adjusting graphical MCP (Bretz, Maurer, Hommel 2011). Assume marginal power reject H1-H4 90%, 90%, 80%, 80% test statistics independent . local power multiplicity adjustment 87.7%, 87.7%, 67.2%, 67.2% respectively H1-H4. Additional details power simulations can found vignette(\"shortcut-testing\") vignette(\"closed-testing\").","code":"set.seed(1234) power_results <- graph_calculate_power( example_graph, sim_n = 1e6, power_marginal = c(0.9, 0.9, 0.8, 0.8) ) power_results$power$power_local #> H1 H2 H3 H4 #> 0.875760 0.876295 0.670470 0.671431"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"motivating-example","dir":"Articles","previous_headings":"","what":"Motivating example","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Consider confirmatory clinical trial comparing test treatment (treatment) control treatment (control) disease. two doses treatment: low dose high dose. two endpoints included multiplicity adjustment strategy, primary endpoint (PE) secondary endpoint (SE). total, four null hypotheses: \\(H_1\\) \\(H_3\\) primary secondary hypotheses respectively low dose versus control; \\(H_2\\) \\(H_4\\) primary secondary hypotheses respectively high dose versus control. clinical considerations constrain structure multiple comparison procedures, can flexibly incorporated using graphical approaches. First, low high doses considered equally important, means rejecting primary hypothesis either dose versus control leads successful trial. Regarding secondary hypotheses, one tested corresponding primary hypothesis rejected. means \\(H_3\\) tested \\(H_1\\) rejected; \\(H_4\\) tested \\(H_2\\) rejected. addition, statistical considerations complete graph. primary hypotheses \\(H_1\\) \\(H_2\\) equal hypothesis weight 0.5. secondary hypotheses hypothesis weight 0. primary hypothesis rejected, weight propagated along two outgoing edges: One primary hypothesis one descendant secondary hypothesis. two edges equal transition weight 0.5. primary secondary hypotheses rejected dose-control comparison, hypothesis weights propagated primary hypothesis dose-control comparison. specifications, can create following graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"create-the-graph","dir":"Articles","previous_headings":"","what":"Create the graph","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"","code":"hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0.5, 0.5, 0), c(0.5, 0, 0, 0.5), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H3\", \"H4\") g <- graph_create(hypotheses, transitions, hyp_names) plot(g, vertex.size = 60)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"adjusted-p-values-and-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Adjusted p-values and rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given set p-values \\(H_1, \\ldots, H_4\\), graphical multiple comparison procedure can performed control familywise error rate (FWER) significance level alpha. graph_test_shortcut function agnostic one-sided two-sided tests. one-sided p-values, alpha often set 0.025 (default); two-sided p-values, alpha often set 0.05. consider one-sided tests . hypothesis rejected adjusted p-value less equal alpha. running procedure, hypotheses \\(H_1\\), \\(H_2\\), \\(H_4\\) rejected adjusted p-value calculated.","code":"p_values <- c(0.018, 0.01, 0.105, 0.006) test_results <- graph_test_shortcut(g, p = p_values, alpha = 0.025) test_results$outputs$adjusted_p # Adjusted p-values #> H1 H2 H3 H4 #> 0.024 0.020 0.105 0.024 test_results$outputs$rejected # Rejections #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-final-and-intermediate-graphs-after-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain final and intermediate graphs after rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"final graph graph removing rejected hypotheses \\(H_1\\), \\(H_2\\), \\(H_4\\). can obtained via test_results$outputs$graph. Rejected hypotheses get hypothesis weight NA transition weight NA. based printing method print.updated_graph. can also obtain non-NA graph calling hypothesis weights transition weights separately via test_results$outputs$graph$hypotheses test_results$outputs$graph$transitions. Note case, rejected hypotheses get 0 hypothesis weight 0 transition weight. mainly internal calculation updating graphs. also interested intermediate graphs - example, graph \\(H_2\\) \\(H_1\\) rejected - can specify verbose = TRUE graph_test_shortcut. Note intermediate graphs depend order rejections, .e., sequence hypotheses rejected. default order defined increasing adjusted p-values, followed earlier hypothesis numbering case ties. example, default order rejection \\(H_2\\rightarrow H_1\\rightarrow H_4\\). obtain intermediate graphs based order rejection, one can specify test_results_verbose$details$results. example, graph \\(H_2\\) \\(H_1\\) rejected given test_results_verbose$details$results[[3]].","code":"test_results$outputs$graph # Final graph after H1, H2 and H4 rejected (as NA's) #> Updated graph #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA test_results$outputs$graph$hypotheses # Hypothesis weights of the final graph #> H1 H2 H3 H4 #> 0 0 1 0 test_results$outputs$graph$transitions # Transition weights of the final graph #> H1 H2 H3 H4 #> H1 0 0 0 0 #> H2 0 0 0 0 #> H3 0 0 0 0 #> H4 0 0 0 0 test_results_verbose <- graph_test_shortcut( g, p = p_values, alpha = 0.025, verbose = TRUE ) # Intermediate graph after H1 and H2 rejected test_results_verbose$details$results[[3]] #> Updated graph #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 0.5 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 1 #> H4 NA NA 1 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-possible-orders-of-rejections","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain possible orders of rejections","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"order rejections may unique orders valid. example, rejected hypotheses \\(H_1\\), \\(H_2\\) \\(H_4\\). default order rejections \\(H_2 \\rightarrow H_1 \\rightarrow H_4\\). Another valid order rejections \\(H_2 \\rightarrow H_4 \\rightarrow H_1\\). However, first rejected hypothesis can \\(H_1\\) \\(H_4\\). obtain possible rejection orders, one can use function graph_rejection_orderings. intermediate final graphs can obtained using function graph_update particular order rejections.","code":"# Obtain all valid orders of rejections orders <- graph_rejection_orderings(test_results)$valid_orderings orders #> [[1]] #> H2 H1 H4 #> 2 1 4 #> #> [[2]] #> H2 H4 H1 #> 2 4 1 # Intermediate graphs following the order of H2 and H4 graph_update(g, delete = orders[[2]])$intermediate_graphs[[3]] #> Updated graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: NA #> H3: 0 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 NA #> H2 NA NA NA NA #> H3 1 NA 0 NA #> H4 NA NA NA NA"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"obtain-adjusted-significance-levels","dir":"Articles","previous_headings":"Perform the graphical multiple comparison procedure","what":"Obtain adjusted significance levels","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"equivalent way obtain rejections adjusting significance levels. hypothesis rejected p-value less equal adjusted significance level. adjusted significance levels calculated order adjusted p-values: \\(H_2 \\rightarrow H_1 \\rightarrow H_4\\), four steps checking rejections. First, \\(H_2\\) rejected adjusted significance level 0.5 * alpha. Second, \\(H_1\\) rejected adjusted significance level 0.75 * alpha, \\(H_2\\) rejected. Third, \\(H_4\\) rejected adjusted significance level 0.5 * alpha, \\(H_1\\) \\(H_2\\) rejected. Fourth finally, \\(H_3\\) rejected adjusted significance level alpha, \\(H_1\\), \\(H_2\\) \\(H_4\\) rejected. results can obtained specifying test_values = TRUE.","code":"test_results_test_values <- graph_test_shortcut( g, p = p_values, alpha = 0.025, test_values = TRUE ) test_results_test_values$test_values$results #> Step Hypothesis p Weight Alpha Inequality_holds #> 1 1 H2 0.010 0.50 0.025 TRUE #> 2 2 H1 0.018 0.75 0.025 TRUE #> 3 3 H4 0.006 0.50 0.025 TRUE #> 4 4 H3 0.105 1.00 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"power-simulation","dir":"Articles","previous_headings":"","what":"Power simulation","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given graph, interested “power” trial. single null hypothesis, power probability true positive - , rejecting null hypothesis significance level alpha alternative hypothesis true. multiple null hypotheses, multiple versions “power”. example, power reject least one hypothesis vs power reject hypotheses, given alternative hypotheses true. graphical multiple comparison procedures, also important understand power reject hypothesis, given multiplicity adjustment. Sometimes, may want customize definitions power define success. Thus power calculation important aspect trial design.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-marginal-power-for-primary-hypotheses","dir":"Articles","previous_headings":"Power simulation","what":"Input: Marginal power for primary hypotheses","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Assume primary endpoint occurrence unfavorable clinical event. evaluate treatment effect, proportion patients event calculated, lower proportion preferred. Assume proportions 0.181 low high doses, 0.3 control. Using equal randomization among three treatment groups, clinical trial team chooses total sample size 600 200 per group. leads marginal power 80% \\(H_1\\) \\(H_2\\), respectively, using two-sample test difference proportions unpooled variance one-sided significance level 0.025. calculation, use marginal power combine information treatment effect, nuisance parameter, sample sizes hypothesis. Note significance level used marginal power calculation must alpha, used significance level FWER control. addition, marginal power one--one relationship noncentrality parameter, illustrated .","code":"alpha <- 0.025 prop <- c(0.3, 0.181, 0.181) sample_size <- rep(200, 3) unpooled_variance <- prop[-1] * (1 - prop[-1]) / sample_size[-1] + prop[1] * (1 - prop[1]) / sample_size[1] noncentrality_parameter_primary <- -(prop[-1] - prop[1]) / sqrt(unpooled_variance) power_marginal_primary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_primary, sd = 1, lower.tail = FALSE ) names(power_marginal_primary) <- c(\"H1\", \"H2\") power_marginal_primary #> H1 H2 #> 0.8028315 0.8028315"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-marginal-power-for-secondary-hypotheses","dir":"Articles","previous_headings":"Power simulation","what":"Input: Marginal power for secondary hypotheses","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Assume secondary endpoint change total medication score baseline, continuous outcome. evaluate treatment effect, mean change calculated, greater reduction preferred. Assume mean change baseline reduction 7.5 8.25, respectively low high doses, 5 control. assume known common standard deviation 10. Given sample size 200 per treatment group, marginal power 71% 90% \\(H_3\\) \\(H_4\\), respectively, using two-sample \\(z\\)-test difference means one-sided significance level 0.025.","code":"mean_change <- c(5, 7.5, 8.25) sd <- rep(10, 3) variance <- sd[-1]^2 / sample_size[-1] + sd[1]^2 / sample_size[1] noncentrality_parameter_secondary <- (mean_change[-1] - mean_change[1]) / sqrt(variance) power_marginal_secondary <- pnorm( qnorm(alpha, lower.tail = FALSE), mean = noncentrality_parameter_secondary, sd = 1, lower.tail = FALSE ) names(power_marginal_secondary) <- c(\"H3\", \"H4\") power_marginal_secondary #> H3 H4 #> 0.7054139 0.9014809"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"input-correlation-structure-to-simulate-test-statistics","dir":"Articles","previous_headings":"Power simulation","what":"Input: Correlation structure to simulate test statistics","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"addition marginal power, also need make assumptions joint distribution test statistics. example, assume follow multivariate normal distribution means defined noncentrality parameters correlation matrix \\(R\\). obtain correlations, helpful understand two types correlations example. correlation two dose-control comparisons endpoint correlation endpoints. former correlation can calculated function sample size. example, correlation test statistics \\(H_1\\) \\(H_2\\) \\(\\rho_{12}=\\left(\\frac{n_1}{n_1+n_0}\\right)^{1/2}\\left(\\frac{n_2}{n_3+n_0}\\right)^{1/2}\\). equal randomization, correlation 0.5. correlation test statistics \\(H_3\\) \\(H_4\\) . hand, correlation endpoints dose-control comparison often estimated based prior knowledge previous trials. Without information, assume \\(\\rho_{13}=\\rho_{24}=0.5\\). practice, one set correlation parameter try multiple values assess sensitivity assumption. Regarding correlation test statistics \\(H_1\\) \\(H_4\\) \\(H_2\\) \\(H_3\\), even difficult estimate. use simple product rule, means correlation product correlations two previously assumed correlations. example, \\(\\rho_{14}=\\rho_{12}*\\rho_{24}\\) \\(\\rho_{23}=\\rho_{12}*\\rho_{13}\\). practice, one may make assumptions instead using product rule.","code":"corr <- matrix(0, nrow = 4, ncol = 4) corr[1, 2] <- corr[3, 4] <- sqrt( sample_size[2] / sum(sample_size[1:2]) * sample_size[3] / sum(sample_size[c(1, 3)]) ) rho <- 0.5 corr[1, 3] <- corr[2, 4] <- rho corr[1, 4] <- corr[2, 3] <- corr[1, 2] * rho corr <- corr + t(corr) diag(corr) <- 1 colnames(corr) <- hyp_names rownames(corr) <- hyp_names corr #> H1 H2 H3 H4 #> H1 1.00 0.50 0.50 0.25 #> H2 0.50 1.00 0.25 0.50 #> H3 0.50 0.25 1.00 0.50 #> H4 0.25 0.50 0.50 1.00"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"user-defined-success-criteria","dir":"Articles","previous_headings":"Power simulation","what":"User-defined success criteria","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"mentioned earlier, multiple versions “power” multiple hypotheses. Commonly used “power” definitions include: Local power: probability hypothesis rejected (multiplicity adjustment) Expected . rejections: expected number rejections Power reject 1 : probability reject least one hypothesis Power reject : probability reject hypotheses default outputs graph_calculate_power function. addition, user can customize success criteria define versions “power”.","code":"success_fns <- list( # Probability to reject H1 H1 = function(x) x[1], # Expected number of rejections `Expected no. of rejections` = function(x) x[1] + x[2] + x[3] + x[4], # Probability to reject at least one hypothesis `AtLeast1` = function(x) x[1] | x[2] | x[3] | x[4], # Probability to reject all hypotheses `All` = function(x) x[1] & x[2] & x[3] & x[4], # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both hypotheses for the low dose or the high dose `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/articles/shortcut-testing.html","id":"output-simulate-power","dir":"Articles","previous_headings":"Power simulation","what":"Output: Simulate power","title":"Sequentially rejective graphical multiple comparison procedures based on Bonferroni tests","text":"Given inputs, can estimate “power” via simulation graphical multiple comparison procedure one-sided significance level alpha = 0.025 using sim_n = 1e5 simulations random seed 1234. local power 0.758, 0.765, 0.689, 0.570, respectively \\(H_1, \\ldots, H_4\\). Note local power lower marginal power former adjusted multiplicity. power reject least one hypothesis 0.856 power reject hypotheses 0.512. expected number rejections 2.782. last two user-defined success criteria, probability reject \\(H_1\\) \\(H_2\\) 0.667, probability reject least one pair \\((H_1\\) \\(H_3)\\) \\((H_2\\) \\(H_4)\\) 0.747. see detailed outputs simulated p-values rejection decisions hypotheses, specify verbose = TRUE. produce lot outputs. allow flexible printing functions, user can change following: indented space default setting indent = 2 precision numeric values (.e., number significant digits) default setting precision = 4","code":"set.seed(1234) power_output <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c(power_marginal_primary, power_marginal_secondary), sim_success = success_fns ) power_output$power #> $power_local #> H1 H2 H3 H4 #> 0.76396 0.75887 0.56767 0.69133 #> #> $rejection_expected #> [1] 2.78183 #> #> $power_at_least_1 #> [1] 0.85557 #> #> $power_all #> [1] 0.51205 #> #> $power_success #> H1 Expected no. of rejections #> 0.76396 2.78183 #> AtLeast1 All #> 0.85557 0.51205 #> H1andH2 (H1andH3)or(H2andH4) #> 0.66726 0.74695 set.seed(1234) power_verbose_output <- graph_calculate_power( g, alpha = 0.025, sim_corr = corr, sim_n = 1e5, power_marginal = c(power_marginal_primary, power_marginal_secondary), sim_success = success_fns, verbose = TRUE ) head(power_verbose_output$details$p_sim, 10) #> H1 H2 H3 H4 #> [1,] 0.0308204265 0.0120653993 0.0041185823 9.324338e-02 #> [2,] 0.0007933716 0.0006499046 0.0245177515 2.965604e-03 #> [3,] 0.0302991819 0.0595395828 0.0543082956 2.625834e-02 #> [4,] 0.0097433244 0.0033185711 0.0007417213 4.024688e-04 #> [5,] 0.0197134942 0.0086161835 0.0164182765 2.418325e-07 #> [6,] 0.0031206572 0.0067023099 0.0137441457 2.751703e-04 #> [7,] 0.0302208038 0.1423757994 0.0060382838 2.117403e-02 #> [8,] 0.0024975725 0.0294025573 0.0004142729 2.207786e-03 #> [9,] 0.0618994292 0.0387257108 0.3166125781 5.699791e-02 #> [10,] 0.3677921053 0.1895975134 0.0702264885 1.189651e-02 print(power_verbose_output, indent = 4, precision = 6) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 100,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 #> Marginal power: 0.802831 0.802831 0.705414 0.901481 #> #> Correlation: H1 H2 H3 H4 #> H1 1.00 0.50 0.50 0.25 #> H2 0.50 1.00 0.25 0.50 #> H3 0.50 0.25 1.00 0.50 #> H4 0.25 0.50 0.50 1.00 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 #> Local power: 0.76396 0.75887 0.56767 0.69133 #> #> Expected no. of rejections: 2.78183 #> Power to reject 1 or more: 0.85557 #> Power to reject all: 0.51205 #> #> Success measure Power #> H1 0.76396 #> Expected no. of rejections 2.78183 #> AtLeast1 0.85557 #> All 0.51205 #> H1andH2 0.66726 #> (H1andH3)or(H2andH4) 0.74695 #> #> Simulation details ($details) -------------------------------------------------- #> p_sim_H1 p_sim_H2 p_sim_H3 p_sim_H4 rej_H1 rej_H2 rej_H3 rej_H4 #> 3.08204e-02 1.20654e-02 4.11858e-03 9.32434e-02 FALSE TRUE FALSE FALSE #> 7.93372e-04 6.49905e-04 2.45178e-02 2.96560e-03 TRUE TRUE TRUE TRUE #> 3.02992e-02 5.95396e-02 5.43083e-02 2.62583e-02 FALSE FALSE FALSE FALSE #> 9.74332e-03 3.31857e-03 7.41721e-04 4.02469e-04 TRUE TRUE TRUE TRUE #> 1.97135e-02 8.61618e-03 1.64183e-02 2.41833e-07 TRUE TRUE TRUE TRUE #> 3.12066e-03 6.70231e-03 1.37441e-02 2.75170e-04 TRUE TRUE TRUE TRUE #> 3.02208e-02 1.42376e-01 6.03828e-03 2.11740e-02 FALSE FALSE FALSE FALSE #> 2.49757e-03 2.94026e-02 4.14273e-04 2.20779e-03 TRUE FALSE TRUE FALSE #> 6.18994e-02 3.87257e-02 3.16613e-01 5.69979e-02 FALSE FALSE FALSE FALSE #> 3.67792e-01 1.89598e-01 7.02265e-02 1.18965e-02 FALSE FALSE FALSE FALSE #> ... (Use `print(x, rows = )` for more)"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Dong Xi. Author, maintainer. Ethan Brockmann. Author. Gilead Sciences, Inc.. Copyright holder, funder.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Xi D, Brockmann E (2024). graphicalMCP: Graphical multiple comparison procedures, version 0.2.3 edition. https://github.com/Gilead-BioStats/graphicalMCP.","code":"@Manual{, title = {{graphicalMCP}: Graphical multiple comparison procedures}, author = {Dong Xi and Ethan Brockmann}, edition = {version 0.2.3}, year = {2024}, url = {https://github.com/Gilead-BioStats/graphicalMCP}, }"},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"introduction","dir":"","previous_headings":"","what":"Introduction","title":"Graphical Multiple Comparison Procedures","text":"Graphical approaches multiple comparison procedures (MCPs) general framework control family-wise error rate strongly pre-specified significance level 0 < α < 1. approach includes many commonly used MCPs special cases transparent visualizing MCPs better communications. graphicalMCP designed design analyze graphical MCPs flexible, informative efficient way.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Graphical Multiple Comparison Procedures","text":"graphicalMCP currently CRAN can installed GitHub using following code:","code":"# install.packages(\"pak\") pak::pak(\"Gilead-BioStats/graphicalMCP\")"},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"documentation","dir":"","previous_headings":"","what":"Documentation","title":"Graphical Multiple Comparison Procedures","text":"basic usage instructions, see vignette(\"graphicalMCP\") become familiar graphical MCP terminologies, see vignette(\"glossary\") see vignette(\"shortcut-testing\") sequentially rejective graphical multiple comparison procedures based Bonferroni tests see vignette(\"closed-testing\") graphical multiple comparison procedures based closure principle see vignette(\"graph-examples\") common multiple comparison procedures illustrated using graphicalMCP see vignette(\"generate-closure\") rationales generate closure weighting strategy graph see vignette(\"comparisons\") comparisons R packages view vignettes R properly installing graphicalMCP GitHub, can build vignettes devtools::install(build_vignettes = TRUE), use browseVignettes(\"graphicalMCP\") view full list vignettes","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"related-work","dir":"","previous_headings":"","what":"Related work","title":"Graphical Multiple Comparison Procedures","text":"Graphical MCPs - gMCP Lighter version gMCP removes rJava dependency - gMCPLite Graphical MCPs Simes tests - lrstat Built upon packages, hope implement graphical MCPs general framework, fewer dependencies simpler S3 classes, without losing computational efficiency.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/index.html","id":"acknowledgments","dir":"","previous_headings":"","what":"Acknowledgments","title":"Graphical Multiple Comparison Procedures","text":"Along authors contributors, thanks following people suggestions inspirations package: Frank Bretz, Willi Maurer, Ekkehard Glimm, Nan Chen, Jeremy Wildfire, Spencer Childress, Colleen McLaughlin, Matt Roumaya, Chelsea Dickens, Ron Yu owe debt gratitude authors gMCP pioneering work, without package nearly extensive .","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate adjusted p-values — adjust_p_bonferroni","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"intersection hypothesis, adjusted p-value smallest significance level intersection hypothesis can rejected. intersection hypothesis can rejected adjusted p-value less equal \\(\\alpha\\). Currently, three test types supported: Bonferroni tests graphicalMCP:::adjust_p_bonferroni(), Parametric tests graphicalMCP:::adjust_p_parametric(), Note one-sided tests required parametric tests. Simes tests graphicalMCP:::adjust_p_simes().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"","code":"adjust_p_bonferroni(p, hypotheses) adjust_p_parametric( p, hypotheses, test_corr = NULL, maxpts = 25000, abseps = 1e-06, releps = 0 ) adjust_p_simes(p, hypotheses)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match length hypotheses. hypotheses numeric vector hypothesis weights. Must vector values 0 & 1 (inclusive). length match length p. sum hypothesis weights exceed 1. test_corr (Optional) numeric matrix correlations test statistics, needed perform parametric tests using graphicalMCP:::adjust_p_parametric(). number rows columns correlation matrix match length p. maxpts (Optional) integer scalar maximum number function values, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 25000. abseps (Optional) numeric scalar absolute error tolerance, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 1e-6. releps (Optional) numeric scalar relative error tolerance double, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 0.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"single adjusted p-value intersection hypothesis.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_p.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate adjusted p-values — adjust_p_bonferroni","text":"","code":"set.seed(1234) hypotheses <- c(H1 = 0.5, H2 = 0.25, H3 = 0.25) p <- c(0.019, 0.025, 0.05) # Bonferroni test graphicalMCP:::adjust_p_bonferroni(p, hypotheses) #> [1] 0.038 # Simes test graphicalMCP:::adjust_p_simes(p, hypotheses) #> [1] 0.03333333 # Parametric test # Using the `mvtnorm::GenzBretz` algorithm corr <- matrix(0.5, nrow = 3, ncol = 3) diag(corr) <- 1 graphicalMCP:::adjust_p_parametric(p, hypotheses, corr) #> [1] 0.03343516"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate adjusted hypothesis weights — adjust_weights_parametric","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"intersection hypothesis can rejected p-values less equal adjusted significance levels, adjusted hypothesis weights times \\(\\alpha\\). Bonferroni tests, adjusted hypothesis weights hypothesis weights intersection hypothesis. Additional adjustment needed parametric Simes tests: Parametric tests graphicalMCP:::adjust_weights_parametric(), Note one-sided tests required parametric tests. Simes tests graphicalMCP:::adjust_weights_simes().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"","code":"adjust_weights_parametric( matrix_weights, matrix_intersections, test_corr, alpha, test_groups, maxpts = 25000, abseps = 1e-06, releps = 0 ) adjust_weights_simes(matrix_weights, p, test_groups) c_value_function( x, hypotheses, test_corr, alpha, maxpts = 25000, abseps = 1e-06, releps = 0 ) solve_c_parametric( hypotheses, test_corr, alpha, maxpts = 25000, abseps = 1e-06, releps = 0 )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"matrix_weights (Optional) matrix hypothesis weights intersection hypotheses. can obtained second half columns output graph_generate_weights(). matrix_intersections (Optional) matrix hypothesis indicators intersection hypotheses. can obtained first half columns output graph_generate_weights(). test_corr (Optional) numeric matrix correlations test statistics, needed perform parametric tests using graphicalMCP:::adjust_p_parametric(). number rows columns correlation matrix match length p. alpha (Optional) numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups (Optional) list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. maxpts (Optional) integer scalar maximum number function values, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 25000. abseps (Optional) numeric scalar absolute error tolerance, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 1e-6. releps (Optional) numeric scalar relative error tolerance double, needed perform parametric tests using mvtnorm::GenzBretz algorithm. default 0. p (Optional) numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match length hypotheses. x root solve stats::uniroot(). hypotheses (Optional) numeric vector hypothesis weights. Must vector values 0 & 1 (inclusive). length match length p. sum hypothesis weights exceed 1.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"graphicalMCP:::adjust_weights_parametric() returns matrix dimensions matrix_weights, whose hypothesis weights adjusted according parametric tests. graphicalMCP:::adjust_weights_simes() returns matrix dimensions matrix_weights, whose hypothesis weights adjusted according Simes tests. graphicalMCP:::c_value_function() returns difference \\(\\alpha\\) Type error parametric test \\(c\\) value x, adjusted correlation test statistics using parametric tests based equation (6) Xi et al. (2017). graphicalMCP:::solve_c_parametric() returns c value adjusted correlation test statistics using parametric tests based equation (6) Xi et al. (2017).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/adjust_weights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate adjusted hypothesis weights — adjust_weights_parametric","text":"","code":"set.seed(1234) alpha <- 0.025 p <- c(0.018, 0.01, 0.105, 0.006) num_hyps <- length(p) g <- bonferroni_holm(rep(1 / 4, 4)) weighting_strategy <- graph_generate_weights(g) matrix_intersections <- weighting_strategy[, seq_len(num_hyps)] matrix_weights <- weighting_strategy[, -seq_len(num_hyps)] set.seed(1234) graphicalMCP:::adjust_weights_parametric( matrix_weights = matrix_weights, matrix_intersections = matrix_intersections, test_corr = diag(4), alpha = alpha, test_groups = list(1:4) ) #> H1 H2 H3 H4 #> 1 0.2523785 0.2523785 0.2523785 0.2523785 #> 2 0.3361503 0.3361503 0.3361503 0.0000000 #> 3 0.3361503 0.3361503 0.0000000 0.3361503 #> 4 0.5031647 0.5031647 0.0000000 0.0000000 #> 5 0.3361503 0.0000000 0.3361503 0.3361503 #> 6 0.5031647 0.0000000 0.5031647 0.0000000 #> 7 0.5031647 0.0000000 0.0000000 0.5031647 #> 8 1.0000000 0.0000000 0.0000000 0.0000000 #> 9 0.0000000 0.3361503 0.3361503 0.3361503 #> 10 0.0000000 0.5031647 0.5031647 0.0000000 #> 11 0.0000000 0.5031647 0.0000000 0.5031647 #> 12 0.0000000 1.0000000 0.0000000 0.0000000 #> 13 0.0000000 0.0000000 0.5031647 0.5031647 #> 14 0.0000000 0.0000000 1.0000000 0.0000000 #> 15 0.0000000 0.0000000 0.0000000 1.0000000 graphicalMCP:::adjust_weights_simes( matrix_weights = matrix_weights, p = p, test_groups = list(1:4) ) #> H4 H2 H1 H3 #> 1 0.2500000 0.5000000 0.7500000 1 #> 2 0.0000000 0.3333333 0.6666667 1 #> 3 0.3333333 0.6666667 1.0000000 1 #> 4 0.0000000 0.5000000 1.0000000 1 #> 5 0.3333333 0.3333333 0.6666667 1 #> 6 0.0000000 0.0000000 0.5000000 1 #> 7 0.5000000 0.5000000 1.0000000 1 #> 8 0.0000000 0.0000000 1.0000000 1 #> 9 0.3333333 0.6666667 0.6666667 1 #> 10 0.0000000 0.5000000 0.5000000 1 #> 11 0.5000000 1.0000000 1.0000000 1 #> 12 0.0000000 1.0000000 1.0000000 1 #> 13 0.5000000 0.5000000 0.5000000 1 #> 14 0.0000000 0.0000000 0.0000000 1 #> 15 1.0000000 1.0000000 1.0000000 1 graphicalMCP:::solve_c_parametric( hypotheses = matrix_weights[1, ], test_corr = diag(4), alpha = alpha ) #> [1] 1.009514"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"Graph objects different structures attributes graphicalMCP, gMCP, igraph R packages. functions convert different classes increase compatibility. Note igraph gMCP additional attributes vertices, edges, graph . conversion functions handle attributes related hypothesis names, hypothesis weights transition weights. attributes dropped converting.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"","code":"as_initial_graph(graph) # S3 method for graphMCP as_initial_graph(graph) # S3 method for igraph as_initial_graph(graph) as_graphMCP(graph) # S3 method for initial_graph as_graphMCP(graph) as_igraph(graph) # S3 method for initial_graph as_igraph(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"graph initial_graph object graphicalMCP package, graphMCP object gMCP package, igraph object igraph package, depending conversion type.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"as_graphMCP() returns graphMCP object gMCP package. as_igraph() returns igraph object igraph package. as_initial_graph() returns initial_graph object graphicalMCP package.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"Csardi, G., Nepusz, T., Traag, V., Horvat, S., Zanini, F., Noom, D., Mueller, K. (2024). igraph: Network analysis visualization R. R package version 2.0.3. https://CRAN.R-project.org/package=igraph. Rohmeyer, K., Klinglmueller, K. (2024). gMCP: Graph based multiple test procedures. R package version 0.8-17. https://cran.r-project.org/package=gMCP.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/as_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Convert between graphicalMCP, gMCP, and igraph graph classes — as_initial_graph","text":"","code":"g_graphicalMCP <- random_graph(5) if (requireNamespace(\"gMCP\", quietly = TRUE)) { g_gMCP <- as_graphMCP(g_graphicalMCP) all.equal(g_graphicalMCP, as_initial_graph(g_gMCP)) } #> [1] TRUE if (requireNamespace(\"igraph\", quietly = TRUE)) { g_igraph <- as_igraph(g_graphicalMCP) all.equal(g_graphicalMCP, as_initial_graph(g_igraph)) } #> [1] TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":null,"dir":"Reference","previous_headings":"","what":"Find pairs of vertices that are connected in both directions — edge_pairs","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"initial graph, find pairs hypotheses connected directions. used plot graphs using plot.initial_graph().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"","code":"edge_pairs(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"graph initial graph returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"list vertex pairs connected directions. NULL pairs found.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/edge_pairs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find pairs of vertices that are connected in both directions — edge_pairs","text":"","code":"graphicalMCP:::edge_pairs(bonferroni_holm(hypotheses = rep(1 / 3, 3))) #> [[1]] #> [1] \"H2|H1\" #> #> [[2]] #> [1] \"H3|H1\" #> #> [[3]] #> [1] \"H1|H2\" #> #> [[4]] #> [1] \"H3|H2\" #> #> [[5]] #> [1] \"H1|H3\" #> #> [[6]] #> [1] \"H2|H3\" #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":null,"dir":"Reference","previous_headings":"","what":"Example graphs of commonly used multiple comparison procedures — bonferroni","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"Built-functions quickly generate select graphical multiple comparison procedures.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"","code":"bonferroni(hypotheses, hyp_names = NULL) bonferroni_holm(hypotheses, hyp_names = NULL) huque_etal(hyp_names = NULL) fallback(hypotheses, hyp_names = NULL) fallback_improved_1(hypotheses, hyp_names = NULL) fallback_improved_2(hypotheses, epsilon = 1e-04, hyp_names = NULL) fixed_sequence(num_hyps, hyp_names = NULL) simple_successive_1(hyp_names = NULL) simple_successive_2(hyp_names = NULL) random_graph(num_hyps, hyp_names = NULL) two_doses_two_primary_two_secondary(hyp_names = NULL) three_doses_two_primary_two_secondary(hyp_names = NULL)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"hypotheses (Optional) numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match num_hyps length hyp_names. sum hypothesis weights exceed 1. hyp_names (Optional) character vector hypothesis names. length match num_hyps length hypotheses. hyp_names specified, hypotheses named sequentially H1, H2, ....... epsilon (Optional) numeric scalar indicating value \\(\\epsilon\\) edge. much smaller value hypothesis transition weights. default 1e-4. num_hyps (Optional) Number hypotheses graphical multiple comparison procedure.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"S3 object returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Huque, M. F., Alosh, M., Bhore, R. (2011). Addressing multiplicity issues composite endpoint components clinical trials. Journal Biopharmaceutical Statistics, 21(4), 610-634. Maurer, W., Hothorn, L., Lehmacher, W. (1995). Multiple comparisons drug clinical trials preclinical assays: -priori ordered hypotheses. Biometrie der chemisch-pharmazeutischen Industrie, 6, 3-18. Westfall, P. H., Krishen, . (2001). Optimally weighted, fixed sequence gatekeeper multiple testing procedures. Journal Statistical Planning Inference, 99(1), 25-40. Wiens, B. L. (2003). fixed sequence Bonferroni procedure testing multiple endpoints. Pharmaceutical Statistics, 2(3), 211-215. Wiens, B. L., Dmitrienko, . (2005). fallback procedure evaluating single family hypotheses. Journal Biopharmaceutical Statistics, 15(6), 929-942. Xi, D., Bretz, F. (2019). Symmetric graphs equally weighted tests, application Hochberg procedure. Statistics Medicine, 38(27), 5268-5282.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/example_graphs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Example graphs of commonly used multiple comparison procedures — bonferroni","text":"","code":"# Bretz et al. (2009) bonferroni(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 0 0 #> H2 0 0 0 #> H3 0 0 0 # Bretz et al. (2009) bonferroni_holm(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0 0.5 0.5 #> H2 0.5 0.0 0.5 #> H3 0.5 0.5 0.0 # Huque et al. (2011) huque_etal() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: 0 #> H3: 0 #> H4: 0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.0 0.0 0.0 1.0 #> H3 0.0 0.5 0.0 0.5 #> H4 0.0 1.0 0.0 0.0 # Wiens (2003) fallback(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 1 0 #> H2 0 0 1 #> H3 0 0 0 # Wiens and Dmitrienko (2005) fallback_improved_1(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0 1.0 0.0 #> H2 0.0 0.0 1.0 #> H3 0.5 0.5 0.0 # Bretz et al. (2009) fallback_improved_2(hypotheses = rep(1 / 3, 3)) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.3333 #> H3: 0.3333 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0000 1.0000 0.0000 #> H2 0.9999 0.0000 0.0001 #> H3 1.0000 0.0000 0.0000 # Maurer et al. (1995); Westfall and Krishen (2001) fixed_sequence(num_hyps = 3) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 1 #> H2: 0 #> H3: 0 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0 1 0 #> H2 0 0 1 #> H3 0 0 0 # Figure 1 in Bretz et al. (2011) simple_successive_1() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 # Figure 4 in Bretz et al. (2011) simple_successive_2() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 # Create a random graph with three hypotheses random_graph(num_hyps = 3) #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.250 #> H2: 0.375 #> H3: 0.375 #> #> --- Transition weights --- #> H1 H2 H3 #> H1 0.0000 0.3333 0.6667 #> H2 0.7500 0.0000 0.2500 #> H3 0.7500 0.2500 0.0000 # Figure 6 in Xi and Bretz et al. (2019) two_doses_two_primary_two_secondary() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.0 #> H3: 0.0 #> H4: 0.5 #> H5: 0.0 #> H6: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 #> H1 0.0000 0.5000 0.5000 0.0000 0.0000 0.0000 #> H2 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 #> H3 0.0000 0.9999 0.0000 0.0001 0.0000 0.0000 #> H4 0.0000 0.0000 0.0000 0.0000 0.5000 0.5000 #> H5 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000 #> H6 0.0001 0.0000 0.0000 0.0000 0.9999 0.0000 # Add another dose to Figure 6 in Xi and Bretz et al. (2019) three_doses_two_primary_two_secondary() #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.3333 #> H2: 0.0000 #> H3: 0.0000 #> H4: 0.3333 #> H5: 0.0000 #> H6: 0.0000 #> H7: 0.3333 #> H8: 0.0000 #> H9: 0.0000 #> #> --- Transition weights --- #> H1 H2 H3 H4 H5 H6 H7 H8 H9 #> H1 0.00000 0.50000 0.50000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> H2 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 #> H3 0.00000 0.99990 0.00000 0.00005 0.00000 0.00000 0.00005 0.00000 0.00000 #> H4 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 0.00000 0.00000 0.00000 #> H5 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 #> H6 0.00005 0.00000 0.00000 0.00000 0.99990 0.00000 0.00005 0.00000 0.00000 #> H7 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.50000 0.50000 #> H8 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 #> H9 0.00005 0.00000 0.00000 0.00005 0.00000 0.00000 0.00000 0.99990 0.00000"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"alternative hypotheses, distribution test statistics assumed multivariate normal distribution. Given distribution, function calculates power values graphical multiple comparison procedure. default, calculate local power, probability reject individual hypothesis, probability reject least one hypothesis, probability reject hypotheses, expected number rejections, probability user-defined success criteria. See vignette(\"shortcut-testing\") vignette(\"closed-testing\") illustration power calculation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"","code":"graph_calculate_power( graph, alpha = 0.025, power_marginal = rep(alpha, length(graph$hypotheses)), test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr = rep(list(NA), length(test_types)), sim_n = 1e+05, sim_corr = diag(length(graph$hypotheses)), sim_success = NULL, verbose = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"graph initial graph returned graph_create(). alpha numeric value one-sided overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing. Note one-sided tests supported. power_marginal numeric vector marginal power values use simulating p-values. See Details simulation process. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. sim_n integer scalar specifying number simulations. default 1e5. sim_corr numeric matrix correlations test statistics hypotheses. dimensions match number hypotheses graph. sim_success list user-defined functions specify success criteria. Functions must take one simulation's logical vector results input, return length-one logical vector. instance, \"success\" means rejecting hypotheses 1 2, use sim_success = list(\"1 2\" = function(x) x[1] && x[2]). list named, function body used name. Lambda functions also work starting R 4.1, e.g. sim_success = list(\\(x) x[3] || x[4]). verbose logical scalar specifying whether details power simulations included results. default verbose = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"power_report object list 3 elements: inputs - Input parameters, list : graph - Initial graph, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, test_types - Different types tests, test_corr - Correlation matrices parametric tests, sim_n - Number simulations, power_marginal - Marginal power hypotheses sim_corr - Correlation matrices simulations, sim_success - User-defined success criteria. power - list power values power_local - Local power hypotheses, proportion simulations hypothesis rejected, rejection_expected - Expected (average) number rejected hypotheses, power_at_least_1 - Power reject least one hypothesis, power_all - Power reject hypotheses, power_success - Power user-defined success, proportion simulations user-defined success criterion sim_success met. details - optional list datasets showing simulated p-values results simulation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"simulation-details","dir":"Reference","previous_headings":"","what":"Simulation details","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"power calculation based simulations. distribution simulate determined multivariate normal distribution power_marginal sim_corr. particular, power_marginal vector marginal power values hypotheses. marginal power power reject null hypothesis significance level alpha without multiplicity adjustment. value readily available standard software R packages. can determine mean multivariate normal distribution $$\\Phi^{-1}\\left(1-\\alpha\\right)-\\Phi^{-1}\\left(1-d_i\\right)$$, often called non-centrality parameter drift parameter. \\(d_i\\) marginal power power_marginal hypothesis \\(\\). Given correlation matrix sim_corr, can simulate multivariate normal distribution using mvtnorm R package (Genz Bretz, 2009). set simulated values can used calculate corresponding one-sided p-values. set p-values plugged graphical multiple comparison procedure determine hypotheses rejected. process repeated n_sim times produce power values proportion simulations particular success criterion met.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Bretz, F., Maurer, W., Hommel, G. (2011b). Test power considerations multiple endpoint analyses using sequentially rejective graphical procedures. Statistics Medicine, 30(13), 1489-1501. Genz, ., Bretz, F. (2009). Computation Multivariate Normal t Probabilities, series Lecture Notes Statistics. Springer-Verlag, Heidelberg. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_calculate_power.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate power values for a graphical multiple comparison procedure — graph_calculate_power","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011a). alpha <- 0.025 hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) marginal_power <- c(0.8, 0.8, 0.7, 0.9) corr1 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr1) <- 1 corr <- rbind( cbind(corr1, 0.5 * corr1), cbind(0.5 * corr1, corr1) ) success_fns <- list( # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both (H1 and H3) or (H2 and H4) `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) ) set.seed(1234) # Bonferroni tests power_output <- graph_calculate_power( g, alpha, sim_corr = corr, sim_n = 1e5, power_marginal = marginal_power, sim_success = success_fns ) # Parametric tests for H1 and H2; Simes tests for H3 and H4 # User-defined success: to reject H1 or H2; to reject H1 and H2 # Reduce the number of simulations to save time for package compilation graph_calculate_power( g, alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"simes\"), test_corr = list(corr1, NA), sim_n = 1e3, sim_success = list( function(.) .[1] || .[2], function(.) .[1] && .[2] ) ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> Parametric testing correlation: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H4) #> #> Simulation parameters ($inputs) ------------------------------------------------ #> Testing 1,000 simulations with multivariate normal params: #> #> H1 H2 H3 H4 #> Marginal power: 0.025 0.025 0.025 0.025 #> #> Correlation: H1 H2 H3 H4 #> H1 1 0 0 0 #> H2 0 1 0 0 #> H3 0 0 1 0 #> H4 0 0 0 1 #> #> Power calculation ($power) ----------------------------------------------------- #> H1 H2 H3 H4 #> Local power: 0.020 0.011 0.000 0.000 #> #> Expected no. of rejections: 0.031 #> Power to reject 1 or more: 0.03 #> Power to reject all: 0 #> #> Success measure Power #> .[1] || .[2] 0.030 #> .[1] && .[2] 0.001 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create the initial graph for a multiple comparison procedure — graph_create","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"graphical multiple comparison procedure represented 1) vector initial hypothesis weights hypotheses, 2) matrix initial transition weights transitions. function creates initial graph object using hypothesis weights transition weights.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"","code":"graph_create(hypotheses, transitions, hyp_names = NULL)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"hypotheses numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match row column lengths transitions. sum hypothesis weights exceed 1. transitions numeric matrix transition weights hypotheses graphical multiple comparison procedure. Must square matrix values 0 & 1 (inclusive). row column lengths match length hypotheses. row (Transition weights leaving hypothesis) can sum 1. diagonal entries (Transition weights hypothesis ) must 0s. hyp_names (Optional) character vector hypothesis names. provided, names hypotheses transitions used. names specified, hypotheses named sequentially H1, H2, .......","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"S3 object class initial_graph list 2 elements: Hypothesis weights hypotheses. Transition weights transitions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"validation-of-inputs","dir":"Reference","previous_headings":"","what":"Validation of inputs","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"Inputs also validated make sure validity graph: Hypothesis weights hypotheses numeric. Transition weights transitions numeric. Length hypotheses dimensions transitions match. Hypothesis weights hypotheses must non-negative sum 1. Transition weights transitions: Values must non-negative. Rows must sum 1. Diagonal entries must 0. Hypothesis names hyp_names override names hypotheses transitions.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create the initial graph for a multiple comparison procedure — graph_create","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H11\", \"H12\", \"H21\", \"H22\") g <- graph_create(hypotheses, transitions, hyp_names) g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0 # Explicit names override names in `hypotheses` (with a warning) hypotheses <- c(h1 = 0.5, h2 = 0.5, h3 = 0, h4 = 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions, hyp_names) #> Warning: Hypothesis names specified - overriding names in #> `hypotheses` and `transitions` g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0 # Use names in `transitions` hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( H1 = c(0, 0, 1, 0), H2 = c(0, 0, 0, 1), H3 = c(0, 1, 0, 0), H4 = c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) g #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 # Unmatched names in `hypotheses` and `transitions` (with an error) hypotheses <- c(h1 = 0.5, h2 = 0.5, h3 = 0, h4 = 0) transitions <- rbind( H1 = c(0, 0, 1, 0), H2 = c(0, 0, 0, 1), H3 = c(0, 1, 0, 0), H4 = c(1, 0, 0, 0) ) # g <- graph_create(hypotheses, transitions) # When names are not specified, hypotheses are numbered sequentially as # H1, H2, ... hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) g #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"graphical multiple comparison procedure defines closed test procedure, tests intersection hypothesis reject individual hypothesis intersection hypotheses involving rejected. intersection hypothesis represents parameter space individual null hypotheses involved true simultaneously. closure based graph consists updated graphs (corresponding intersection hypotheses) combinations hypotheses deleted. graphical multiple comparison procedure \\(m\\) hypotheses, \\(2^{m}-1\\) updated graphs (intersection hypotheses), including initial graph (overall intersection hypothesis). weighting strategy graph consists hypothesis weights \\(2^{m}-1\\) updated graphs (intersection hypotheses). algorithm derive weighting strategy based Algorithm 1 Bretz et al. (2011).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"","code":"graph_generate_weights(graph)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"graph initial graph returned graph_create().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"numeric matrix intersection hypotheses hypothesis weights. graphical multiple comparison procedure \\(m\\) hypotheses, number rows \\(2^{m}-1\\), corresponds intersection hypothesis. number columns \\(2\\cdot m\\). first \\(m\\) columns indicate individual hypotheses included given intersection hypothesis second half columns provide hypothesis weights individual hypothesis given intersection hypothesis.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"performance","dir":"Reference","previous_headings":"","what":"Performance","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"Generation intersection hypotheses closely related power set given set indices. number hypotheses increases, memory time usage can grow quickly (e.g., rate \\(O(2^n)\\)). also multiple ways implement Algorithm 1 Bretz et al. (2011). See vignette(\"generate-closure\") information generating intersection hypotheses comparisons different approaches calculate weighting strategies.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_generate_weights.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate the weighting strategy based on a graphical multiple comparison procedure — graph_generate_weights","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) graph_generate_weights(g) #> H1 H2 H3 H4 H1 H2 H3 H4 #> 1 1 1 1 1 0.5 0.5 0.0 0.0 #> 2 1 1 1 0 0.5 0.5 0.0 0.0 #> 3 1 1 0 1 0.5 0.5 0.0 0.0 #> 4 1 1 0 0 0.5 0.5 0.0 0.0 #> 5 1 0 1 1 0.5 0.0 0.0 0.5 #> 6 1 0 1 0 1.0 0.0 0.0 0.0 #> 7 1 0 0 1 0.5 0.0 0.0 0.5 #> 8 1 0 0 0 1.0 0.0 0.0 0.0 #> 9 0 1 1 1 0.0 0.5 0.5 0.0 #> 10 0 1 1 0 0.0 0.5 0.5 0.0 #> 11 0 1 0 1 0.0 1.0 0.0 0.0 #> 12 0 1 0 0 0.0 1.0 0.0 0.0 #> 13 0 0 1 1 0.0 0.0 0.5 0.5 #> 14 0 0 1 0 0.0 0.0 1.0 0.0 #> 15 0 0 0 1 0.0 0.0 0.0 1.0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":null,"dir":"Reference","previous_headings":"","what":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"multiple hypotheses rejected using graph_test_shortcut(), may multiple orderings sequences hypotheses rejected one one. default order graph_test_shortcut() based adjusted p-values, smallest largest. function graph_rejection_orderings() provides possible valid orders (sequences) rejections. Although order rejection affect final rejection decisions Bretz et al. (2009), different sequences offer different ways explain step--step process shortcut graphical multiple comparison procedures.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"","code":"graph_rejection_orderings(shortcut_test_result)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"shortcut_test_result graph_report object returned graph_test_shortcut().","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"modified graph_report object containing valid orderings rejections hypotheses","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_rejection_orderings.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Find alternate rejection orderings (sequences) for shortcut tests — graph_rejection_orderings","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 shortcut_testing <- graph_test_shortcut(g, p, alpha, verbose = TRUE) # Reject H1, H2, and H4 shortcut_testing$outputs$rejected #> H1 H2 H3 H4 #> TRUE TRUE FALSE TRUE # Default order of rejections: H2, H1, H4 shortcut_testing$details$del_seq #> [1] \"H2\" \"H1\" \"H4\" # There is another valid sequence of rejection: H2, H4, H1 graph_rejection_orderings(shortcut_testing)$valid_orderings #> [[1]] #> H2 H1 H4 #> 2 1 4 #> #> [[2]] #> H2 H4 H1 #> 2 4 1 #> # Finally, intermediate updated graphs can be obtained by providing the order # of rejections into `[graph_update()]` graph_update(g, delete = c(2, 4, 1)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Updated graph after deleting hypotheses 2, 4, 1 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.75 #> H2: NA #> H3: 0.00 #> H4: 0.25 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.000000 NA 0.666667 0.333333 #> H2 NA NA NA NA #> H3 0.500000 NA 0.000000 0.500000 #> H4 1.000000 NA 0.000000 0.000000 #> #> Step 2: Updated graph after removing hypotheses 2, 4 #> #> --- Hypothesis weights --- #> H1: 1 #> H2: NA #> H3: 0 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 NA #> H2 NA NA NA NA #> H3 1 NA 0 NA #> H4 NA NA NA NA #> #> Step 3: Updated graph after removing hypotheses 2, 4, 1 #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform closed graphical multiple comparison procedures — graph_test_closure","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Closed graphical multiple comparison procedures, graphical multiple comparison procedures based closure, generate closure based graph consisting intersection hypotheses. tests intersection hypothesis rejects individual hypothesis intersection hypotheses involving rejected. intersection hypothesis represents parameter space individual null hypotheses involved true simultaneously. graphical multiple comparison procedure $m$ hypotheses, \\(2^m-1\\) intersection hypotheses. intersection hypothesis, test type chosen determine reject intersection hypothesis. Current choices test types include Bonferroni, Simes parametric. implementation offers general framework covering Bretz et al. (2011), Lu (2016), Xi et al. (2017). See vignette(\"closed-testing\") illustration closed test procedures interpretation outputs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"","code":"graph_test_closure( graph, p, alpha = 0.025, test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr = rep(list(NA), length(test_types)), verbose = FALSE, test_values = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. verbose logical scalar specifying whether details adjusted p-value calculations included results. verbose = TRUE, adjusted p-values provided intersection hypothesis. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. default test_values = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"graph_report object list 4 elements: inputs - Input parameters, list : graph - Initial graph, p - (Unadjusted raw) p-values, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, test_types - Different types tests, test_corr - Correlation matrices parametric tests. outputs - Output parameters, list : adjusted_p - Adjusted p-values, rejected - Rejected hypotheses, graph - Updated graph deleting rejected hypotheses. details - Verbose outputs adjusted p-values intersection hypotheses, verbose = TRUE. test_values - Adjusted significance levels, test_values = TRUE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"details-for-test-specification","dir":"Reference","previous_headings":"","what":"Details for test specification","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Test specification includes three components: test_groups, test_types, test_corr. Alignment among entries components important correct implementation. two ways provide test specification. first approach \"unnamed\" approach, assumes 3 components ordered way, .e., $n$-th element test_types test_corr apply $n$-th group test_groups. second \"named\" approach uses name element component connect element test_types test_corr correct element test_groups. Consistency ensured correct implementation.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_closure.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform closed graphical multiple comparison procedures — graph_test_closure","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses # (H1 and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 # Closed graphical multiple comparison procedure using Bonferroni tests # Same results as `graph_test_shortcut(g, p, alpha)` graph_test_closure(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.024 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.024 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # Closed graphical multiple comparison procedure using parametric tests for # H1 and H2, and Bonferroni tests for H3 and H4 set.seed(1234) corr_list <- list(matrix(c(1, 0.5, 0.5, 1), nrow = 2), NA) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(1:2, 3:4), test_types = c(\"parametric\", \"bonferroni\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> bonferroni: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # The \"named\" approach to obtain the same results # Note that \"group2\" appears before \"group1\" in `test_groups` set.seed(1234) corr_list <- list(group1 = matrix(c(1, 0.5, 0.5, 1), nrow = 2), group2 = NA) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(group1 = 1:2, group2 = 3:4), test_types = c(group2 = \"bonferroni\", group1 = \"parametric\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> bonferroni: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #> # Closed graphical multiple comparison procedure using parametric tests for # H1 and H2, and Simes tests for H3 and H4 set.seed(1234) graph_test_closure( graph = g, p = p, alpha = alpha, test_groups = list(group1 = 1:2, group2 = 3:4), test_types = c(group1 = \"parametric\", group2 = \"simes\"), test_corr = corr_list ) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0.0 0.5 0.5 0.0 #> H2 0.5 0.0 0.0 0.5 #> H3 0.0 1.0 0.0 0.0 #> H4 1.0 0.0 0.0 0.0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Correlation matrix: H1 H2 #> H1 1.0 0.5 #> H2 0.5 1.0 #> #> Test types #> parametric: (H1, H2) #> simes: (H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.02400 TRUE #> H2 0.01871 TRUE #> H3 0.10500 FALSE #> H4 0.02400 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"functions performs similarly graph_test_closure() graph_test_shortcut() optimized efficiently calculating power. example, generating weights calculating adjusted weights can done . Vectorization applied possible.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"","code":"graph_test_closure_fast(p, alpha, adjusted_weights, matrix_intersections) graph_test_shortcut_fast(p, alpha, adjusted_weights)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"p numeric vector one-sided p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value one-sided overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing. Note one-sided tests supported. adjusted_weights adjusted hypothesis weights, second half columns graph_generate_weights() output, adjusted appropriate test types (Bonferroni, Simes, parametric). matrix_intersections matrix hypothesis indicators weighting strategy, first half graph_generate_weights() output.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"logical integer vector indicating whether hypothesis can rejected .","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_fast.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform graphical multiple comparison procedures efficiently for power calculation — graph_test_closure_fast","text":"","code":"set.seed(1234) alpha <- 0.025 p <- c(0.018, 0.01, 0.105, 0.006) num_hyps <- length(p) g <- bonferroni_holm(rep(1 / 4, 4)) weighting_strategy <- graph_generate_weights(g) matrix_intersections <- weighting_strategy[, seq_len(num_hyps), drop = FALSE] adjusted_weights <- weighting_strategy[, -seq_len(num_hyps), drop = FALSE] graphicalMCP:::graph_test_closure_fast( p, alpha, adjusted_weights, matrix_intersections ) #> H1 H2 H3 H4 #> FALSE FALSE FALSE TRUE graphicalMCP:::graph_test_shortcut_fast( p, alpha, adjusted_weights ) #> H1 H2 H3 H4 #> FALSE FALSE FALSE TRUE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":null,"dir":"Reference","previous_headings":"","what":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"Shortcut graphical multiple comparison procedures sequentially rejective procedure based Bretz et al. (2009). $m$ hypotheses, $m$ steps obtain rejection decisions. procedure equivalent closed graphical multiple comparison procedures using Bonferroni tests intersection hypotheses, shortcut procedures faster perform. See vignette(\"shortcut-testing\") illustration shortcut procedures interpretation outputs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"","code":"graph_test_shortcut( graph, p, alpha = 0.025, verbose = FALSE, test_values = FALSE )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric scalar overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. verbose logical scalar specifying whether details intermediate update graphs included results. verbose = TRUE, intermediate update graphs provided deleting hypothesis, rejected. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. order rejection based order adjusted p-values smallest largest. default test_values = FALSE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"S3 object class graph_report list 4 elements: inputs - Input parameters, list : graph - Initial graph, *p - (Unadjusted raw) p-values, alpha - Overall significance level, test_groups - Groups hypotheses different types tests, list hypotheses graph_test_shortcut(), test_types - Different types tests, \"bonferroni\" graph_test_shortcut(). Output parameters outputs, list : adjusted_p - Adjusted p-values, rejected - Rejected hypotheses, graph - Updated graph deleting rejected hypotheses. details - Verbose outputs intermediate updated graphs, verbose = TRUE. test_values - Adjusted significance levels, test_values = TRUE.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_test_shortcut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Perform shortcut (sequentially rejective) graphical multiple comparison procedures — graph_test_shortcut","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 graph_test_shortcut(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.020 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.020 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":null,"dir":"Reference","previous_headings":"","what":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"hypothesis deleted, initial graph updated. deleted hypothesis hypothesis weight 0 transition weight 0. Remaining hypotheses updated hypothesis weights transition weights according Algorithm 1 Bretz et al. (2009).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"","code":"graph_update(graph, delete)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"graph initial graph returned graph_create(). delete logical integer vector, denoting hypotheses delete. logical vector results \"unordered mode\", means hypotheses corresponding TRUE delete deleted. sequence deletion follow sequence TRUE's delete. case, length logical vector must match number hypotheses graph. integer vector results \"ordered mode\", means delete specifies sequence hypotheses deleted indicating location deleted hypotheses, e.g., 1st, 2nd, etc. case, integer vector can length, must contain valid hypothesis numbers (greater 0, less equal number hypotheses graph).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"S3 object class updated_graph list 4 elements: initial_graph: initial graph object. updated_graph: updated graph object specified hypotheses deleted. deleted: numeric vector indicating hypotheses deleted. intermediate_graphs: using ordered mode, list intermediate updated graphs hypothesis deleted according sequence specified delete.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"sequence-of-deletion","dir":"Reference","previous_headings":"","what":"Sequence of deletion","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"multiple hypotheses deleted graph, many sequences deletion initial graph updated updated graph. interest updated graph hypotheses specified delete deleted, updated graph matter sequence deletion used. property proved Bretz et al. (2009). interest intermediate updated graph hypothesis deleted according sequence specified delete, integer vector delete specified detailed outputs provided.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graph_update.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Obtain an updated graph by updating an initial graphical after deleting hypotheses — graph_update","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" graph_update(g, delete = c(FALSE, TRUE, TRUE, FALSE)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 # Equivalent way in the \"ordered mode\" to obtain the updated graph after # deleting the second and third hypotheses # Additional intermediate updated graphs are also provided graph_update(g, delete = 2:3) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: 0.0 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 0 #> H2 NA NA NA NA #> H3 0 NA 0 1 #> H4 1 NA 0 0 #> #> Step 2: Updated graph after removing hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graphicalMCP-package.html","id":null,"dir":"Reference","previous_headings":"","what":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","title":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","text":"Graphical multiple comparison procedures (MCPs) control familywise error rate. class includes many commonly used procedures special cases. package low-dependency implementation graphical MCPs allow mixed types tests. also includes power simulations visualization graphical MCPs.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/graphicalMCP-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"graphicalMCP: Graphical Multiple Comparison Procedures — graphicalMCP-package","text":"Maintainer: Dong Xi dong.xi1@gilead.com Authors: Ethan Brockmann ethan.brockmann@atorusresearch.com contributors: Gilead Sciences, Inc. [copyright holder, funder]","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":null,"dir":"Reference","previous_headings":"","what":"Validate inputs for testing and power simulations — test_input_val","title":"Validate inputs for testing and power simulations — test_input_val","text":"Validate inputs testing power simulations","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Validate inputs for testing and power simulations — test_input_val","text":"","code":"test_input_val( graph, p, alpha, test_groups = list(seq_along(graph$hypotheses)), test_types = c(\"bonferroni\"), test_corr, verbose, test_values ) power_input_val(graph, sim_n, power_marginal, test_corr, success)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Validate inputs for testing and power simulations — test_input_val","text":"graph initial graph returned graph_create(). p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. test_groups list numeric vectors specifying hypotheses test together. Grouping needed correctly perform Simes parametric tests. test_types character vector test types apply test group. needed correctly perform Simes parametric tests. length match number elements test_groups. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups. verbose logical scalar specifying whether details adjusted p-value calculations included results. verbose = TRUE, adjusted p-values provided intersection hypothesis. default verbose = FALSE. test_values logical scalar specifying whether adjusted significance levels provided hypothesis. test_values = TRUE, provides equivalent way performing graphical multiple comparison procedures comparing p-value significance level. p-value hypothesis less equal significance level, hypothesis rejected. default test_values = FALSE. sim_n integer scalar specifying number simulations. default 1e5. power_marginal numeric vector marginal power values use simulating p-values. See Details simulation process. success list user-defined functions specify success criteria. Functions must take one simulation's logical vector results input, return length-one logical vector. instance, \"success\" means rejecting hypotheses 1 2, use sim_success = list(\"1 2\" = function(x) x[1] && x[2]). list named, function body used name. Lambda functions also work starting R 4.1, e.g. sim_success = list(\\(x) x[3] || x[4]).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/input_val.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Validate inputs for testing and power simulations — test_input_val","text":"Returns graph invisibly","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 plot method for class initial_graph — plot.initial_graph","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"plot initial_graph translates hypotheses vertices transitions edges create network plot. Vertices labeled hypothesis names hypothesis weights, edges labeled transition weights. See vignette(\"graph-examples\") illustration commonly used multiple comparison procedure using graphs.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"","code":"# S3 method for initial_graph plot( x, ..., v_palette = c(\"#6baed6\", \"#cccccc\"), layout = \"grid\", nrow = NULL, ncol = NULL, edge_curves = NULL, precision = 4, eps = NULL, background_color = \"white\", margins = c(0, 0, 0, 0) )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"x object class initial_graph plot. ... arguments passed igraph::plot.igraph(). v_palette character vector length two specifying colors retained deleted hypotheses. extensive color customization must done vertex.color. layout igraph layout specification (See ?igraph.plotting), \"grid\", lays hypotheses left--right top--bottom. nrow ncol control grid shape. nrow integer scalar specifying number rows vertex grid. row column counts specified, vertices laid close square possible. ncol integer scalar specifying number columns vertex grid. row column counts specified, vertices laid close square possible. edge_curves named numeric vector specifying curvature specific edges. Edge pairs (two vertices share edge possible direction) detected automatically get 0.25 curvature. Adjust edges adding entry name \"vertex1|vertex2, adjust default edge pairs curvature adding entry name \"pairs\" - edge_curves = c(\"pairs\" = 0.5, \"H1|H3\" = 0.25, \"H3|H4\" = 0.75). precision integer scalar indicating number decimal places display. eps numeric scalar. transition weight eps displayed \\(\\epsilon\\), indicates edges infinitesimally small weights. See Bretz et al. (2009) details. background_color character scalar specifying background color whole plotting area. Passed directly graphics::par() (bg). margins length 4 numeric vector specifying margins plot. Defaults 0, since igraph plots tend large margins. passed directly graphics::par() (mar).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"NULL, plotting initial graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"customization-of-graphs","dir":"Reference","previous_headings":"","what":"Customization of graphs","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"values igraph::plot.igraph() get defaults changed graphicalMCP. values can still changed passing arguments plot.initial_graph(). new defaults: vertex.color = \"#6baed6\", vertex.label.color = \"black\", vertex.size = 20, edge.arrow.size = 1, edge.arrow.width = 1, edge.label.color = \"black\" asp = 0. Neither graphicalMCP igraph anything overlapping edge labels. run problem, vertices practically moved enough avoid collisions edge labels, using edge curves can help. igraph puts edge labels closer tail edge edge straight, closer head edge curved. setting edge's curve small value, effectively straight edge can shifted new position.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Xi, D., Bretz, F. (2019). Symmetric graphs equally weighted tests, application Hochberg procedure. Statistics Medicine, 38(27), 5268-5282.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.initial_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 plot method for class initial_graph — plot.initial_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) plot(g) # A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and four secondary hypotheses (H31, H32, H41, and H42) # See Figure 6 in Xi and Bretz (2019). hypotheses <- c(0.5, 0.5, 0, 0, 0, 0) epsilon <- 1e-5 transitions <- rbind( c(0, 0.5, 0.25, 0, 0.25, 0), c(0.5, 0, 0, 0.25, 0, 0.25), c(0, 0, 0, 0, 1, 0), c(epsilon, 0, 0, 0, 0, 1 - epsilon), c(0, epsilon, 1 - epsilon, 0, 0, 0), c(0, 0, 0, 1, 0, 0) ) hyp_names <- c(\"H1\", \"H2\", \"H31\", \"H32\", \"H41\", \"H42\") g <- graph_create(hypotheses, transitions, hyp_names) plot_layout <- rbind( c(0.15, 0.5), c(0.65, 0.5), c(0, 0), c(0.5, 0), c(0.3, 0), c(0.8, 0) ) plot(g, layout = plot_layout, eps = epsilon, edge_curves = c(pairs = .5))"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 plot method for the class updated_graph — plot.updated_graph","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"Plotting updated graph light wrapper around plot.initial_graph(), changing default vertex color use gray deleted hypotheses.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"","code":"# S3 method for updated_graph plot(x, ...)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"x object class updated_graph plot. ... Arguments passed plot.initial_graph v_palette character vector length two specifying colors retained deleted hypotheses. extensive color customization must done vertex.color. layout igraph layout specification (See ?igraph.plotting), \"grid\", lays hypotheses left--right top--bottom. nrow ncol control grid shape. nrow integer scalar specifying number rows vertex grid. row column counts specified, vertices laid close square possible. ncol integer scalar specifying number columns vertex grid. row column counts specified, vertices laid close square possible. edge_curves named numeric vector specifying curvature specific edges. Edge pairs (two vertices share edge possible direction) detected automatically get 0.25 curvature. Adjust edges adding entry name \"vertex1|vertex2, adjust default edge pairs curvature adding entry name \"pairs\" - edge_curves = c(\"pairs\" = 0.5, \"H1|H3\" = 0.25, \"H3|H4\" = 0.75). precision integer scalar indicating number decimal places display. eps numeric scalar. transition weight eps displayed \\(\\epsilon\\), indicates edges infinitesimally small weights. See Bretz et al. (2009) details. background_color character scalar specifying background color whole plotting area. Passed directly graphics::par() (bg). margins length 4 numeric vector specifying margins plot. Defaults 0, since igraph plots tend large margins. passed directly graphics::par() (mar).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"NULL, plotting updated graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/plot.updated_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 plot method for the class updated_graph — plot.updated_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" plot( graph_update( g, c(FALSE, TRUE, TRUE, FALSE) ), layout = \"grid\" )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class graph_report — print.graph_report","title":"S3 print method for the class graph_report — print.graph_report","text":"printed graph_report displays initial graph, p-values significance levels, rejection decisions, optional detailed test results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class graph_report — print.graph_report","text":"","code":"# S3 method for graph_report print(x, ..., precision = 4, indent = 2, rows = 10)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class graph_report — print.graph_report","text":"x object class graph_report print. ... values passed methods (currently unused) precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results. rows integer scalar indicating many rows detailed test results print.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class graph_report — print.graph_report","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.graph_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class graph_report — print.graph_report","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) p <- c(0.018, 0.01, 0.105, 0.006) alpha <- 0.025 graph_test_shortcut(g, p, alpha) #> #> Test parameters ($inputs) ------------------------------------------------------ #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Alpha = 0.025 #> #> H1 H2 H3 H4 #> Unadjusted p-values: 0.018 0.010 0.105 0.006 #> #> Test types #> bonferroni: (H1, H2, H3, H4) #> #> Test summary ($outputs) -------------------------------------------------------- #> Hypothesis Adj. P-value Reject #> H1 0.020 TRUE #> H2 0.020 TRUE #> H3 0.105 FALSE #> H4 0.020 TRUE #> #> Final updated graph after removing rejected hypotheses #> #> --- Hypothesis weights --- #> H1: NA #> H2: NA #> H3: 1 #> H4: NA #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 NA NA NA NA #> H2 NA NA NA NA #> H3 NA NA 0 NA #> H4 NA NA NA NA #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class initial_graph — print.initial_graph","title":"S3 print method for the class initial_graph — print.initial_graph","text":"printed initial_graph displays header stating \"Initial graph\", hypothesis weights, transition weights.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class initial_graph — print.initial_graph","text":"","code":"# S3 method for initial_graph print(x, ..., precision = 4, indent = 0)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class initial_graph — print.initial_graph","text":"x object class initial_graph print. ... values passed methods (currently unused). precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 print method for the class initial_graph — print.initial_graph","text":"NULL, printing initial graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class initial_graph — print.initial_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.initial_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class initial_graph — print.initial_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) hyp_names <- c(\"H11\", \"H12\", \"H21\", \"H22\") g <- graph_create(hypotheses, transitions, hyp_names) g #> Initial graph #> #> --- Hypothesis weights --- #> H11: 0.5 #> H12: 0.5 #> H21: 0.0 #> H22: 0.0 #> #> --- Transition weights --- #> H11 H12 H21 H22 #> H11 0 0 1 0 #> H12 0 0 0 1 #> H21 0 1 0 0 #> H22 1 0 0 0"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class power_report — print.power_report","title":"S3 print method for the class power_report — print.power_report","text":"printed power_report displays initial graph, testing simulation options, power outputs, optional detailed simulations test results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class power_report — print.power_report","text":"","code":"# S3 method for power_report print(x, ..., precision = 4, indent = 2, rows = 10)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class power_report — print.power_report","text":"x object class power_report print ... values passed methods (currently unused) precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results. rows integer scalar indicating many rows detailed test results print.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class power_report — print.power_report","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913. Bretz, F., Maurer, W., Hommel, G. (2011b). Test power considerations multiple endpoint analyses using sequentially rejective graphical procedures. Statistics Medicine, 30(13), 1489-1501.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.power_report.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class power_report — print.power_report","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 4 in Bretz et al. (2011). alpha <- 0.025 hypotheses <- c(0.5, 0.5, 0, 0) delta <- 0.5 transitions <- rbind( c(0, delta, 1 - delta, 0), c(delta, 0, 0, 1 - delta), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) marginal_power <- c(0.8, 0.8, 0.7, 0.9) corr1 <- matrix(0.5, nrow = 2, ncol = 2) diag(corr1) <- 1 corr <- rbind( cbind(corr1, 0.5 * corr1), cbind(0.5 * corr1, corr1) ) success_fns <- list( # Probability to reject both H1 and H2 `H1andH2` = function(x) x[1] & x[2], # Probability to reject both (H1 and H3) or (H2 and H4) `(H1andH3)or(H2andH4)` = function(x) (x[1] & x[3]) | (x[2] & x[4]) ) set.seed(1234) # Bonferroni tests power_output <- graph_calculate_power( g, alpha, sim_corr = corr, sim_n = 1e5, power_marginal = marginal_power, sim_success = success_fns )"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":null,"dir":"Reference","previous_headings":"","what":"S3 print method for the class updated_graph — print.updated_graph","title":"S3 print method for the class updated_graph — print.updated_graph","text":"printed updated_graph displays initial graph, (final) updated graph, sequence intermediate updated graphs hypotheses deleted (available).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"S3 print method for the class updated_graph — print.updated_graph","text":"","code":"# S3 method for updated_graph print(x, ..., precision = 6, indent = 2)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"S3 print method for the class updated_graph — print.updated_graph","text":"x object class updated_graph print. ... values passed methods (currently unused). precision integer scalar indicating number decimal places display. indent integer scalar indicating many spaces indent results.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"S3 print method for the class updated_graph — print.updated_graph","text":"NULL, printing updated graph.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"S3 print method for the class updated_graph — print.updated_graph","text":"Bretz, F., Posch, M., Glimm, E., Klinglmueller, F., Maurer, W., Rohmeyer, K. (2011a). Graphical approaches multiple comparison procedures using weighted Bonferroni, Simes, parametric tests. Biometrical Journal, 53(6), 894-913.","code":""},{"path":[]},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/print.updated_graph.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"S3 print method for the class updated_graph — print.updated_graph","text":"","code":"# A graphical multiple comparison procedure with two primary hypotheses (H1 # and H2) and two secondary hypotheses (H3 and H4) # See Figure 1 in Bretz et al. (2011). hypotheses <- c(0.5, 0.5, 0, 0) transitions <- rbind( c(0, 0, 1, 0), c(0, 0, 0, 1), c(0, 1, 0, 0), c(1, 0, 0, 0) ) g <- graph_create(hypotheses, transitions) # Delete the second and third hypotheses in the \"unordered mode\" graph_update(g, delete = c(FALSE, TRUE, TRUE, FALSE)) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 # Equivalent way in the \"ordered mode\" to obtain the updated graph after # deleting the second and third hypotheses # Additional intermediate updated graphs are also provided graph_update(g, delete = 2:3) #> Initial and final graphs ------------------------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Updated graph after deleting hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Deletion sequence ($intermediate_graphs) --------------------------------------- #> #> Initial graph #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: 0.5 #> H3: 0.0 #> H4: 0.0 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 0 1 0 #> H2 0 0 0 1 #> H3 0 1 0 0 #> H4 1 0 0 0 #> #> Step 1: Updated graph after removing hypothesis 2 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: 0.0 #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA 1 0 #> H2 NA NA NA NA #> H3 0 NA 0 1 #> H4 1 NA 0 0 #> #> Step 2: Updated graph after removing hypotheses 2, 3 #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #> #> Final updated graph after removing deleted hypotheses #> #> --- Hypothesis weights --- #> H1: 0.5 #> H2: NA #> H3: NA #> H4: 0.5 #> #> --- Transition weights --- #> H1 H2 H3 H4 #> H1 0 NA NA 1 #> H2 NA NA NA NA #> H3 NA NA NA NA #> H4 1 NA NA 0 #>"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Tests for an intersection hypothesis — test_values_bonferroni","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"Tests intersection hypothesis","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"","code":"test_values_bonferroni(p, hypotheses, alpha, intersection = NA) test_values_parametric(p, hypotheses, alpha, intersection = NA, test_corr) test_values_simes(p, hypotheses, alpha, intersection = NA)"},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"p numeric vector p-values (unadjusted, raw), whose values 0 & 1. length match number hypotheses graph. hypotheses numeric vector hypothesis weights graphical multiple comparison procedure. Must vector values 0 & 1 (inclusive). length match row column lengths transitions. sum hypothesis weights exceed 1. alpha numeric value overall significance level, 0 & 1. default 0.025 one-sided hypothesis testing problems; another common choice 0.05 two-sided hypothesis testing problems. Note parametric tests used, one-sided tests supported. intersection (optional) numeric scalar used name intersection hypothesis weighting strategy. test_corr (Optional) list numeric correlation matrices. entry list correspond test group. test group using Bonferroni Simes tests, corresponding entry test_corr NA. test group using parametric tests, corresponding entry test_corr numeric correlation matrix specifying correlation test statistics hypotheses test group. length match number elements test_groups.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"data frame rows corresponding individual hypotheses involved intersection hypothesis hypothesis weights hypotheses. following columns: Intersection - Name intersection hypothesis, Hypothesis - Name individual hypothesis, Test - Test type individual hypothesis, p - (Unadjusted raw) p-values individual hypothesis, c_value- C value parametric tests, Weight - Hypothesis weight individual hypothesis, Alpha - Overall significance level \\(\\alpha\\), Inequality_holds - Indicator show p-value less equal significance level. Bonferroni Simes tests, significance level hypothesis weight times \\(\\alpha\\). parametric tests, significance level c value times hypothesis weight times \\(\\alpha\\).","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"Bretz, F., Maurer, W., Brannath, W., Posch, M. (2009). graphical approach sequentially rejective multiple test procedures. Statistics Medicine, 28(4), 586-604. Lu, K. (2016). Graphical approaches using Bonferroni mixture weighted Simes tests. Statistics Medicine, 35(22), 4041-4055. Xi, D., Glimm, E., Maurer, W., Bretz, F. (2017). unified framework weighted parametric multiple test procedures. Biometrical Journal, 59(5), 918-931.","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/reference/test_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Tests for an intersection hypothesis — test_values_bonferroni","text":"","code":"alpha <- 0.025 hypotheses <- c(H1 = 0.5, H2 = 0.5, H3 = 0, H4 = 0) p <- c(0.018, 0.01, 0.105, 0.006) graphicalMCP:::test_values_bonferroni(p, hypotheses, alpha) #> Intersection Hypothesis Test p c_value Weight Alpha #> H1 NA H1 bonferroni 0.018 0.5 0.025 #> H2 NA H2 bonferroni 0.010 0.5 0.025 #> H3 NA H3 bonferroni 0.105 0.0 0.025 #> H4 NA H4 bonferroni 0.006 0.0 0.025 #> Inequality_holds #> H1 FALSE #> H2 TRUE #> H3 FALSE #> H4 FALSE graphicalMCP:::test_values_parametric( p, hypotheses, alpha, test_corr = diag(4) ) #> Intersection Hypothesis Test p c_value Weight Alpha #> H1 NA H1 parametric 0.018 1.006329 0.5 0.025 #> H2 NA H2 parametric 0.010 1.006329 0.5 0.025 #> H3 NA H3 parametric 0.105 1.006329 0.0 0.025 #> H4 NA H4 parametric 0.006 1.006329 0.0 0.025 #> Inequality_holds #> H1 FALSE #> H2 TRUE #> H3 FALSE #> H4 FALSE graphicalMCP:::test_values_simes(p, hypotheses, alpha) #> Intersection Hypothesis Test p c_value Weight Alpha Inequality_holds #> 1 NA H1 simes 0.018 1.0 0.025 TRUE #> 2 NA H2 simes 0.010 0.5 0.025 TRUE #> 3 NA H3 simes 0.105 1.0 0.025 FALSE #> 4 NA H4 simes 0.006 0.0 0.025 FALSE"},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-010","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.0","title":"graphicalMCP 0.1.0","text":"First release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-011","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.1","title":"graphicalMCP 0.1.1","text":"Added compilation vignettes (#73) Removed duplicated columns “*” test values (#75)","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-012","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.1.2","title":"graphicalMCP 0.1.2","text":"Updated function documentation Updated references","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-020","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.0","title":"graphicalMCP 0.2.0","text":"Corrected typos Updated function documentation CRAN release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-021","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.1","title":"graphicalMCP 0.2.1","text":"Corrected typos First CRAN release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-022","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.2","title":"graphicalMCP 0.2.2","text":"Updated citations Resubmission first CRAN release","code":""},{"path":"https://gilead-biostats.github.io/graphicalMCP/news/index.html","id":"graphicalmcp-023","dir":"Changelog","previous_headings":"","what":"graphicalMCP 0.2.3","title":"graphicalMCP 0.2.3","text":"Included cran-comments.ms .Rbuildignore Resubmission first CRAN release","code":""}]
Source: inst/CITATION
inst/CITATION
Xi D, Brockmann E (2024). -graphicalMCP: Graphical multiple comparison procedures, version 0.2.2 edition. +graphicalMCP: Graphical multiple comparison procedures, version 0.2.3 edition. https://github.com/Gilead-BioStats/graphicalMCP.
@Manual{, title = {{graphicalMCP}: Graphical multiple comparison procedures}, author = {Dong Xi and Ethan Brockmann}, - edition = {version 0.2.2}, + edition = {version 0.2.3}, year = {2024}, url = {https://github.com/Gilead-BioStats/graphicalMCP}, }