You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Conducts sample size estimation for bioequivalence studies using the Two One-Sided Tests (TOST) procedure. A simulation-based approach enables flexible hypothesis testing, supports multiple treatments, and accommodates correlated endpoints.
Copy file name to clipboardExpand all lines: R/SampleSize.R
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,8 @@
35
35
#' @param seed Integer. Seed for reproducibility.
36
36
#' @param ncores Integer. Number of processing cores for parallel computation. Defaults to \code{1}. Set to \code{NA} for automatic detection (\code{ncores - 1}).
#' @param lower Integer. Minimum sample size (\code{N}) for search range (default = 2).
39
-
#' @param upper Integer. Maximum sample size (\code{N}) for search range (default = 500).
38
+
#' @param lower Integer. Minimum sample size for search range (default = 2).
39
+
#' @param upper Integer. Maximum sample size for search range (default = 500).
40
40
#' @param step.power Numeric. Initial step size for sample size search, defined as \code{2^step.power}. Used when \code{optimization_method = "fast"}.
41
41
#' @param step.up Logical. If \code{TRUE} (default), search increments upward from \code{lower}; if \code{FALSE}, decrements downward from \code{upper}. Used when \code{optimization_method = "fast"}.
42
42
#' @param pos.side Logical. If \code{TRUE}, finds the smallest integer \code{i} closest to the root such that \code{f(i) > 0}. Used when \code{optimization_method = "fast"}.
#' @description Optimizer Uniroot integer modified from the ssanv function package https://github.com/cran/ssanv/blob/master/R/uniroot.integer.R
321
+
#' @title Optimizer for Uniroot Integer (Modified)
323
322
#'
324
-
#' @param f function for which a root is needed
325
-
#' @param power target power value
326
-
#' @param lower minimum allowable root
327
-
#' @param upper maximum allowable root
328
-
#' @param step.power initial step size is 2^step.power
329
-
#' @param step.up if TRUE steps up from 'lower', if FALSE steps down from 'upper'
330
-
#' @param pos.side if TRUE finds integer, i, closest to the root such that f(i) >0
331
-
#' @param maxiter maximum number of iterations
332
-
#' @param ... additional arguments to 'f'.
323
+
#' @description A modified integer-based root-finding algorithm for determining the sample size required to achieve a target power.
324
+
#' This function extends the uniroot integer search method to handle cases with stepwise power searches while considering constraints on search limits.
333
325
#'
334
-
#' @return a list with the following elements:
335
-
#' root= the integer on the correct side of the root
336
-
#' f.root = value of f at root (output= main output with final power, output.test= output table with test at endpoint level)
337
-
#' iter = number of times f was evaluated
338
-
#' table.iter = data.frame with the estimated N and power at each iteration
339
-
#' table.test = data.frame with the test at endpoint level for a given N and each simulation draw
0 commit comments