Package: lrstat 0.2.9

Kaifeng Lu

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

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.

Authors:Kaifeng Lu [aut, cre]

lrstat_0.2.9.tar.gz
lrstat_0.2.9.tar.gz(r-4.5-noble)lrstat_0.2.9.tar.gz(r-4.4-noble)
lrstat_0.2.9.tgz(r-4.4-emscripten)lrstat_0.2.9.tgz(r-4.3-emscripten)
lrstat.pdf |lrstat.html
lrstat/json (API)
NEWS

# Install 'lrstat' in R:
install.packages('lrstat', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • aml - Acute myelogenous leukemia survival data from the survival package
  • heart - Stanford heart transplant data from the survival package
  • immdef - Simulated Concorde trial data from the rpsftm package
  • rawdata - A simulated time-to-event data set with 10 replications
  • tobin - Tobin's tobit data from the survival package

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

176 exports 5.05 score 32 dependencies 32 scripts 497 downloads

Last updated 3 months agofrom:2110b38b4a. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKSep 23 2024
R-4.5-linux-x86_64OKSep 23 2024

Exports:accrualadadaptDesignbinary_tte_simBOINTablecaltimeClopperPearsonCIcovrmsterrorSpentexitprobfadjpbonfadjpdunfadjpsimfindInterval3fmodmixfquantilefseqbonfstdmixfstp2seqftruncfwgtmatgetAccrualDurationFromNgetADCIgetADRCIgetBoundgetCIgetCPgetDesigngetDesignAgreementgetDesignANOVAgetDesignANOVAContrastgetDesignEquivgetDesignFisherExactgetDesignLogisticgetDesignMeanDiffgetDesignMeanDiffCarryovergetDesignMeanDiffEquivgetDesignMeanDiffMMRMgetDesignMeanDiffXOgetDesignMeanDiffXOEquivgetDesignMeanRatiogetDesignMeanRatioEquivgetDesignMeanRatioXOgetDesignMeanRatioXOEquivgetDesignOddsRatiogetDesignOddsRatioEquivgetDesignOneMeangetDesignOneMultinomgetDesignOneProportiongetDesignOneRateExactgetDesignOneSlopegetDesignOrderedBinomgetDesignPairedMeanDiffgetDesignPairedMeanDiffEquivgetDesignPairedMeanRatiogetDesignPairedMeanRatioEquivgetDesignPairedPropMcNemargetDesignRepeatedANOVAgetDesignRepeatedANOVAContrastgetDesignRiskDiffgetDesignRiskDiffEquivgetDesignRiskDiffExactgetDesignRiskDiffExactEquivgetDesignRiskRatiogetDesignRiskRatioEquivgetDesignRiskRatioExactgetDesignRiskRatioExactEquivgetDesignRiskRatioFMgetDesignSlopeDiffgetDesignSlopeDiffMMRMgetDesignTwoMultinomgetDesignTwoOrdinalgetDesignTwoWayANOVAgetDesignUnorderedBinomgetDesignUnorderedMultinomgetDesignWilcoxongetDurationFromNeventsgetNeventsFromHazardRatiogetRCIhdhedgesgkmdiffkmestkmpowerkmpower1skmpowerequivkmsamplesizekmsamplesize1skmsamplesizeequivkmstatkmstat1liferegrlrpowerlrpowerequivlrsamplesizelrsamplesizeequivlrsimlrsim2elrsim2e3alrsim3alrstatlrstat1lrtestmnOddsRatioCImnRateDiffCImnRateRatioCImnRiskDiffCImnRiskRatioCImTPI2Tablenatrisknbpowernbpower1snbpowerequivnbsamplesizenbsamplesize1snbsamplesizeequivnbstatnbstat1neventnevent2patriskpdpeventphregrpowerFisherExactpowerOnePropExactpowerOneRateExactpowerRiskDiffExactpowerRiskDiffExactEquivpowerRiskRatioExactpowerRiskRatioExactEquivptpwexppwexpcutspwexploglikqtpwexpremlOddsRatioremlRateDiffremlRateRatioremlRiskDiffremlRiskRatiorepeatedPValueriskDiffExactCIriskDiffExactPValueriskRatioExactCIriskRatioExactPValuermdiffrmestrmpowerrmpower1srmpowerequivrmsamplesizermsamplesize1srmsamplesizeequivrmstrmstatrmstat1rpsftrtpwexprunShinyAppsamplesizeFisherExactsamplesizeOnePropExactsamplesizeOneRateExactsamplesizeRiskDiffExactsamplesizeRiskDiffExactEquivsamplesizeRiskRatioExactsamplesizeRiskRatioExactEquivsimon2stagesimonBayesAnalysissimonBayesSimsurvQuantileupdateGraphzstatOddsRatiozstatRateDiffzstatRateRatiozstatRiskDiffzstatRiskRatio

Dependencies:base64encbslibcachemclicommonmarkcrayondigestfastmapfontawesomefsgluehtmltoolshttpuvjquerylibjsonlitelaterlifecyclelpSolvemagrittrmemoisemimemvtnormpromisesR6rappdirsRcpprlangsassshinysourcetoolswithrxtable

Comparing Direct Approximation and Schoenfeld Methods

Rendered fromdirect_approximation_vs_schoenfeld.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2022-08-09

Multiplicity Adjustment for Group Sequential Designs

Rendered fromgroup_sequential_multiplicity.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2023-02-09

Power Calculation Using Max-Combo Tests

Rendered frommaxcombo.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2021-12-17

Power Calculation With Stratification Variables

Rendered fromstratified.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2021-12-17

Sample Size Calculation Under Non-Proportional Hazards

Rendered fromnon-proportional_hazards.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2021-12-17

Sample Size Calculation With Fixed Follow-up

Rendered fromfixed_follow-up.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-03-20
Started: 2021-12-17

Simulation for Group Sequential Trials

Rendered fromgroup_sequential_simulation.Rmdusingknitr::rmarkdownon Sep 23 2024.

Last update: 2024-02-28
Started: 2021-12-17

Readme and manuals

Help Manual

Help pageTopics
Number of enrolled subjectsaccrual
Adaptive design at an interim lookadaptDesign
Acute myelogenous leukemia survival data from the survival packageaml
Simulation for a binary endpoint and a time-to-event endpointbinary_tte_sim
BOIN decision tableBOINTable
Calendar times for target number of eventscaltime
Clopper-Pearson confidence interval for one-sample proportionClopperPearsonCI
Covariance between restricted mean survival timescovrmst
Error spendingerrorSpent
Stagewise exit probabilitiesexitprob
Adjusted p-values for Bonferroni-based graphical approachesfadjpbon
Adjusted p-values for Dunnett-based graphical approachesfadjpdun
Adjusted p-values for Simes-based graphical approachesfadjpsim
Adjusted p-values for modified mixture gatekeeping proceduresfmodmix
The quantiles of a survival distributionfquantile
Group sequential trials using Bonferroni-based graphical approachesfseqbon
Adjusted p-values for standard mixture gatekeeping proceduresfstdmix
Adjusted p-values for stepwise testing procedures for two sequencesfstp2seq
Adjusted p-values for Holm, Hochberg, and Hommel proceduresftrunc
Weight matrix for all intersection hypothesesfwgtmat
Accrual duration to enroll target number of subjectsgetAccrualDurationFromN
Confidence interval after adaptationgetADCI
Repeated confidence interval after adaptationgetADRCI
Efficacy boundaries for group sequential designgetBound
Confidence interval after trial terminationgetCI
Conditional power allowing for varying parameter valuesgetCP
Power and sample size for a generic group sequential designgetDesign
Power and sample size for Cohen's kappagetDesignAgreement
Power and sample size for one-way ANOVAgetDesignANOVA
Power and sample size for one-way ANOVA contrastgetDesignANOVAContrast
Power and sample size for a generic group sequential equivalence designgetDesignEquiv
Power and sample size for Fisher's exact test for two proportionsgetDesignFisherExact
Power and sample size for logistic regressiongetDesignLogistic
Group sequential design for two-sample mean differencegetDesignMeanDiff
Power and sample size for direct treatment effects in crossover trials accounting for carryover effectsgetDesignMeanDiffCarryover
Group sequential design for equivalence in two-sample mean differencegetDesignMeanDiffEquiv
Group sequential design for two-sample mean difference from the MMRM modelgetDesignMeanDiffMMRM
Group sequential design for mean difference in 2x2 crossovergetDesignMeanDiffXO
Group sequential design for equivalence in mean difference in 2x2 crossovergetDesignMeanDiffXOEquiv
Group sequential design for two-sample mean ratiogetDesignMeanRatio
Group sequential design for equivalence in two-sample mean ratiogetDesignMeanRatioEquiv
Group sequential design for mean ratio in 2x2 crossovergetDesignMeanRatioXO
Group sequential design for equivalence in mean ratio in 2x2 crossovergetDesignMeanRatioXOEquiv
Group sequential design for two-sample odds ratiogetDesignOddsRatio
Group sequential design for equivalence in two-sample odds ratiogetDesignOddsRatioEquiv
Group sequential design for one-sample meangetDesignOneMean
Power and sample for one-sample multinomial responsegetDesignOneMultinom
Group sequential design for one-sample proportiongetDesignOneProportion
Power and sample size for one-sample Poisson rate exact testgetDesignOneRateExact
Group sequential design for one-sample slopegetDesignOneSlope
Power and sample size for Cochran-Armitage trend test for ordered multi-sample binomial responsegetDesignOrderedBinom
Group sequential design for paired mean differencegetDesignPairedMeanDiff
Group sequential design for equivalence in paired mean differencegetDesignPairedMeanDiffEquiv
Group sequential design for paired mean ratiogetDesignPairedMeanRatio
Group sequential design for equivalence in paired mean ratiogetDesignPairedMeanRatioEquiv
Group sequential design for McNemar's test for paired proportionsgetDesignPairedPropMcNemar
Power and sample size for repeated-measures ANOVAgetDesignRepeatedANOVA
Power and sample size for one-way repeated measures ANOVA contrastgetDesignRepeatedANOVAContrast
Group sequential design for two-sample risk differencegetDesignRiskDiff
Group sequential design for equivalence in two-sample risk differencegetDesignRiskDiffEquiv
Power and sample size for exact unconditional test for risk differencegetDesignRiskDiffExact
Power and sample size for exact unconditional test for equivalence in risk differencegetDesignRiskDiffExactEquiv
Group sequential design for two-sample risk ratiogetDesignRiskRatio
Group sequential design for equivalence in two-sample risk ratiogetDesignRiskRatioEquiv
Power and sample size for exact unconditional test for risk ratiogetDesignRiskRatioExact
Power and sample size for exact unconditional test for equivalence in risk ratiogetDesignRiskRatioExactEquiv
Group sequential design for two-sample risk ratio based on the Farrington-Manning score testgetDesignRiskRatioFM
Group sequential design for two-sample slope differencegetDesignSlopeDiff
Group sequential design for two-sample slope difference from the MMRM modelgetDesignSlopeDiffMMRM
Power and sample for difference in two-sample multinomial responsesgetDesignTwoMultinom
Power and sample size for the Wilcoxon test for two-sample ordinal responsegetDesignTwoOrdinal
Power and sample size for two-way ANOVAgetDesignTwoWayANOVA
Power and sample size for unordered multi-sample binomial responsegetDesignUnorderedBinom
Power and sample size for unordered multi-sample multinomial responsegetDesignUnorderedMultinom
Group sequential design for two-sample Wilcoxon testgetDesignWilcoxon
Range of accrual duration for target number of eventsgetDurationFromNevents
Get the required number of events given hazard ratiogetNeventsFromHazardRatio
Repeated confidence interval for group sequential designgetRCI
Stanford heart transplant data from the survival packageheart
Hedges' g effect sizehedgesg
Simulated Concorde trial data from the rpsftm packageimmdef
Estimate of milestone survival differencekmdiff
Kaplan-Meier estimates of the survival curvekmest
Power for difference in milestone survival probabilitieskmpower
Power for one-sample milestone survival probabilitykmpower1s
Power for equivalence in milestone survival probability differencekmpowerequiv
Sample size for difference in milestone survival probabilitieskmsamplesize
Sample size for one-sample milestone survival probabilitykmsamplesize1s
Sample size for equivalence in milestone survival probability differencekmsamplesizeequiv
Stratified difference in milestone survival probabilitieskmstat
Parametric regression models for failure time dataliferegr
Log-rank test powerlrpower
Power for equivalence in hazard ratiolrpowerequiv
Log-rank test sample sizelrsamplesize
Sample size for equivalence in hazard ratiolrsamplesizeequiv
Log-rank test simulationlrsim
Log-rank test simulation for two endpointslrsim2e
Log-rank test simulation for two endpoints and three armslrsim2e3a
Log-rank test simulation for three armslrsim3a
Number of subjects having an event and log-rank statisticslrstat
Log-rank test of survival curve differencelrtest
Miettinen-Nurminen score confidence interval for two-sample odds ratiomnOddsRatioCI
Miettinen-Nurminen score confidence interval for two-sample rate differencemnRateDiffCI
Miettinen-Nurminen score confidence interval for two-sample rate ratiomnRateRatioCI
Miettinen-Nurminen score confidence interval for two-sample risk differencemnRiskDiffCI
Miettinen-Nurminen score confidence interval for two-sample risk ratiomnRiskRatioCI
mTPI-2 decision tablemTPI2Table
Power for negative binomial rate rationbpower
Power for one-sample negative binomial ratenbpower1s
Power for equivalence in negative binomial rate rationbpowerequiv
Sample size for negative binomial rate rationbsamplesize
Sample size for one-sample negative binomial ratenbsamplesize1s
Sample size for equivalence in negative binomial rate rationbsamplesizeequiv
Negative binomial rate rationbstat
Proportional hazards regression modelphregr
Distribution function of truncated piecewise exponential distributionptpwexp
Piecewise exponential approximation to a survival distributionpwexpcuts
Profile log-likelihood function for the change points in piecewise exponential approximationpwexploglik
Quantile function of truncated piecewise exponential distributionqtpwexp
A simulated time-to-event data set with 10 replicationsrawdata
REML estimates of individual proportions with specified odds ratioremlOddsRatio
REML estimates of individual rates with specified rate differenceremlRateDiff
REML estimates of individual rates with specified rate ratioremlRateRatio
REML estimates of individual proportions with specified risk differenceremlRiskDiff
REML estimates of individual proportions with specified risk ratioremlRiskRatio
Repeated p-values for group sequential designrepeatedPValue
Exact unconditional confidence interval for risk differenceriskDiffExactCI
P-value for exact unconditional test of risk differenceriskDiffExactPValue
Exact unconditional confidence interval for risk ratioriskRatioExactCI
P-value for exact unconditional test of risk ratioriskRatioExactPValue
Estimate of restricted mean survival time differencermdiff
Estimate of restricted mean survival timermest
Power for difference in restricted mean survival timesrmpower
Power for one-sample restricted mean survival timermpower1s
Power for equivalence in restricted mean survival time differencermpowerequiv
Sample size for difference in restricted mean survival timesrmsamplesize
Sample size for one-sample restricted mean survival timermsamplesize1s
Sample size for equivalence in restricted mean survival time differencermsamplesizeequiv
Restricted mean survival timermst
Stratified difference in restricted mean survival timesrmstat
Rank preserving structured failure time model (RPSFTM) for treatment switchingrpsft
Random number generation function of truncated piecewise exponential distributionrtpwexp
Run Shiny apprunShinyApp
Simon's two-stage designsimon2stage
Analysis of Simon's Bayesian basket trialssimonBayesAnalysis
Simulation of Simon's Bayesian basket trialssimonBayesSim
Brookmeyer-Crowley confidence interval for quantiles of right-censored time-to-event datasurvQuantile
Tobin's tobit data from the survival packagetobin
Update graph for graphical approachesupdateGraph
Miettinen-Nurminen score test statistic for two-sample odds ratiozstatOddsRatio
Miettinen-Nurminen score test statistic for two-sample rate differencezstatRateDiff
Miettinen-Nurminen score test statistic for two-sample rate ratiozstatRateRatio
Miettinen-Nurminen score test statistic for two-sample risk differencezstatRiskDiff
Miettinen-Nurminen score test statistic for two-sample risk ratiozstatRiskRatio