Sample Size for Non-Inferiority Trials in R

In R there are lots of packages for sample size calculations. Here we will cover one of the most common {rpact}

library(rpact)

Two Sample Non-inferiority test: Comparing means for parallel design (unpaired)

This example is a sample size calculation for the following hypotheses: \(H_0:\mu2-\mu1\le -\theta\) versus \(H_1: \mu2-\mu1\gt -\theta\).

A client is interested in conducting a clinical trial to compare two cholesterol lowering agents for treatment of hypercholesterolemic patients through a parallel design. The primary efficacy parameter is a low-density lipidprotein cholesterol (LDL-C). We will consider the situation where the intended trial is for testing noninferiority. For establishing it, suppose the true mean difference is 0 and the noninferiority margin is chosen to be -0.05 (-5%). Assuming SD = 0.1, how many patients are required for an 80% power and an overall significance level of 5%?

getDesignInverseNormal(kMax = 1, alpha = 0.05) |>
    getSampleSizeMeans(thetaH0 = -0.05, 
                       alternative = 0,
        stDev = 0.1,
        allocationRatioPlanned = 1) |>
    summary() 

Sample size calculation for a continuous endpoint

Fixed sample analysis, one-sided significance level 5%, power 80%. The results were calculated for a two-sample t-test, H0: mu(1) - mu(2) = -0.05, H1: effect = 0, standard deviation = 0.1.

Stage Fixed
Stage level (one-sided) 0.0500
Efficacy boundary (z-value scale) 1.645
Efficacy boundary (t) -0.017
Number of subjects 100.3

Legend:

  • (t): treatment effect scale

Here the recommended sample size is 100.3, so we will need to round up to 51 subjects per arm.