feasibility_check: Check feasibility of power constraints

Description Usage Arguments Details Value

View source: R/feasibility_check.R

Description

Functions to check feasibility of a design, adjust the design in order to make it feasible, or adjust the constraints so that they can be achieved. Here, "feasibility" means that there exists a 1-stage design at the supplied sample size that meets the supplied power and Type I error constraints.

Usage

1
2
3
4
5
6
7
8
feasibility_check(FWER, p1, trial_method, r1 = 0.5, r2 = 1 - r1, n_total,
  cases, npoints_sqrt = 10, trial_args = list())

min_n_feasible(min_n = 100, max_n = min_n * 10, step_n = 5,
  showiter = FALSE, trial_method, ...)

max_power_feasible(n_total, cases, p1, trial_method, step_multiplier = 0.01,
  showiter = FALSE, FWER = 0.025, npoints_sqrt = 10, ...)

Arguments

FWER

the required familywise Type I error rate for the trial

p1

population proportion in subpopulation 1

trial_method

the type of trial to run. 'cov' for covariance based, 'MB' for Maurer Bretz, and 'covMB' for a combination approach.

r1

probability of being randomized to treatment in subpopulation 1

r2

probability of being randomized to treatment in subpopulation 2

n_total

the total sample size for the 1-stage trial

cases

a list of power constraints, of the same format as those passed to optimizeTrial

npoints_sqrt

feasibility_check determines feasibility by searching over a grid of points for the alpha to be allocated between the two trials. Determines the number of grid points to search over. The search will be conducted over a triangle of points, with (npoints_sqrt^2)/2 points.

trial_args

either an empty list (for trial_method=='cov'), or a list containing graph edges for alpha reallocation (for trial_method=='MB').

min_n

smallest sample size to consider for a 1-stage trial

max_n

largest sample size to consider

step_n

the step size for sample size. For example, if step=20 then we will search in increments of 20 people.

showiter

passed to binsearch, determines whether to show progress.

...

passed to feasibility_check

step_multiplier

the step size

Details

feasibility_check checks whether it is possible to meet a set of power constraints while maintaining a given familywise Type I error rate (FWER) and total sample size.

min_n_feasible implements a binary search to find the smallest sample size that meets the power constraints and FWER specified. In each iteration of the search, min_n_feasible calls feasibility_check.

Given a sample size and set of power cases, max_power_feasible finds the number m between 0 and 1 such that if all of the minimum power thresholds are multiplied by m, then these power constraints will be satisfied at the supplied value of n_total. In other words, it finds the factor by which the power constraints must be relaxed.

Value

feasibility_check returns a named vector, with the first element being 1 if the trial is feasible, and zero otherwise. The remaining elements of this vector tell the alpha allocated to each hypothesis in one particular setup that results in a feasible trial.
min_n_feasible returns the smallest sample size that meets the power constraints and FWER specified, as well as the output from feasibility_check at that sample size.
max_power_feasible returns the multiplier m and a list of modified cases in which each power threshold has been multiplied by m.


aaronjfisher/designOptim documentation built on May 21, 2019, 8:35 a.m.