GenTwoArmsTrialSize: An R Statistical Software Package to estimate Generalized Two Arms Randomized Clinical Trial Sample Size

GenTwoArmsTrialSize: An R Statistical Software Package to estimate Generalized Two Arms Randomized Clinical Trial Sample Size
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

The precise calculation of sample sizes is a crucial aspect in the design of clinical trials particularly for pharmaceutical statisticians. While various R statistical software packages have been developed by researchers to estimate required sample sizes under different assumptions, there has been a notable absence of a standalone R statistical software package that allows researchers to comprehensively estimate sample sizes under generalized scenarios. This paper introduces the R statistical software package “GenTwoArmsTrialSize” available on the Comprehensive R Archive Network (CRAN), designed for estimating the required sample size in two-arm clinical trials. The package incorporates four endpoint types, two trial treatment designs, four types of hypothesis tests, as well as considerations for noncompliance and loss of follow-up, providing researchers with the capability to estimate sample sizes across 24 scenarios. To facilitate understanding of the estimation process and illuminate the impact of noncompliance and loss of follow-up on the size and variability of estimations, the paper includes four hypothetical examples and one applied example. The discussion encompasses the package’s limitations and outlines directions for future extensions and improvements.


💡 Research Summary

The manuscript introduces GenTwoArmsTrialSize, a new R package that provides a unified solution for sample‑size calculation in two‑arm randomized clinical trials. The authors begin by emphasizing the central role of accurate sample‑size and power calculations in trial design, linking these calculations to the ICH‑E8 concept of an “estimand” that defines the target of inference. They review the statistical foundations for four common endpoint types—continuous, binary, time‑to‑event, and ordinal categorical—and derive the corresponding sample‑size formulas for four hypothesis families: equality, non‑inferiority, superiority, and equivalence. Each formula incorporates the effect size (μ, p, λ, ψ), the non‑inferiority/superiority margin δ, the significance level α, and the desired power (1‑β). The authors also discuss allocation ratios (k) and provide both exact non‑central t‑distribution based expressions and large‑sample normal approximations, with continuity corrections for small binary samples.

A major contribution of the package is the explicit handling of non‑compliance and loss‑to‑follow‑up, which are often ignored in existing tools. By introducing compliance rates (ρ₁, ρ₂) for control and treatment arms, the authors derive adjusted mean outcomes (θ₁, θ₂) and show how the intention‑to‑treat (ITT) effect can be expressed in terms of the complier average causal effect (CACE). Loss‑to‑follow‑up is modeled with a simple inflation factor 1/(1‑r). These adjustments are incorporated into unified secondary‑ITT sample‑size formulas (equations 13‑16) that apply to all four endpoint types.

The paper surveys existing non‑commercial software (e.g., TrialSize, gsDesign, Hmisc, STPLAN) and highlights gaps: lack of simultaneous support for non‑compliance, loss‑to‑follow‑up, and equivalence testing for ordinal outcomes. In response, GenTwoArmsTrialSize offers a single high‑level function (genTwoArmsSampleSize) that accepts endpoint type, hypothesis, effect sizes, variance, margin, α, power, allocation ratio, compliance rates, and dropout rate. Internally, the function selects the appropriate exact or approximate formula, automatically applies continuity corrections when needed, and returns the total required sample size, arm‑specific allocations, and sensitivity analyses (e.g., varying compliance or dropout). The package is hosted on CRAN, ensuring easy installation and integration with other R workflows.

To demonstrate usability, the authors present four hypothetical scenarios—continuous non‑inferiority, binary superiority, survival equivalence, and ordinal non‑inferiority—each illustrating how changing compliance or dropout rates inflates the required sample size. A real‑world applied example from a cardiovascular drug trial further validates the package, showing that accounting for a 15 % dropout and 10 % non‑compliance increases the required enrollment by roughly 20 % compared with naïve calculations.

In the discussion, the authors acknowledge limitations: the current version does not support cluster randomization, multi‑arm or crossover designs, Bayesian adaptive designs, or non‑parametric endpoints. They outline future extensions, including adding these designs, integrating simulation‑based power calculations, and supporting user‑defined outcome distributions. They also propose extensive simulation studies and collaborations with ongoing trials to benchmark performance.

In conclusion, GenTwoArmsTrialSize fills a notable gap in the R ecosystem by providing a comprehensive, user‑friendly tool that simultaneously handles multiple endpoint types, hypothesis families, and realistic trial imperfections such as non‑compliance and loss‑to‑follow‑up. This facilitates more accurate and efficient trial planning, potentially reducing unnecessary patient enrollment and improving ethical standards in clinical research.


Comments & Academic Discussion

Loading comments...

Leave a Comment