Skip to content

lrstat

0.3.4

Power and Sample Size Calculation for Non-Proportional Hazards and Beyond

2packages dependsuggested by 1
10.2Kdownloads / year
57.0%test coverage
13/13flavors OK

Overview

About

Performs power and sample size calculation for non-proportional hazards model using the Fleming-Harrington family of weighted log-rank tests. The sequentially calculated log-rank test score statistics are assumed to have independent increments as characterized in Anastasios A. Tsiatis (1982) doi:10.1080/01621459.1982.10477898. The mean and variance of log-rank test score statistics are calculated based on Kaifeng Lu (2021) doi:10.1002/pst.2069. The boundary crossing probabilities are calculated using the recursive integration algorithm described in Christopher Jennison and Bruce W. Turnbull (2000, ISBN:0849303168). The package can also be used for continuous, binary, and count data. For continuous data, it can handle missing data through mixed-model for repeated measures (MMRM). In crossover designs, it can estimate direct treatment effects while accounting for carryover effects. For binary data, it can design Simon's 2-stage, modified toxicity probability-2 (mTPI-2), and Bayesian optimal interval (BOIN) trials. For count data, it can design group sequential trials for negative binomial endpoints with censoring. Additionally, it facilitates group sequential equivalence trials for all supported data types. Moreover, it can design adaptive group sequential trials for changes in sample size, error spending function, number and spacing or future looks. Finally, it offers various options for adjusted p-values, including graphical and gatekeeping procedures.

Changes in 0.3.4
  • removed the rankp0 argument and output from the seamless design functions and simulators, which now always select the most promising treatment at the end of phase 2
  • added bm_rank and pe_rank methods to lrsim_bmTrtSel for rank-based Dunnett adjustment for dose selection in stage 1 in seamless phase 2/3 designs
  • added getNFromNeventsAndFollowup and its C++ backend in lrstat.cpp for accrual duration calculations under target-event and follow-up constraints
  • corrected the minimum weighted p-value ratio initialization in fadjpduncpp (used by fadjpdun) from 1.0 to positive infinity so that ratios exceeding 1 are properly accounted for when computing intersection p-values
  • added the simulate parameter to the lrschoenfeld function, and added a half-count correction for extreme simulated powers
Show all changes in 0.3.4Hide the rest of the changes in 0.3.4
  • added the Bonferroni p-value combination method ctbonferroni to lrsim_bmTrtSel
  • added the familywise error rate fwer to the output of lrsim_bmTrtSel
  • added disjunctive and conjunctive power to each byMethod result from lrsim_bmTrtSel and to the run_scenario output data frame
  • added event-driven phase III analyses to lrsim_bmTrtSel through the totalNumberOfEvents target, while retaining studyDurationPhase3 for fixed-duration analyses
  • changed long-term time-to-event endpoint generation in lrsim_bmTrtSel from response-status-stratified hazards to a copula-based approach, with the latent biomarker response variable correlated directly with the TTE endpoint
  • optimized the CE variants in lrsim_bmTrtSel by precalculating the sample size based nominal time stage boundaries once before data generation
  • optimized selection-boundary calculations by making use of no efficacy stopping in stage 1.
  • optimized exitprob_seamless under equal treatment effects by evaluating the phase-2 selected-arm probabilities once and using arm symmetry for the remaining arms
  • renamed the fPCStagewise input parameters stg1_inthyp_nr and stg2_elemhyp to stg1_inthyp_nr_idx and stg2_elemhyp_idx, respectively, to make their index semantics explicit and align them with the output names and related adaptive-testing interfaces
  • standardized lrsim_bmTrtSel testing method identifiers to lowercase, including inputs, returned methods and byMethod names, and sumdataTTE rejection indicator columns
  • added sumdataBIN and sumdataTTE summary datasets to lrsim_bmTrtSel, including zBiomarker in sumdataBIN and all individual and pooled stage 1 log-rank Z statistics in sumdataTTE to allow derivation of rejection decisions for all methods, along with optional subject-level rawdataBIN and rawdataTTE datasets controlled by maxNumberOfRawDatasets
  • added rmvnorm and related multivariate-normal sampling helpers for drawing correlated random vectors from a covariance matrix via Cholesky-based generation and seeded overloads
  • added pordmvnormr to compute lower- and upper-tail probabilities for order statistics of multivariate normal random variables, with analytic shortcuts for nonnegative compound-symmetry covariance structures and inclusion-exclusion over reduced-dimensional orthant probabilities for general covariance matrices
  • removed mvtnorm from Suggests
  • changed the default value of corrEfficacyToxicity in lrsim_bmTrtSel_cpp() from 0.5 to 0
  • corrected a collapse argument typo in print.nbpower
  • consolidated alpha- and beta-spending function formatting across print methods through the shared .format_spending() helper, preserving the existing printed output

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 24.7 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
  • OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
  • NOTE11 OK, 3 NOTE2026-04-22
  • ERROR10 OK, 3 NOTE, 1 ERROR2026-04-18
  • NOTE11 OK, 3 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.3.4
