bni: Two-arm binomial non-inferiority trials

View source: R/stat.R

bniR Documentation

Two-arm binomial non-inferiority trials

Description

Calculate the required sample size or power for a two-arm non-inferiority design with binomial outcome. Exactly one of power or n should be NULL to solve for this value given the other parameters.

Usage

bni(margin, p1, p2 = p1, alpha = 0.05, power = NULL, n = NULL, p = 0.5)

Arguments

margin

the largest acceptable difference in success rates between the standard (p1) and experimental (p2) arms that would be consistent with non-inferiority

p1, p2

true success rates for the standard and experimental arms, respectively

alpha

type I error (one-sided), i.e., the 1 - 2 * alpha confidence interval around the difference between the rates

power

the desired power level to rule out the null of inferiority

n

the total sample size of both arms

p

the proportion of n on the experimental arm, p2

Value

The a numeric vector with the total sample size (n), sample size for the standard (n1) and experimental (n2) arms, and power (power).

References

Kopecky K and Green S (2012). Noninferiority trials. In: Handbook of Statistics in Clinical Oncology. Crowley J and Hoering A, eds. CRC Press, Boca Raton, FL USA.

See Also

https://stattools.crab.org/R/Binomial_Non_Inferiority.html

http://www.powerandsamplesize.com/Calculators/Compare-2-Proportions/2-Sample-Non-Inferiority-or-Superiority

Examples

bni(0.1, 0.65, 0.85, power = 0.8)
bni(0.1, 0.65, 0.85, n = 50)
bni(0.1, 0.65, 0.85, n = 50, p = 2 / 3) ## 1:2 randomization


raredd/rawr documentation built on Feb. 25, 2025, 1:48 p.m.