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.0 built 2020-08-04 with R 4.0.2.
For an overview of supported designs, methods, and defaults together with some basic examples see
2x2x2
or short 2x2
.
3x3
and 3x6x3
. Both have the same degrees of freedom (2n–4) in the convential 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).
\(\left[ {L,\,U} \right]=\left[1+log(0.80)/log(rd),\:1+log(1.25)/log(rd) \right]\)
logscale = TRUE
where \(\theta_0=\mu_T/\mu_R\)).Non-inferiority: If margin < 1, higher responses are are assumed to be better. \[H_0:\,\theta_0 \leq \log({margin})\:vs\:H_1:\,\theta_0>\log({margin})\]
targetpower
.
rd
.
robust
logscale = 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()
).
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.2 (2020-06-22)
# os Windows 10 x64
# system x86_64, mingw32
# ui RTerm
# language EN
# collate C
# ctype German_Germany.1252
# tz Europe/Berlin
# date 2020-08-04
#
# - 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.7 2020-05-13 [2] CRAN (R 4.0.0)
# callr 3.4.3 2020-03-28 [2] CRAN (R 4.0.0)
# cli 2.0.2 2020-02-28 [2] CRAN (R 4.0.0)
# 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.0 2020-04-10 [2] CRAN (R 4.0.0)
# 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.4.2 2020-06-30 [2] CRAN (R 4.0.2)
# glue 1.4.1 2020-05-13 [2] CRAN (R 4.0.0)
# 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.29 2020-06-23 [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.0.8 2020-05-07 [2] CRAN (R 4.0.0)
# pkgload 1.1.0 2020-05-29 [2] CRAN (R 4.0.0)
# PowerTOST * 1.5-0 2020-08-04 [1] local
# prettyunits 1.1.1 2020-01-24 [2] CRAN (R 4.0.0)
# processx 3.4.3 2020-07-05 [2] CRAN (R 4.0.2)
# ps 1.3.3 2020-05-08 [2] CRAN (R 4.0.0)
# R6 2.4.1 2019-11-12 [2] CRAN (R 4.0.0)
# Rcpp 1.0.4.6 2020-04-09 [2] CRAN (R 4.0.2)
# remotes 2.1.1 2020-02-15 [2] CRAN (R 4.0.0)
# rlang 0.4.6 2020-05-02 [2] CRAN (R 4.0.0)
# rmarkdown 2.3 2020-06-18 [2] CRAN (R 4.0.0)
# 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.4.6 2020-02-17 [2] CRAN (R 4.0.0)
# 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.6 2020-05-08 [2] CRAN (R 4.0.0)
# usethis 1.6.1 2020-04-29 [2] CRAN (R 4.0.0)
# withr 2.2.0 2020-04-20 [2] CRAN (R 4.0.0)
# xfun 0.15 2020-06-21 [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/Rtmpctfl0c/Rinst77a5848c32d89
# [2] C:/Program Files/R/library
# [3] C:/Program Files/R/R-4.0.2/library