READMEYes · 378 wordsVignettesYes · 6 · dynamicNEWSYes · 100% structured · mentions 0.3.4Citation fileNoWebsiteYes · pkgdown
Help pages
340 (126 internal)includes a package overview page
Examples that run
100%217 run in a plain check · 1 never run
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
17%

Downloads

10.2K
CRAN downloads in the past year
Rank #3,837 · ~28/day · ~853/mo
Daily download trend is not available in this view yet.
1.2K30 days
2.4K90 days
10.2K1 year
Compare downloads with other packages →
Also on507 r2u6 autocran

Repository

5Stars
1Forks
0Open issues
0Open PRs
0Releases
803Commits
4Commit identities
803 commits · Last activity 2026-09-29 · 0% stars, 30d · Default branch at 0.3.5, ahead of CRAN 0.3.4 (checked 2026-10-11)
Responsiveness
How these are sampled
PRs merged (all time)
50%
Median days to close, 50 most recently updated closed issues
83
Median days to close, 50 most recently updated closed PRs
74

Stars over time

2025-06-05 · 32026-08-20 · 5
PracticesBeta

6 development-tooling and community-health practices detected across 3 families in the upstream repository

Checks run against github.com/kaifenglu/lrstat on 2026-10-11.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-09-29 · The repository has a site deploy workflow

pkgdown site last built 2026-08-12, before release 0.3.4 (2026-09-15)

Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-04-24
    Named in .Rbuildignore: .claude
  • GitHub Copilotfirst seen 2026-05-13
    Pull request: opened by its own account
    Commits: 3 by its own account
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
20 external dependencies (excludes base and recommended)

Installing lrstat adds 72 packages (40 with compiled code, 83 MB of source tarballs). Heaviest: BH 14 MB, stringi 11 MB, ggplot2 6.0 MB.

Depends (1)
R >= 3.5.0
Enhances (0)
none
Reverse dependencies
2direct
1indirect
Imports 2
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (1)
Author, Maintainer since 0.1.0 (2021)
Releases (37)

