Package: lrstat
Type: Package
Title: Power and Sample Size Calculation for Non-Proportional Hazards
        and Beyond
Version: 0.3.3
Authors@R: 
    person("Kaifeng", "Lu", , "kaifenglu@gmail.com", role = c("aut", "cre"),
           comment = c(ORCID = "0000-0002-6160-7119"))
Description: 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. 
License: GPL (>= 2)
Imports: Rcpp (>= 1.0.9), RcppParallel (>= 5.1.5), parallel (>= 3.5),
        rlang (>= 1.0.6), ggplot2 (>= 3.3.6), plotly (>= 4.10.1), shiny
        (>= 1.7.1), stats (>= 3.5.0)
LinkingTo: Rcpp, RcppParallel, RcppThread, BH
Suggests: testthat (>= 3.0.0), dplyr (>= 1.1.4), tidyr (>= 1.3.0),
        knitr (>= 1.45), rmarkdown (>= 2.25), mvtnorm (>= 1.1-3),
        survival (>= 3.5-7), shinyjs (>= 2.1.0), shinyFeedback (>=
        0.4.0), shinyMatrix (>= 0.8.0), prompter (>= 1.2.1), pkgdown
        (>= 2.2.0)
VignetteBuilder: knitr
Encoding: UTF-8
NeedsCompilation: yes
Depends: R (>= 3.5.0)
SystemRequirements: C++17
LazyData: true
URL: https://kaifenglu.github.io/lrstat/,
        https://github.com/kaifenglu/lrstat
BugReports: https://github.com/kaifenglu/lrstat/issues
Config/testthat/edition: 3
Config/roxygen2/version: 8.0.0
RoxygenNote: 7.3.3
Packaged: 2026-08-24 16:25:41 UTC; kaifeng.lu
Author: Kaifeng Lu [aut, cre] (ORCID: <https://orcid.org/0000-0002-6160-7119>)
Maintainer: Kaifeng Lu <kaifenglu@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-25 13:00:02 UTC
Built: R 4.5.3; x86_64-w64-mingw32; 2026-08-30 20:34:14 UTC; windows
Archs: x64
