Power and Sample Size for Restricted Mean Survival Time Based Clinical Trials
Overview
Tools for Restricted Mean Survival Time based study design and analysis planning. Provides power and sample size calculations for two-arm studies using direct modeling approaches from the literature, including semiparametric additive models, linear Inverse Probability Weighting based models from Wei (2014) doi:10.1093/biostatistics/kxt050, multiplicative stratified models from Wang (2019) doi:10.1002/sim.8356, and covariate-dependent censoring methods from Wang (2018) doi:10.1007/s10985-017-9391-6.
Install
Health
ERRORexamplesr-devel-linux-x86_64-debian-gcc
Running examples in ‘RMSTpowerBoost-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: MS.power.analytical
> ### Title: Analyze Power for a Multiplicative Stratified RMST Model
> ### (Analytic)
> ### Aliases: MS.power.analytical
>
> ### ** Examples
>
> set.seed(123)
> pilot_df_strat <- data.frame(
+ time = rexp(120, 0.15),
+ status = rbinom(120, 1, 0.6),
+ arm = rep(0:1, each = 60),
+ region = factor(rep(c("A", "B", "C"), each = 40))
+ )
> pilot_df_strat$time[pilot_df_strat$arm == 1] <- pilot_df_strat$time[pilot_df_strat$arm == 1] * 1.5
>
> power_results <- MS.power.analytical(
+ pilot_data = pilot_df_strat,
+ time_var = "time", status_var = "status", arm_var = "arm", strata_var = "region",
+ sample_sizes = c(50, 75, 100),
+ L = 10, alpha = 0.05
+ )
Error in a$specials[[i]] : subscript out of bounds
Calls: MS.power.analytical ... survfit.coxph -> model.matrix.coxph -> delete.response -> off
Execution haltedERRORtestsr-devel-linux-x86_64-debian-gcc
Running ‘testthat.R’ [80s/90s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(RMSTpowerBoost)
>
> test_check("RMSTpowerBoost")
Saving _problems/testthat-additive-78.R
Saving _problems/testthat-additive-89.R
Saving _problems/testthat-apps-49.R
Saving _problems/testthat-coverage-gates-230.R
Saving _problems/testthat-rmst-interface-230.R
Saving _problems/testthat-rmst-interface-239.R
Saving _problems/testthat-rmst-interface-247.R
Saving _problems/testthat-rmst-interface-258.R
Saving _problems/testthat-rmst-interface-295.R
Saving _problems/testthat-rmst-interface-317.R
Saving _problems/testthat-rmst-interface-328.R
Saving _problems/testthat-rmst-interface-353.R
Saving _problems/testthat-rmst-interface-380.R
`geom_line()`: Each group consists of only one observation.
i Do you need to adjust the group aesthetic?
Saving _problems/testthat_DC-38.R
Saving _problems/testthat_DC-60.R
Saving _problems/test
...[truncated]...
l::survfit(fit, se.fit = FALSE)
4. └─survival:::survfit.coxph(fit, se.fit = FALSE)
5. └─survival:::model.matrix.coxph(object, data = mf)
6. └─stats::delete.response(object$terms)
7. └─stats (local) off(a$specials[[i]])
── Error ('testthat_strat.R:82:4'): Analytical and Bootstrap methods give comparable results for multiplicative model ──
<subscriptOutOfBoundsError/error/condition>
Error in `a$specials[[i]]`: subscript out of bounds
Backtrace:
▆
1. └─RMSTpowerBoost::MS.ss.analytical(...) at testthat_strat.R:82:4
2. └─survival::basehaz(fit_cens, centered = FALSE)
3. ├─survival::survfit(fit, se.fit = FALSE)
4. └─survival:::survfit.coxph(fit, se.fit = FALSE)
5. └─survival:::model.matrix.coxph(object, data = mf)
6. └─stats::delete.response(object$terms)
7. └─stats (local) off(a$specials[[i]])
[ FAIL 21 | WARN 0 | SKIP 1 | PASS 438 ]
Error:
! Test failures.
Execution halted- ERROR12 OK, 1 ERROR2026-10-24
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK5 OK2026-04-29
Documentation
- Help pages
- 38 (1 internal)
- Examples that run
- 88%28 run in a plain check (1 of them under a condition) · 4 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 90%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 43%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 10
Releases over time
PRs over time
Commits over time
8 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/uthsc-zhang/rmstpowerboost-package on 2026-10-21.
GitHub Pages site last deployed 2026-10-08
pkgdown site last built 2026-04-17, before release 1.0.3 (2026-04-28)
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-04-20Pull request: opened by its own accountCommits: 1 by its own account
- Claude Codefirst seen 2026-07-09Named in .Rbuildignore: .claude
Dependencies
Code & Tests
Datasets
People & History
- 1.0.3Latest2026-04-28 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-04-28
- Total releases
- 1 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 14 KB / 4 files
- Download size
- 337 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("RMSTpowerBoost")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.