Pick two releases to compare their code metrics.

  • 0.3.4Latest
    record
    2026-09-15 · current release · diff ↗ ·
    added 2 exports
    getNFromNeventsAndFollowup, pordmvnormr
  • 0.3.3
    record
    2026-08-25 · diff ↗ ·
    removed 8 exports
    adaptDesign_mams, exitprob_mams, getADCI_mams, getBound_mams, getCI_mams, getCP_mams, getDesign_mams, lrsim_mams
    added 22 exports
    adaptDesign_multiarm, exitprob_multiarm, fCERCer, fCERNewBound, fCERRej, fCERStageBound, fDefaultWgtmat, fPCRej, fPCStage1, fPCStagewise, finthyp, getADCI_multiarm, getBound_multiarm, getCI_multiarm, getCP_multiarm, getDesign2, getDesign_multiarm, lrsim_bmTrtSel, lrsim_mcpmod, lrsim_multiarm, rdsim_multiarm, rdsim_seamless
  • 0.3.2
    record
    2026-05-13 · diff ↗ ·
    removed 4 exports
    exitprob_tsssd, getBound_tsssd, getDesign_tsssd, lrsim_tsssd
    added 16 exports
    adaptDesign_mams, adaptDesign_seamless, exitprob_mams, exitprob_seamless, getADCI_mams, getADCI_seamless, getBound_mams, getBound_seamless, getCI_mams, getCI_seamless, getCP_mams, getCP_seamless, getDesign_mams, getDesign_seamless, lrsim_mams, lrsim_seamless
  • R
    R 4.6.0 released · 2026-04-24
  • 0.3.1
    record
    2026-04-08 · diff ↗ ·
    added 6 exports
    exitprob_tsssd, getBound_tsssd, getDesign_tsssd, lrsim_tsssd, pmvnormr, qmvnormr
  • 0.3.0
    record
    2026-03-07 · diff ↗ ·
    removed 12 exports
    ad, findInterval3, hd, kmstat1, lrstat1, nbstat1, nevent2, pd, qrcpp, rmstat1, rmvnorm, survsplit
    added 5 exports
    assess_phregr, corr_pfs_os, dtpwexp, mtpwexp, zph_phregr
  • 0.2.15
    record
    2025-07-14 · diff ↗ ·
    added 5 exports
    hazard_pd, hazard_sub, lrsimsub, pbvnorm, rmvnorm
  • 0.2.14
    record
    2025-06-09 · diff ↗ ·
    added 1 export
    residuals_liferegr
  • R
    R 4.5.0 released · 2025-04-11
  • 0.2.13
    record
    2025-03-20 · diff ↗ ·
    removed 1 export
    runShinyApp
    added 3 exports
    getDesignMeanDiffCarryoverEquiv, runShinyApp_lrstat, survsplit
  • 0.2.12
    record
    2025-01-17 · diff ↗ ·
    added 3 exports
    float_to_fraction, lrschoenfeld, svdcpp
  • 0.2.11
    record
    2024-12-04 · diff ↗ ·
    added 1 export
    kmsurv
  • 0.2.10
    record
    2024-10-18 · diff ↗ ·
    removed 1 export
    rpsft
    added 4 exports
    logisregr, qrcpp, residuals_phregr, survfit_phregr
  • 0.2.9
    record
    2024-06-23 · diff ↗ ·
    added 2 exports
    binary_tte_sim, rpsft
  • 0.2.8
    record
    2024-06-19 · diff ↗
  • 0.2.7
    record
    2024-06-13 · diff ↗ ·
    added 4 exports
    liferegr, phregr, simonBayesAnalysis, simonBayesSim
