The package contains functions to calculate power and estimate sample size for various study designs used in (not only bio-) equivalence studies. Power and sample size can be obtained based on different methods, amongst them prominently the TOST procedure (Two One-Sided t-Tests).
Version 1.5.1 built 2020-10-23 with R 4.0.3.
For an overview of supported designs, methods, and defaults together with some basic examples see
2x2x2 or 2x2 for short.
3x3 and 3x6x3. Both have the same degrees of freedom (2n–4) in the conventional approach and therefore, require the same number of subjects.
sampleN.RatioF() and for non-inferiority/-superiority in function sampleN.noninf(), where it is 0.025). In the functions alpha.
beta0.
CV.
CV.
CV). If heteroscedasticity is assumed, CV has to given as a vector with two elements CV = c(x, y), where CV[1] is CVwT and CV[2] is CVwR.
CVb is required in function sampleN.RatioF() and in function sampleN.dp() if design = "IBD" (incomplete block design).
ABEL: Based on the switching coefficient of variation \(\small{CV_0=30\%}\). \(\small{k=\log_{e}1.25/\sqrt{\log_{e}(CV_{0}^{2}+1)}\approx 0.760}\).
\(\small{\left[ {L,\,U} \right]=\left[1+\log_{e}0.80/\log_{e}rd,\:1+\log_{e}1.25/\log_{e}rd \right]}\)
logscale = TRUE where \(\theta_0=\mu_\textrm{T}/\mu_\textrm{R}\)).Non-inferiority: If margin < 1, higher responses are are assumed to be better. \[\small{H_0:\,\theta_0 \leq \log_{e}\textrm{margin}\:vs\:H_1:\,\theta_0>\log_{e}\textrm{margin}}\]
targetpower.
rd.
robustlogscale = TRUE) or difference T – R (logscale = FALSE). In the functions theta0.
theta1 and theta2.
theta0 = theta2 or theta0 = theta1.power.scABEL(), power.RSABE(), power.NTIDFDA(), power.HVNTID()).
In all functions sample sizes are estimated based on equivalence margins [\(\small{\theta_1,\theta_2}\)] in full numeric precision. The widened margins for highly variable Cmax are \(\small{\theta_1=0.75,}\) \(\small{\theta_2=1/\theta_1=1.\dot{3}}\) and not the rounded 75.00 – 133.33% according to the guidelines of the Russian Federation, the EEU, and the GCC. If for a NTID theta1 = 0.90 is specified, \(\small{\theta_2=1/\theta_1=1.\dot{1}}\) and not the rounded 111.11% as in the guidelines. Health Canada requires rounding to only one decimal place with bioequivalence margins for NTIDs of 90.0 – 112.0%.
Estimated sample sizes are generally not affected or – in extremely rare cases – conservative.
Example for a HVDP (\(\small{\theta_0}\) 0.90, design TRTR|RTRT) and a NTID (\(\small{\theta_0}\) 0.975, design TR|RT):
# CV agency method L U n theta1 theta2 n
# 0.574 EMA ABEL 69.84% 143.19% 30 0.698368 1.431910 30
# 0.574 HC ABEL 66.7 % 150.0 % 28 0.666667 1.500000 28
# 0.574 RU/EEU/GGC ABE 75.00% 133.33% 34 0.750000 1.333333 34
# 0.100 EMA ABE 90.00% 111.11% 22 0.900000 1.111111 22
# 0.100 HC ABE 90.0 % 112.0 % 22 0.900000 1.111111 22
You can install the released version of PowerTOST from CRAN with …
package <- "PowerTOST"
inst <- package %in% installed.packages()
if (length(package[!inst]) > 0) install.packages(package[!inst])… and the development version from GitHub with
# install.packages("remotes")
remotes::install_github("Detlew/PowerTOST")
Skips installation from a github remote if the SHA-1 has not changed since last install. Use force = TRUE to force installation.
Inspect this information for reproducibility. Of particular importance are the versions of R and the packages used to create this workflow. It is considered good practice to record this information with every analysis.
options(width = 80)
devtools::session_info()
# - Session info ---------------------------------------------------------------
# setting value
# version R version 4.0.3 (2020-10-10)
# os Windows 10 x64
# system x86_64, mingw32
# ui RTerm
# language EN
# collate C
# ctype German_Germany.1252
# tz Europe/Berlin
# date 2020-10-23
#
# - Packages -------------------------------------------------------------------
# package * version date lib source
# AlgDesign 1.2.0 2019-11-29 [2] CRAN (R 4.0.0)
# assertthat 0.2.1 2019-03-21 [2] CRAN (R 4.0.0)
# backports 1.1.10 2020-09-15 [2] CRAN (R 4.0.2)
# callr 3.5.1 2020-10-13 [2] CRAN (R 4.0.3)
# cli 2.1.0 2020-10-12 [2] CRAN (R 4.0.3)
# crayon 1.3.4 2017-09-16 [2] CRAN (R 4.0.0)
# crossdes 1.1-1 2013-03-18 [2] CRAN (R 4.0.0)
# cubature 2.0.4.1 2020-07-06 [2] CRAN (R 4.0.2)
# desc 1.2.0 2018-05-01 [2] CRAN (R 4.0.0)
# devtools 2.3.2 2020-09-18 [2] CRAN (R 4.0.2)
# digest 0.6.25 2020-02-23 [2] CRAN (R 4.0.0)
# ellipsis 0.3.1 2020-05-15 [2] CRAN (R 4.0.0)
# evaluate 0.14 2019-05-28 [2] CRAN (R 4.0.0)
# fansi 0.4.1 2020-01-08 [2] CRAN (R 4.0.0)
# fs 1.5.0 2020-07-31 [2] CRAN (R 4.0.2)
# glue 1.4.2 2020-08-27 [2] CRAN (R 4.0.2)
# gtools 3.8.2 2020-03-31 [2] CRAN (R 4.0.0)
# htmltools 0.5.0 2020-06-16 [2] CRAN (R 4.0.0)
# knitr 1.30 2020-09-22 [2] CRAN (R 4.0.2)
# magrittr 1.5 2014-11-22 [2] CRAN (R 4.0.0)
# memoise 1.1.0 2017-04-21 [2] CRAN (R 4.0.0)
# mvtnorm 1.1-1 2020-06-09 [2] CRAN (R 4.0.0)
# pkgbuild 1.1.0 2020-07-13 [2] CRAN (R 4.0.2)
# pkgload 1.1.0 2020-05-29 [2] CRAN (R 4.0.0)
# PowerTOST * 1.5-1 2020-10-23 [1] local
# prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.0.0)
# processx 3.4.4 2020-09-03 [2] CRAN (R 4.0.2)
# ps 1.4.0 2020-10-07 [2] CRAN (R 4.0.2)
# R6 2.4.1 2019-11-12 [2] CRAN (R 4.0.0)
# Rcpp 1.0.5 2020-07-06 [2] CRAN (R 4.0.2)
# remotes 2.2.0 2020-07-21 [2] CRAN (R 4.0.2)
# rlang 0.4.8 2020-10-08 [2] CRAN (R 4.0.3)
# rmarkdown 2.4 2020-09-30 [2] CRAN (R 4.0.2)
# rprojroot 1.3-2 2018-01-03 [2] CRAN (R 4.0.0)
# sessioninfo 1.1.1 2018-11-05 [2] CRAN (R 4.0.0)
# stringi 1.5.3 2020-09-09 [2] CRAN (R 4.0.2)
# stringr 1.4.0 2019-02-10 [2] CRAN (R 4.0.0)
# TeachingDemos 2.12 2020-04-07 [2] CRAN (R 4.0.0)
# testthat 2.3.2 2020-03-02 [2] CRAN (R 4.0.0)
# tufte 0.7 2020-09-25 [2] CRAN (R 4.0.2)
# usethis 1.6.3 2020-09-17 [2] CRAN (R 4.0.2)
# withr 2.3.0 2020-09-22 [2] CRAN (R 4.0.2)
# xfun 0.18 2020-09-29 [2] CRAN (R 4.0.2)
# yaml 2.2.1 2020-02-01 [2] CRAN (R 4.0.0)
#
# [1] C:/Users/Detlew/AppData/Local/Temp/Rtmpcttab1/Rinst21e1869c24a91
# [2] C:/Program Files/R/library
# [3] C:/Program Files/R/R-4.0.3/library