MyNixOS website logo
Description

Blinded Sample Size Recalculation.

Computation of key characteristics and plots for blinded sample size recalculation. Continuous as well as binary endpoints are supported in superiority and non-inferiority trials. See Baumann, Pilz, Kieser (2022) <doi:10.32614/RJ-2022-001> for a detailed description. The implemented methods include the approaches by Lu, K. (2019) <doi:10.1002/pst.1737>, Kieser, M. and Friede, T. (2000) <doi:10.1002/(SICI)1097-0258(20000415)19:7%3C901::AID-SIM405%3E3.0.CO;2-L>, Friede, T. and Kieser, M. (2004) <doi:10.1002/pst.140>, Friede, T., Mitchell, C., Mueller-Veltern, G. (2007) <doi:10.1002/bimj.200610373>, and Friede, T. and Kieser, M. (2011) <doi:10.3414/ME09-01-0063>.

R-CMD-check Codecov testcoverage CRANstatus

blindrecalc

blindrecalc facilitates the planning of a clinical trial with an internal pilot study and blinded sample size recalculation.

Installation

Install the current CRAN version of blindrecalc with:

install.packages("blindrecalc")

Or install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("imbi-heidelberg/blindrecalc")

Usage

blindrecalc currently supports continuous and binary endpoints for superiority and non-inferiority test problems. Continuous endpoints are analyzed using Student’s t-test, binary endpoints are analyzed using the Chi-squared test for superiority trials and the Farrington-Manning test for non-inferiority trials. Each design can be defined using a setup-function: setupStudent, setupChiSquare and setupFarringtonManning. For example, to setup a superiority trial with a continuous endpoint:

library(blindrecalc)
design <- setupStudent(alpha = 0.025, beta = 0.2, r = 1, delta = 5)

alpha and beta refer to the type 1 and type 2 error rate, r is the sample size allocation ratio and deltais the effect size between the null and the alternative hypothesis. For a non-inferiority trial with a shifted t-test, additionally the argument delta_NI must be specified.

To calculate the sample size for a fixed design, use n_fix:

n_fix(design, nuisance = c(5, 10, 15))
#> [1]  31.39552 125.58208 282.55967

nuisance refers to the nuisance parameter of the design, which in the case of the t-test is the common variance of the outcome variable.

To calculate the type 1 error rate of the design using blinded sample size recalculation, use toer:

toer(design, n1 = c(30, 60, 90), nuisance = 10, recalculation = TRUE)
#> [1] 0.0259 0.0235 0.0252

n1 refers to the sample size of the internal pilot study recalculation = TRUE specifices that the type 1 error rate for a design with blinded sample size recalculation should be computed.

To compute the power of the design, use pow:

pow(design, n1 = c(30, 60, 90), nuisance = 10, recalculation = TRUE)
#> [1] 0.7877 0.8039 0.8056

To calculate the distribution of the total sample sizes use n_dist:

n_dist(design, n1 = c(30, 60, 90), nuisance = 10)
#>     n_1 = 30        n_1 = 60      n_1 = 90    
#>  Min.   : 36.0   Min.   : 63   Min.   : 90.0  
#>  1st Qu.:109.0   1st Qu.:117   1st Qu.:120.0  
#>  Median :131.0   Median :132   Median :133.0  
#>  Mean   :134.1   Mean   :134   Mean   :134.5  
#>  3rd Qu.:155.0   3rd Qu.:150   3rd Qu.:147.0  
#>  Max.   :322.0   Max.   :282   Max.   :223.0

Reference

A paper describing blindrecalc can be found here.

Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows