Skip to content

BayesCTDesign

Two Arm Bayesian Clinical Trial Design with and Without Historical Control Data

v0.6.1 · Nov 30, 2021 · GPL-3

Description

A set of functions to help clinical trial researchers calculate power and sample size for two-arm Bayesian randomized clinical trials that do or do not incorporate historical control data. At some point during the design process, a clinical trial researcher who is designing a basic two-arm Bayesian randomized clinical trial needs to make decisions about power and sample size within the context of hypothesized treatment effects. Through simulation, the simple_sim() function will estimate power and other user specified clinical trial characteristics at user specified sample sizes given user defined scenarios about treatment effect,control group characteristics, and outcome. If the clinical trial researcher has access to historical control data, then the researcher can design a two-arm Bayesian randomized clinical trial that incorporates the historical data. In such a case, the researcher needs to work through the potential consequences of historical and randomized control differences on trial characteristics, in addition to working through issues regarding power in the context of sample size, treatment effect size, and outcome. If a researcher designs a clinical trial that will incorporate historical control data, the researcher needs the randomized controls to be from the same population as the historical controls. What if this is not the case when the designed trial is implemented? During the design phase, the researcher needs to investigate the negative effects of possible historic/randomized control differences on power, type one error, and other trial characteristics. Using this information, the researcher should design the trial to mitigate these negative effects. Through simulation, the historic_sim() function will estimate power and other user specified clinical trial characteristics at user specified sample sizes given user defined scenarios about historical and randomized control differences as well as treatment effects and outcomes. The results from historic_sim() and simple_sim() can be printed with print_table() and graphed with plot_table() methods. Outcomes considered are Gaussian, Poisson, Bernoulli, Lognormal, Weibull, and Piecewise Exponential. The methods are described in Eggleston et al. (2021) <doi:10.18637/jss.v100.i21>.

Downloads

CRAN

434

Last 30 days

9803rd

1.1K

Last 90 days

4.4K

Last year

Trend: +26.5% (30d vs prior 30d)

r2u CRAN

1

Last 30 days

36

Last 90 days

153

Last year

Trend: -93.8% (30d vs prior 30d)

autoCRAN

13

Last 7 days

49

Last 30 days

0

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 14 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Mar 10, 2026

Line coverage

Expression

Tests / Examples

Functions

58 8 exported

Complexity

30.4 avg / 317 max

Call network

58 nodes / 52 edges

Test coverage has not been measured for this package yet; nodes fall back to a neutral fill.

Loading call graph…

Lowest coverage

Per-function coverage is not measured for this package yet.

Code

Structure

Lines of code

13,180

Files

29

Compiled share

0%

Has compiled src

No

Language breakdown

R 11,865 (90%)Docs 1,315 (10%)

API

Exported functions

8

Internal functions

50

Recent export changes

v0.6.1−2 plot_table, print_table
v0.5.0+10 genbernoullidata, gengaussiandata, genlognormaldata +7 more

Testing & CI

Has tests

No

Test-to-code ratio

0.00

testthat edition

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

Yes

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

100%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

3.5.0

System requirements

C++ standard

License

GPL-3

License flags

SPDX valid, OSI approved

History

Versions

3

First release

2018-08-14

Latest release

2021-11-30

Avg cadence

602 days

Cold removal rate

100%

Dep drift

0

LOC over versions

v0.5.0: 14,306 LOCv0.6.0: 17,976 LOCv0.6.1: 13,180 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies eha ggplot2 survival reshape2 BayesCTDesign

Version History

4 tracked
new 0.6.1 Mar 10, 2026
updated 0.6.1 ← 0.6.0 diff Nov 29, 2021
updated 0.6.0 ← 0.5.0 diff Aug 1, 2019
new 0.5.0 Aug 13, 2018