lrstat
0.3.4Power and Sample Size Calculation for Non-Proportional Hazards and Beyond
Overview
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.
- removed the
rankp0argument 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
getNFromNeventsAndFollowupand its C++ backend inlrstat.cppfor accrual duration calculations under target-event and follow-up constraints - corrected the minimum weighted p-value ratio initialization in
fadjpduncpp(used byfadjpdun) from1.0to positive infinity so that ratios exceeding 1 are properly accounted for when computing intersection p-values - added the
simulateparameter to thelrschoenfeldfunction, 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
ctbonferronitolrsim_bmTrtSel - added the familywise error rate
fwerto the output oflrsim_bmTrtSel - added disjunctive and conjunctive power to each
byMethodresult fromlrsim_bmTrtSeland to therun_scenariooutput data frame - added event-driven phase III analyses to
lrsim_bmTrtSelthrough thetotalNumberOfEventstarget, while retainingstudyDurationPhase3for fixed-duration analyses - changed long-term time-to-event endpoint generation in
lrsim_bmTrtSelfrom 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_bmTrtSelby 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_seamlessunder equal treatment effects by evaluating the phase-2 selected-arm probabilities once and using arm symmetry for the remaining arms - renamed the
fPCStagewiseinput parametersstg1_inthyp_nrandstg2_elemhyptostg1_inthyp_nr_idxandstg2_elemhyp_idx, respectively, to make their index semantics explicit and align them with the output names and related adaptive-testing interfaces - standardized
lrsim_bmTrtSeltesting method identifiers to lowercase, including inputs, returnedmethodsandbyMethodnames, andsumdataTTErejection indicator columns - added
sumdataBINandsumdataTTEsummary datasets tolrsim_bmTrtSel, includingzBiomarkerinsumdataBINand all individual and pooled stage 1 log-rank Z statistics insumdataTTEto allow derivation of rejection decisions for all methods, along with optional subject-levelrawdataBINandrawdataTTEdatasets controlled bymaxNumberOfRawDatasets - added
rmvnormand related multivariate-normal sampling helpers for drawing correlated random vectors from a covariance matrix via Cholesky-based generation and seeded overloads - added
pordmvnormrto 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
mvtnormfromSuggests - changed the default value of
corrEfficacyToxicityinlrsim_bmTrtSel_cpp()from0.5to0 - corrected a
collapseargument typo inprint.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
- 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
Documentation
- 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%
- Comparing Direct Approximation and Schoenfeld Methods HTML
- Power Calculation Using Max-Combo Tests HTML
- Power Calculation With Stratification Variables HTML
- Sample Size Calculation Under Non-Proportional Hazards HTML
- Sample Size Calculation With Fixed Follow-up HTML
- Simulation for Group Sequential Trials HTML
Downloads
Repository
- 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
Forks over time
Issues over time
PRs over time
Commits over time
Commit identities over time
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.
The R CMD check workflow runs on Linux
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)
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-04-24Named in .Rbuildignore: .claude
- GitHub Copilotfirst seen 2026-05-13Pull request: opened by its own accountCommits: 3 by its own account
Dependencies
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.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.3.4Latest
- 0.3.32026-08-25 · diff ↗ ·
removed 8 exports
adaptDesign_mams, exitprob_mams, getADCI_mams, getBound_mams, getCI_mams, getCP_mams, getDesign_mams, lrsim_mamsadded 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.22026-05-13 · diff ↗ ·
removed 4 exports
exitprob_tsssd, getBound_tsssd, getDesign_tsssd, lrsim_tsssdadded 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 - RR 4.6.0 released · 2026-04-24
- 0.3.12026-04-08 · diff ↗ ·
added 6 exports
exitprob_tsssd, getBound_tsssd, getDesign_tsssd, lrsim_tsssd, pmvnormr, qmvnormr - 0.3.02026-03-07 · diff ↗ ·
removed 12 exports
ad, findInterval3, hd, kmstat1, lrstat1, nbstat1, nevent2, pd, qrcpp, rmstat1, rmvnorm, survsplitadded 5 exports
assess_phregr, corr_pfs_os, dtpwexp, mtpwexp, zph_phregr - 0.2.15
- 0.2.14
- RR 4.5.0 released · 2025-04-11
- 0.2.132025-03-20 · diff ↗ ·
removed 1 export
runShinyAppadded 3 exports
getDesignMeanDiffCarryoverEquiv, runShinyApp_lrstat, survsplit - 0.2.12
- 0.2.11
- 0.2.102024-10-18 · diff ↗ ·
removed 1 export
rpsftadded 4 exports
logisregr, qrcpp, residuals_phregr, survfit_phregr - 0.2.9
- 0.2.82024-06-19 · diff ↗
- 0.2.7
Show 35 earlier eventsHide 35 earlier events
- unarchivedReturned to CRAN2024-05-11
- 0.2.6
- archivedRemoved from CRAN2024-05-07issues were not corrected in time
- RR 4.4.0 released · 2024-04-24
- 0.2.52024-04-22 · diff ↗ ·
removed 1 export
findInterval2added 20 exports
findInterval3, fquantile, kmdiff, kmest, lrtest, pwexpcuts, pwexploglik, riskDiffExactCI, riskDiffExactPValue, riskRatioExactCI, riskRatioExactPValue, rmdiff, rmest, simonBayesAnalysis, simonBayesSim, zstatOddsRatio, zstatRateDiff, zstatRateRatio, zstatRiskDiff, zstatRiskRatio - unarchivedReturned to CRAN2024-03-19
- 0.2.42024-03-19 · diff ↗ ·
removed 2 exports
kmest, kmest1added 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 CRAN2024-03-13issues were not corrected in time
- 0.2.32024-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
- 0.2.12023-11-28 · diff ↗ ·
removed 1 export
getAccrualDurationadded 7 exports
adaptDesign, getADCI, getADRCI, getAccrualDurationFromN, getCI, getCP, getRCI - 0.2.0
- 0.1.15
- 0.1.142023-06-09 · diff ↗ ·
added 3 exports
getAccrualDuration, getDurationFromNevents, getNeventsFromHazardRatio - 0.1.132023-05-21 · diff ↗
- 0.1.122023-04-30 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.1.11
- 0.1.102022-10-25 · diff ↗
- 0.1.9
- 0.1.82022-09-11 · diff ↗ ·
removed 2 exports
set_seed, stl_sortadded 8 exports
fadjpbon, fseqbon, getBound, lrsim2e, lrsim2e3a, lrsim3a, repeatedPValue, updateGraph - unarchivedReturned to CRAN2022-08-29
- 0.1.7
- archivedRemoved from CRAN2022-08-24issues were not corrected in time
- unarchivedReturned to CRAN2022-08-09
- 0.1.62022-08-09 · diff ↗
- archivedRemoved from CRAN2022-06-25check problems were not corrected in time
- 0.1.52022-06-09 · diff ↗
- 0.1.4
- RR 4.2.0 released · 2022-04-22
- 0.1.32022-02-09 · diff ↗
- 0.1.2
- 0.1.1
- 0.1.02021-12-17
- RR 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")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.
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.