Show 35 earlier eventsHide 35 earlier events
  • unarchivedReturned to CRAN
    2024-05-11
  • 0.2.6
    record
    2024-05-11 · diff ↗ ·
    removed 2 exports
    simonBayesAnalysis, simonBayesSim
  • archivedRemoved from CRAN
    2024-05-07
    issues were not corrected in time
  • R
    R 4.4.0 released · 2024-04-24
  • 0.2.5
    record
    2024-04-22 · diff ↗ ·
    removed 1 export
    findInterval2
    added 20 exports
    findInterval3, fquantile, kmdiff, kmest, lrtest, pwexpcuts, pwexploglik, riskDiffExactCI, riskDiffExactPValue, riskRatioExactCI, riskRatioExactPValue, rmdiff, rmest, simonBayesAnalysis, simonBayesSim, zstatOddsRatio, zstatRateDiff, zstatRateRatio, zstatRiskDiff, zstatRiskRatio
  • unarchivedReturned to CRAN
    2024-03-19
  • 0.2.4
    record
    2024-03-19 · diff ↗ ·
    removed 2 exports
    kmest, kmest1
    added 21 exports
    covrmst, kmpower, kmpower1s, kmpowerequiv, kmsamplesize, kmsamplesize1s, kmsamplesizeequiv, kmstat, kmstat1, lrpowerequiv, lrsamplesizeequiv, nbstat1, rmpower, rmpower1s, rmpowerequiv, rmsamplesize, rmsamplesize1s, rmsamplesizeequiv, rmst, rmstat, rmstat1
  • archivedRemoved from CRAN
    2024-03-13
    issues were not corrected in time
  • 0.2.3
    record
    2024-02-27 · diff ↗ ·
    added 88 exports
    BOINTable, ClopperPearsonCI, getDesignANOVA, getDesignANOVAContrast, getDesignAgreement, getDesignEquiv, getDesignFisherExact, getDesignLogistic, getDesignMeanDiff, getDesignMeanDiffCarryover, getDesignMeanDiffEquiv, getDesignMeanDiffMMRM, getDesignMeanDiffXO, getDesignMeanDiffXOEquiv, getDesignMeanRatio, getDesignMeanRatioEquiv, getDesignMeanRatioXO, getDesignMeanRatioXOEquiv, getDesignOddsRatio, getDesignOddsRatioEquiv, getDesignOneMean, getDesignOneMultinom, getDesignOneProportion, getDesignOneRateExact, getDesignOneSlope, getDesignOrderedBinom, getDesignPairedMeanDiff, getDesignPairedMeanDiffEquiv, getDesignPairedMeanRatio, getDesignPairedMeanRatioEquiv and 58 more
  • 0.2.2
    record
    2023-12-22 · diff ↗ ·
    added 1 export
    ftrunc
  • 0.2.1
    record
    2023-11-28 · diff ↗ ·
    removed 1 export
    getAccrualDuration
    added 7 exports
    adaptDesign, getADCI, getADRCI, getAccrualDurationFromN, getCI, getCP, getRCI
  • 0.2.0
    record
    2023-10-01 · diff ↗ ·
    added 1 export
    fadjpdun
  • 0.1.15
    record
    2023-08-17 · diff ↗ ·
    added 3 exports
    fmodmix, fstdmix, fstp2seq
  • 0.1.14
    record
    2023-06-09 · diff ↗ ·
    added 3 exports
    getAccrualDuration, getDurationFromNevents, getNeventsFromHazardRatio
  • 0.1.13
    record
    2023-05-21 · diff ↗
  • 0.1.12
    record
    2023-04-30 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.1.11
    record
    2023-02-09 · diff ↗ ·
    added 2 exports
    kmest, kmest1
  • 0.1.10
    record
    2022-10-25 · diff ↗
  • 0.1.9
    record
    2022-10-09 · diff ↗ ·
    added 2 exports
    fadjpsim, fwgtmat
  • 0.1.8
    record
    2022-09-11 · diff ↗ ·
    removed 2 exports
    set_seed, stl_sort
    added 8 exports
    fadjpbon, fseqbon, getBound, lrsim2e, lrsim2e3a, lrsim3a, repeatedPValue, updateGraph
  • unarchivedReturned to CRAN
    2022-08-29
  • 0.1.7
    record
    2022-08-29 · diff ↗ ·
    added 1 export
    getDesign
  • archivedRemoved from CRAN
    2022-08-24
    issues were not corrected in time
  • unarchivedReturned to CRAN
    2022-08-09
  • 0.1.6
    record
    2022-08-09 · diff ↗
  • archivedRemoved from CRAN
    2022-06-25
    check problems were not corrected in time
  • 0.1.5
    record
    2022-06-09 · diff ↗
  • 0.1.4
    record
    2022-06-07 · diff ↗ ·
    added 1 export
    lrstat1
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.3
    record
    2022-02-09 · diff ↗
  • 0.1.2
    record
    2022-02-02 · diff ↗ ·
    added 1 export
    errorSpent
  • 0.1.1
    record
    2021-12-23 · diff ↗ ·
    removed 1 export
    qtpwexp1
  • 0.1.0
    record
    2021-12-17
  • R
    R 4.1.0 released · 2021-05-18

Package metadata

First published
2021-12-17
Total releases
37 / 5 yrs
License
GPL (>= 2) OSI
Minimum R
≥ 3.5.0
Bundled data
106 KB / 10 files
Download size
1.2 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("lrstat")
Lu, K. (2026). lrstat: Power and Sample Size Calculation for Non-Proportional Hazards and Beyond (Version 0.3.4) [Computer software]. https://doi.org/10.32614/CRAN.package.lrstat

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for lrstat version 0.3.4 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy