Package: lrstat 0.2.11

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.11.tar.gz
lrstat_0.2.11.tar.gz(r-4.5-noble)lrstat_0.2.11.tar.gz(r-4.4-noble)
lrstat_0.2.11.tgz(r-4.4-emscripten)lrstat_0.2.11.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
  • ingots - The binary data from Cox and Snell (1989, pp. 10-11).
  • rawdata - A simulated time-to-event data set with 10 replications
  • sexagg - Urinary tract infection data from the logistf package
  • shilong - The randomized clinical trial SHIVA data in long format from the ipcwswitch package
  • six - The repeated measures data from the "Six Cities" study of the health effects of air pollution (Ware et al. 1984).
  • 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.

cpp

5.08 score 40 scripts 524 downloads 180 exports 32 dependencies

Last updated 20 days agofrom:e8cd427409. Checks:OK: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKDec 05 2024
R-4.5-linux-x86_64OKDec 05 2024

Exports:accrualadadaptDesignbinary_tte_simBOINTablecaltimeClopperPearsonCIcovrmsterrorSpentexitprobfadjpbonfadjpdunfadjpsimfindInterval3fmodmixfquantilefseqbonfstdmixfstp2seqftruncfwgtmatgetAccrualDurationFromNgetADCIgetADRCIgetBoundgetCIgetCPgetDesigngetDesignAgreementgetDesignANOVAgetDesignANOVAContrastgetDesignEquivgetDesignFisherExactgetDesignLogisticgetDesignMeanDiffgetDesignMeanDiffCarryovergetDesignMeanDiffEquivgetDesignMeanDiffMMRMgetDesignMeanDiffXOgetDesignMeanDiffXOEquivgetDesignMeanRatiogetDesignMeanRatioEquivgetDesignMeanRatioXOgetDesignMeanRatioXOEquivgetDesignOddsRatiogetDesignOddsRatioEquivgetDesignOneMeangetDesignOneMultinomgetDesignOneProportiongetDesignOneRateExactgetDesignOneSlopegetDesignOrderedBinomgetDesignPairedMeanDiffgetDesignPairedMeanDiffEquivgetDesignPairedMeanRatiogetDesignPairedMeanRatioEquivgetDesignPairedPropMcNemargetDesignRepeatedANOVAgetDesignRepeatedANOVAContrastgetDesignRiskDiffgetDesignRiskDiffEquivgetDesignRiskDiffExactgetDesignRiskDiffExactEquivgetDesignRiskRatiogetDesignRiskRatioEquivgetDesignRiskRatioExactgetDesignRiskRatioExactEquivgetDesignRiskRatioFMgetDesignSlopeDiffgetDesignSlopeDiffMMRMgetDesignTwoMultinomgetDesignTwoOrdinalgetDesignTwoWayANOVAgetDesignUnorderedBinomgetDesignUnorderedMultinomgetDesignWilcoxongetDurationFromNeventsgetNeventsFromHazardRatiogetRCIhdhedgesgkmdiffkmestkmpowerkmpower1skmpowerequivkmsamplesizekmsamplesize1skmsamplesizeequivkmstatkmstat1kmsurvliferegrlogisregrlrpowerlrpowerequivlrsamplesizelrsamplesizeequivlrsimlrsim2elrsim2e3alrsim3alrstatlrstat1lrtestmnOddsRatioCImnRateDiffCImnRateRatioCImnRiskDiffCImnRiskRatioCImTPI2Tablenatrisknbpowernbpower1snbpowerequivnbsamplesizenbsamplesize1snbsamplesizeequivnbstatnbstat1neventnevent2patriskpdpeventphregrpowerFisherExactpowerOnePropExactpowerOneRateExactpowerRiskDiffExactpowerRiskDiffExactEquivpowerRiskRatioExactpowerRiskRatioExactEquivptpwexppwexpcutspwexploglikqrcppqtpwexpremlOddsRatioremlRateDiffremlRateRatioremlRiskDiffremlRiskRatiorepeatedPValueresiduals_phregrriskDiffExactCIriskDiffExactPValueriskRatioExactCIriskRatioExactPValuermdiffrmestrmpowerrmpower1srmpowerequivrmsamplesizermsamplesize1srmsamplesizeequivrmstrmstatrmstat1rtpwexprunShinyAppsamplesizeFisherExactsamplesizeOnePropExactsamplesizeOneRateExactsamplesizeRiskDiffExactsamplesizeRiskDiffExactEquivsamplesizeRiskRatioExactsamplesizeRiskRatioExactEquivsimon2stagesimonBayesAnalysissimonBayesSimsurvfit_phregrsurvQuantileupdateGraphzstatOddsRatiozstatRateDiffzstatRateRatiozstatRiskDiffzstatRiskRatio

Dependencies:base64encbslibcachemclicommonmarkcrayondigestfastmapfontawesomefsgluehtmltoolshttpuvjquerylibjsonlitelaterlifecyclelpSolvemagrittrmemoisemimemvtnormpromisesR6rappdirsRcpprlangsassshinysourcetoolswithrxtable

Comparing Direct Approximation and Schoenfeld Methods

Rendered fromdirect_approximation_vs_schoenfeld.Rmdusingknitr::rmarkdownon Dec 05 2024.

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

Power Calculation Using Max-Combo Tests

Rendered frommaxcombo.Rmdusingknitr::rmarkdownon Dec 05 2024.

Last update: 2024-12-04
Started: 2021-12-17

Power Calculation With Stratification Variables

Rendered fromstratified.Rmdusingknitr::rmarkdownon Dec 05 2024.

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

Sample Size Calculation Under Non-Proportional Hazards

Rendered fromnon-proportional_hazards.Rmdusingknitr::rmarkdownon Dec 05 2024.

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

Sample Size Calculation With Fixed Follow-up

Rendered fromfixed_follow-up.Rmdusingknitr::rmarkdownon Dec 05 2024.

Last update: 2024-10-18
Started: 2021-12-17

Simulation for Group Sequential Trials

Rendered fromgroup_sequential_simulation.Rmdusingknitr::rmarkdownon Dec 05 2024.

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

Readme and manuals

Help Manual

Help pageTopics
Power and Sample Size Calculation for Non-Proportional Hazards and Beyondlrstat-package
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 Size 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 Size 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
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
The binary data from Cox and Snell (1989, pp. 10-11).ingots
Estimate of Milestone Survival Differencekmdiff
Kaplan-Meier Estimates of 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
Logistic Regression Models for Binary Datalogisregr
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 Modelsphregr
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
QR Decomposition of a Matrixqrcpp
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
Residuals for Proportional Hazards Regression Modelsresiduals_phregr
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
Random Number Generation Function of Truncated Piecewise Exponential Distributionrtpwexp
Run Shiny ApprunShinyApp
Urinary tract infection data from the logistf packagesexagg
The randomized clinical trial SHIVA data in long format from the ipcwswitch packageshilong
Simon's Two-Stage Designsimon2stage
Analysis of Simon's Bayesian Basket TrialssimonBayesAnalysis
Simulation of Simon's Bayesian Basket TrialssimonBayesSim
The repeated measures data from the "Six Cities" study of the health effects of air pollution (Ware et al. 1984).six
Survival Curve for Proportional Hazards Regression Modelssurvfit_phregr
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