Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
^\.Rproj\.user$
^README\.Rmd$
^cran-comments\.md$
^NEWS\.md$
^\.github$
^\.git$
^\.gitignore$
Expand All @@ -16,5 +15,5 @@
^\.pre-commit-config\.yaml$
^CRAN-SUBMISSION$
^doc$
^docs$
^Meta$
^\.Rhistory$
35 changes: 10 additions & 25 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, v1.0.0-dev]
pull_request:
branches: [main, master]
workflow_dispatch:

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

Expand All @@ -21,37 +22,23 @@ jobs:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
_R_CHECK_FORCE_SUGGESTS_: false
_R_CHECK_CRAN_INCOMING_REMOTE_: false
_R_CHECK_CRAN_INCOMING_: false

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libxml2-dev libssl-dev libfontconfig1-dev

- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install --cask xquartz

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand All @@ -61,7 +48,5 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'
error-on: '"error"'
env:
_R_CHECK_FORCE_SUGGESTS_: false
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
error-on: '"note"'
23 changes: 17 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ concurrency:
cancel-in-progress: false

jobs:
pkgdown:
# Builds the site for every event; pull requests stop here.
build:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
Expand All @@ -54,14 +51,28 @@ jobs:
shell: Rscript {0}

- name: Setup Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v4

- name: Upload artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: docs

# The github-pages environment accepts deployments from the default branch
# only, so the job that uses it does not run for pull requests.
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
if: github.event_name != 'pull_request'
uses: actions/deploy-pages@v4
43 changes: 35 additions & 8 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,62 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, v1.0.0-dev]
pull_request:
branches: [main, master]
workflow_dispatch:

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Run the tests skipped on CRAN so that coverage includes them
NOT_CRAN: true

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
64 changes: 30 additions & 34 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: BayesianQDM
Type: Package
Title: Bayesian Quantitative Decision-Making Framework for Binary and Continuous Endpoints
Version: 0.1.0
Title: Bayesian Quantitative Decision-Making Framework for Binary, Continuous and Time-to-Event Endpoints
Version: 1.0.0
Authors@R: c(
person(given = "Gosuke",
family = "Homma",
Expand All @@ -10,48 +10,44 @@ Authors@R: c(
person(given = "Yusuke",
family = "Yamaguchi",
role = c("aut")))
Description: Provides comprehensive methods to calculate posterior probabilities,
posterior predictive probabilities, and Go/NoGo/Gray decision probabilities
for quantitative decision-making under a Bayesian paradigm in clinical trials.
The package supports both single and two-endpoint analyses for binary and
continuous outcomes, with controlled, uncontrolled, and external designs.
For single continuous endpoints, three calculation methods are
available: numerical integration (NI), Monte Carlo simulation (MC), and
Moment-Matching approximation (MM). For two continuous endpoints, a bivariate
Normal-Inverse-Wishart conjugate model is implemented with MC and MM methods.
For two binary endpoints, a Dirichlet-multinomial model is implemented.
External designs incorporate historical data through power priors
using exact conjugate representations (Normal-Inverse-Chi-squared for single
continuous, Normal-Inverse-Wishart for two continuous, and Dirichlet for
binary endpoints), enabling closed-form posterior computation without Markov
chain Monte Carlo (MCMC) sampling. This approach significantly reduces
computational burden while preserving complete Bayesian rigor. The package
also provides grid-search functions to find optimal Go and NoGo thresholds
that satisfy user-specified operating characteristic criteria for all
supported endpoint types and study designs. S3 print() and plot() methods
are provided for all decision probability classes, enabling formatted display
and visualisation of Go/NoGo/Gray operating characteristics across treatment
scenarios.
See Kang, Yamaguchi, and Han (2026) <doi:10.1080/10543406.2026.2655410>
for the methodological framework.
Description: Bayesian quantitative decision-making for proof-of-concept
clinical trials with Go, NoGo and Gray decisions. A study is specified by
its sample sizes, conjugate prior distributions, external data borrowed
through power priors, a concurrent, external, hypothetical or fixed
control group, and a decision criterion based on the posterior or
posterior predictive probability of the treatment effect. The package
computes the decision for observed data, the operating characteristics
of a design under scenarios for the true parameters, the decision
thresholds that control the probabilities of false Go and false NoGo
decisions, and the decision boundaries over possible observed data. One
or two binary endpoints (Beta-binomial and Dirichlet-multinomial
models), one or two continuous endpoints (Normal-Inverse-chi-squared and
Normal-Inverse-Wishart models) and one time-to-event endpoint evaluated
by the milestone survival probability (exponential model with Gamma
priors) are supported. The posterior distributions have closed forms, so
Markov chain Monte Carlo (MCMC) sampling is not needed; the
probabilities are computed by exact summation, numerical integration, a
moment-matching approximation or Monte Carlo simulation, with the main
computations in C++. See Kang, Yamaguchi, and Han (2026)
<doi:10.1080/10543406.2026.2655410> for the methodological framework.
License: GPL (>= 2)
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Imports:
ggplot2 (>= 3.4.0),
gridExtra,
mvtnorm,
grDevices,
Rcpp,
stats
LinkingTo:
Rcpp
Suggests:
testthat (>= 3.0.0),
knitr,
rmarkdown,
dplyr,
tidyr,
purrr,
spelling
spelling,
testthat (>= 3.0.0)
VignetteBuilder: knitr
Config/testthat/edition: 3
URL: https://gosukehommaEX.github.io/BayesianQDM/, https://github.com/gosukehommaEX/BayesianQDM
BugReports: https://github.com/gosukehommaEX/BayesianQDM/issues
Config/roxygen2/version: 8.0.0
Loading
Loading