No packages match

FastSurvival - Fast Survival Analysis and Simulation for Clinical Trials

Provides fast alternatives to standard survival analysis functions in the 'survival' package, together with tools for time-to-event trial simulation and sequential analysis. The estimation and testing functions cover a single-time-point Kaplan-Meier estimator (survfit_fast()), log-rank tests including weighted and stratified variants (survdiff_fast()), a closed-form hazard ratio estimator based on the Pike-Halley Estimator method (coxph_fast()), restricted mean survival time (rmst_fast()), window mean survival time (wmst_fast()), milestone survival comparison (milestone_fast()), median survival time (medsurv_fast()), the max-combo test (maxcombo_fast()), the robust modestly-weighted log-rank test (rmw_fast()), the weighted Kaplan-Meier (Pepe-Fleming) test (wkm_fast()), the average hazard with survival weight (ahsw_fast()), and the Kalbfleisch-Prentice average hazard ratio (ahr_fast()). Besides vectors, these functions accept a model formula with a data frame, and their results can be returned as data frames. The simulation layer generates individual patient data (simdata_fast()), determines the calendar time of each analysis from combined event and calendar-time rules (cutoff_fast()), performs interim or sequential analyses (analysis_fast()), compares several experimental arms with a shared control (pairwise_fast()), applies treatment switching at progression or after an interim analysis (switch_fast()), and aggregates operating characteristics (simsummary_fast()). A visualization layer assembles design-stage scenarios (gen_scenario_fast()) and builds analysis-stage Kaplan-Meier curves (kmcurve_fast()), each with plot and print methods. All functions are designed for repeated evaluation inside large simulation loops, such as adaptive sample-size re-estimation, probability-of-success calculations, and regional consistency evaluation in multi-regional trials. Core computations are implemented in 'C++' via 'Rcpp' for maximum performance. Methodological background is described in Collett (2014, ISBN:9781439856789).

Last updated

clinical-trialssurvival-analysistime-to-eventcpp

6.36 score 32 scripts 440 downloads

bbssr - Blinded Sample Size Re-Estimation for Binary Endpoints

Tools for blinded sample size re-estimation (BSSR) in two-arm clinical trials with binary endpoints, together with the exact power and sample size calculations that the re-estimation relies on, for two independent groups, for matched pairs and for stratified designs. For two independent groups seven statistical tests are implemented: Pearson chi-squared, Fisher exact, Fisher mid-p, Z-pooled exact unconditional, the exact unconditional test of Boschloo (1970) <doi:10.1111/j.1467-9574.1970.tb00104.x>, and the tests of non-inferiority and equivalence of Blackwelder (1982) <doi:10.1016/0197-2456(82)90024-1> and of Farrington and Manning (1990) <doi:10.1002/sim.4780091208>, with a margin on the scale of the risk difference or the risk ratio. Each test is available with a one-sided or a two-sided alternative, and the exact unconditional tests can be combined with the Berger-Boos procedure. For matched pairs the McNemar tests and the score test of Nam (1997) <doi:10.2307/2533508> are implemented, and for stratified designs the Cochran-Mantel-Haenszel test, Cochran's test with the sample size formulas of Woolson et al. (1986) <doi:10.2307/2530706> and Nam (1992) <doi:10.2307/2532298>, and the stratified exact conditional test of Jung (2014) <doi:10.1002/bimj.201300048>. The power, the distribution of the final sample size and the type I error rate of a re-estimation design are computed exactly, by simulation for three or more strata and as averages over simulated allocation sequences for random stratum and group sizes, the significance level can be adjusted so that the type I error rate is controlled, and the sample size can be re-estimated from the blinded data of a trial that is under way. Statistical methods based on Mehrotra et al. (2003) <doi:10.1111/1541-0420.00051>, Berger and Boos (1994) <doi:10.1080/01621459.1994.10476836>, Friede and Kieser (2004) <doi:10.1002/pst.140>, Friede et al. (2007) <doi:10.1002/bimj.200610373> and Kieser (2020) <doi:10.1007/978-3-030-49528-2_21>.

Last updated

binary-endpointsclinical-trialspower-calculationsample-size-calculationcpp

6.25 score 2 stars 27 scripts 281 downloads

BayesianQDM - Bayesian Quantitative Decision-Making Framework for Binary, Continuous and Time-to-Event Endpoints

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 observed data that lead to each decision. 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 or the hazard ratio (exponential model with Gamma priors) are supported, with larger or smaller effects as favorable. The posterior distributions have closed forms, so Markov chain Monte Carlo (MCMC) sampling is not needed; the probabilities are computed from closed-form distribution functions, 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.

Last updated

bayesian-statisticsclinical-trialsposterior-predictiveposterior-probabilitypower-priorquantitative-decision-makingcpp

5.59 score 9 scripts 357 downloads

simFastBOIN - Fast Simulation of Bayesian Optimal Interval Designs for Phase I Trials

Design and evaluate phase I dose-finding trials that use the Bayesian optimal interval (BOIN) design of Liu and Yuan (2015) <doi:10.1111/rssc.12089>. Functions are provided to tabulate the decision boundaries, to simulate trials, to estimate the dose-toxicity curve under a monotonicity constraint and to select the maximum tolerated dose. The simulation engine is written in C++ and draws one random variate per patient in enrollment order, which reproduces the reference implementation in the 'BOIN' package trial by trial for a given seed. The traditional 3+3 design is provided as a comparator, with operating characteristics obtained in closed form rather than by simulation. For toxicity that is observed late, the time-to-event BOIN design is provided with the two estimators of Yuan and colleagues (2018) <doi:10.1158/1078-0432.CCR-18-0246> and Lin and Yuan (2020) <doi:10.1093/biostatistics/kxz007>. Patients who arrive while the dose escalation waits can be backfilled to lower doses with the designs of Zhao and colleagues (2024) <doi:10.1158/1078-0432.CCR-23-2585> and Chen and colleagues (2026) <doi:10.1007/s43441-026-00994-0>, the latter with the suspension rules of Chen and colleagues (2025) <doi:10.1158/1078-0432.CCR-24-3669>. Trials of two drugs given together are handled by the drug-combination design of Lin and Yin (2017) <doi:10.1177/0962280215594494>.

Last updated

clinical-trialsdose-findingoncology-trialsphase1cpp

5.15 score 1 stars 465 downloads