License: GPL v3 License: GPL v3 active repo size code size first on CRAN cran checks commits CRAN RStudio mirror downloads CRAN RStudio mirror downloads

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#"
) 

The package contains functions to obtain the operational characteristics (power, type I error, percentage of studies proceeding to the second stage, average and quantiles of total sample sizes) of bioequivalence studies in adaptive sequential Two-Stage Designs (TSD) via simulations.

txt <- paste0("Version ", packageVersion("Power2Stage"), " built ",
         packageDate("Power2Stage", date.fields = "Built"),
         " with R ", substr(packageDescription("Power2Stage", fields = "Built"), 3, 7))
if (grepl("900",  as.character(packageVersion("Power2Stage")))) {
  txt <- paste(txt, "\n(development version not on CRAN).")
} else {
  txt <- paste0(txt, "\n(stable release on CRAN ",
           packageDate("Power2Stage", date.fields = "Date/Publication"), ").")
}
cat(txt)

Supported Methods

Simulation-based

Since the many letters denoting the methods given by various authors might be confusing, I classified the methods as two ‘types’:

It should be noted that the adjusted alphas do not necessarily have to be the same in both stages. Below a summary of conditions used in the decision schemes of the published methods.

TOC ↩

‘Type 1’

‘Type 2’

Blinded Sample Size Re-estimation in the Interim

Golkowski et al. (2014).

Group Sequential Design

Kieser and Rauch (2015).

Inverse-Normal Combination

König et al. (2014), Kieser and Rauch (2015), Wassmer and Brannath (2016), Maurer et al. (2018).

TOC ↩

Functions

Main

Defaults employed if not specified in the function call:

|function|theta0|target power|usePE|Nmax|max.n|fCrit|fClower| |-|:-:|:-:|:-:|:-:|:-:|:-:|:-:| |power.tsd()|0.95|0.80|FALSE|Inf|--|--|--| |power.tsd.fC()|0.95|0.80|FALSE|--|Inf|"PE"|0.80| |power.tsd.KM()|0.95|0.80|--|150|--|--|--| |power.tsd.ssr()|0.95|0.80|FALSE|--|Inf|--|--| |power.tsd.GS()|0.95|--|--|--|--|"PE"|0.80| |power.tsd.in()|0.95|0.80|FALSE|--|Inf|"CI"|0.95| |power.tsd.p()|0.95|0.80|FALSE|Inf|--|--|--| All functions are for a 2×2×2 crossover design except power.tsd.p(), which is for a two-group parallel design.\ If usePE = TRUE the point estimate in the interim is used in sample size estimation of the second stage.\ If the estimated total sample size exceeds max.n the second stage will be forced to max.n - n1 (i.e., it is not a futility criterion).\ The method used for interim power and sample size estimation is specified by the argument pmethod. It defaults to "nct" (approximation by the noncentral t-distribution) except in power.tsd.GS(), where the total sample size is already fixed.\ The BE limits are specified by the arguments theta1 and theta2 (default to 0.80 and 1.25).\ The number of simulations is specified by the argument nsims. It defaults to 1e5 if simulating power and to 1e6 if simulating the empiric type I error (i.e., theta0 set to the value of theta1 or theta2).

Futility Criteria in the Interim

TOC ↩

Helpers

TOC ↩

Examples

Before running the examples attach the library.

library(Power2Stage)

If not noted otherwise, defaults are employed.

Method B

Power estimation by the shifted central t-distribution.

power.tsd(CV = 0.20, n1 = 12, pmethod = "shifted")

Explore the empiric type I error at the upper BE-limit.

power.tsd(CV = 0.20, n1 = 12, pmethod = "shifted",
          theta0 = 1.25)[["pBE"]]

TOC ↩

Method C

Power estimation by the shifted central t-distribution.

power.tsd(method = "C", CV = 0.20, n1 = 12, pmethod = "shifted")

Slightly better than ‘Method B’ in terms of power in both stages and fewer studies are expected to proceed to the second stage.

Explore the empiric type I error at the upper BE-limit (1 milion simulations).

power.tsd(method = "C", CV = 0.20, n1 = 12, pmethod = "shifted",
          theta0 = 1.25)[["pBE"]]

Slight inflation of the type I error (although considered negligible by the authors). However, more adjustment (adjusted α 0.0280) controls the type I error.

power.tsd(method = "C", alpha = rep(0.0280, 2), CV = 0.20,
          n1 = 12, pmethod = "shifted", theta0 = 1.25)[["pBE"]]

TOC ↩

Inverse-Normal Combination

Data given by Potvin et al. in Example 2: 12 subjects in stage 1, PE 1.0876, CV 0.18213, all defaults of the function used.

interim.tsd.in(GMR = 0.95, GMR1 = 1.0876, CV1 = 0.18213, n1 = 12)

The second stage should be initiated with 6 subjects. Note that with interim.tsd.in(..., fCrit = "No", ssr.conditional = "no") 8 subjects would be required like in the Methods of Potvin et al.

The second stage is performed in 8 subjects, PE 0.9141, CV 0.25618.

final.tsd.in(GMR1 = 1.0876, CV1 = 0.18213, n1 = 12,
             GMR2 = 0.9141, CV2 = 0.25618, n2 = 8)

The study passed with a (repeated) CI of 87.69--117.36%. Although slightly more conservative, same conclusion like based on the 94.12% CI of 88.45--116.38% reported by Potvin et al.

TOC ↩

Speed Comparisons

Performed on a Xeon E3-1245v3 3.4 GHz, 8 MB cache, 16 GB RAM, R r getRversion() on Windows 7.

‘Method B’ (CV 0.20, n~1~ 12).

#   method   power seconds
#  shifted 0.84454    1.09
#      nct 0.84266    1.61
#    exact 0.84260   31.98

Despite being the fastest, the shifted central t-distribution should only be used in order to compare with published methods. The noncentral t-distribution is a good compromise between speed and accuracy and hence, the default in all functions. The exact method based on Owen’s Q-function is time-consuming and therefore, not recommended in validating a custom method in a narrow grid of n~1~/CV-combinations. However, in designing a new study it is the method of choice.

Blinded sample size re-estimation (α 0.03505, CV 0.239, n~1~ 10, target power 0.90), 1 million simulations for the empiric type I error.

#   method      TIE seconds
#       ls 0.049054    3.67
#  shifted 0.046106   12.85
#      nct 0.046319   18.24
#    exact 0.046319  429.10

The crude large sample approximation (pmethod = "ls") should only be used to compare with the published method.

TOC ↩

Installation

You can install the released version of Power2Stage from CRAN with …

package <- "Power2Stage"
inst    <- package %in% installed.packages()
if (length(package[!inst]) > 0) install.packages(package[!inst])

… and the development version from GitHub with

# install.packages("devtools")
devtools::install_github("Detlew/Power2Stage")

Skips installation from a github remote if the SHA-1 has not changed since last install. Use force = TRUE to force installation.

TOC ↩

Session Information

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.\ Version r packageVersion("Power2Stage") built r packageDate("Power2Stage", date.fields = "Built") with R r substr(packageDescription("Power2Stage", fields = "Built"), 3, 7).

options(width = 66)
sessionInfo()

TOC ↩



Detlew/Power2Stage documentation built on Oct. 12, 2023, 9:08 p.m.