https://github.com/johnsonandjohnson/appendmcp
Graphical multiple comparison procedures for group sequential design clinical trials
https://github.com/johnsonandjohnson/appendmcp
group-sequential-designs multiple-testing report-generation-by-template
Last synced: 28 days ago
JSON representation
Graphical multiple comparison procedures for group sequential design clinical trials
- Host: GitHub
- URL: https://github.com/johnsonandjohnson/appendmcp
- Owner: johnsonandjohnson
- License: gpl-3.0
- Created: 2026-05-19T14:10:32.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-29T17:44:39.000Z (about 2 months ago)
- Last Synced: 2026-05-29T18:12:54.195Z (about 2 months ago)
- Topics: group-sequential-designs, multiple-testing, report-generation-by-template
- Language: R
- Homepage: https://johnsonandjohnson.github.io/appendMCP/
- Size: 1.88 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
editor_options:
markdown:
wrap: 72
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# appendMCP
[](https://github.com/johnsonandjohnson/appendMCP/actions/workflows/R-CMD-check.yaml)
[-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
**appendMCP** generates analysis documentation for graphical multiple
comparison procedures (MCPs) in group sequential design (GSD) clinical
trials. Given a study configuration, it produces summary tables,
diagnostic plots, and a fully formatted R Markdown report suitable for
appending to a statistical analysis plan (SAP).
## Installation
```{r eval=FALSE}
# install.packages("remotes")
remotes::install_github("johnsonandjohnson/appendMCP")
```
## Quick Start
The core workflow is three steps: load a configuration, process it, and
generate a report.
```{r eval=FALSE}
library(appendMCP)
config <- load_config_from_repository("example_study")
results <- process_config(config)
generate_report(results)
```
This produces an HTML report in your working directory containing
summary tables, the graphical testing procedure diagram, information
fraction plots, alpha spending visualizations, and operating
characteristics.
## What the Package Produces
- **Table 1** — Hypothesis summary (endpoint, type, spending function)
- **Table 2** — Analysis schedule by hypothesis (timing, information fractions)
- **Table 3** — Analysis schedule by analysis (all hypotheses at each look)
- **Table 4** — Weight scenarios under the graphical MCP
- **Table 5** — Boundary specifications (nominal p-values, information fractions, local power)
- **Table 6a / 6b** — Simulation-based operating characteristics by analysis and overall
- **Plots** — Graph diagram, information fractions, alpha spending, enrollment,
time-to-event and binary endpoint distributions
Tables are returned as `huxtable` objects ready for Word or HTML output.
## Exploring Results
```{r eval=FALSE}
# Individual tables
results$tables$table1 # Hypothesis summary
results$tables$table2 # Schedule by hypothesis
results$tables$table5 # Boundary specifications (nominal p-values, local power)
# Plots (top-level fields on the results object)
results$graph_figure # Graphical MCP diagram
results$information_figure # Information fraction over time
results$alpha_spend_figure # Alpha spending functions
results$tte_figure # Time-to-event distributions
results$er_figure # Enrollment rate
```
## Scaffolding a New Study
`create_study()` copies a configuration and report template into a
project folder and generates a ready-to-run analysis script:
```{r eval=FALSE}
create_study(
config = "example_study", # built-in config, or path to your own .R file
rmd_template = "gsd_default", # built-in template, or path to your own .Rmd
output_dir = "my_study"
)
# Creates:
# my_study/study_config.R — edit this to define your study
# my_study/render_config.R — run this to execute the analysis
# my_study/report.Rmd — the report template
```
## Available Built-in Configurations and Templates
```{r eval=FALSE}
list_config_repository() # built-in study configurations
list_rmd_template_repository() # built-in report templates
```
## Using a Custom Configuration
A configuration is an R list assigned to a single variable in a `.R`
file. The required fields are:
| Field | Description |
|---|---|
| `study_name` | Study identifier string |
| `alpha` | One-sided significance level (e.g. `0.025`) |
| `analyses` | Data frame of analysis specifications |
| `hypotheses` | Data frame of hypothesis definitions |
| `enroll_rate` | Data frame of enrollment rates by stratum |
| `graph` | List with `g` (transition matrix) and `w` (initial weights) |
| `distribution_tte` | Time-to-event distributions (required if any TTE endpoint) |
| `distribution_bin` | Binary endpoint distributions (required if any binary endpoint) |
See the built-in example for a complete, annotated configuration:
```{r eval=FALSE}
config <- load_config_from_repository("example_study")
str(config, max.level = 1)
```
Or read the configuration guide vignette:
```{r eval=FALSE}
vignette("configuration-guide", package = "appendMCP")
```
## Getting Help
- Function reference: `?process_config`, `?create_study`, `?generate_report`
- Vignettes: `browseVignettes("appendMCP")`
- Full documentation site:
- Report a bug: