getPowerRates {rpact}  R Documentation 
Returns the power, stopping probabilities, and expected sample size for testing rates in one or two samples at given sample sizes.
getPowerRates(design = NULL, ..., groups = 2, riskRatio = FALSE, thetaH0 = ifelse(riskRatio, 1, 0), pi1 = C_PI_1_DEFAULT, pi2 = 0.2, directionUpper = NA, maxNumberOfSubjects = NA_real_, allocationRatioPlanned = NA_real_)
design 
The trial design. If no trial design is specified, a fixed sample size design is used.
In this case, 
... 
Ensures that all arguments are be named and that a warning will be displayed if unknown arguments are passed. 
groups 
The number of treatment groups (1 or 2), default is 
riskRatio 
If 
thetaH0 
The null hypothesis value. For onesided testing, a value != 0
(or != 1 for testing the risk ratio 
pi1 
The assumed probability in the active treatment group if two treatment groups
are considered, or the alternative probability for a one treatment group design,
default is 
pi2 
The assumed probability in the reference group if two treatment groups are considered, default is 
directionUpper 
Specifies the direction of the alternative, only applicable for onesided testing, default is 
maxNumberOfSubjects 

allocationRatioPlanned 
The planned allocation ratio for a two treatment groups design, default is 
At given design the function calculates the power, stopping probabilities, and expected sample size, for testing rates for given maximum sample size. The sample sizes over the stages are calculated according to the specified information rate in the design. In a two treatment groups design, additionally, an allocation ratio = n1/n2 can be specified. If a null hypothesis value thetaH0 != 0 for testing the difference of two rates or thetaH0 != 1 for testing the risk ratio is specified, the formulas according to Farrington & Manning (Statistics in Medicine, 1990) are used (only onesided testing). Critical bounds and stopping for futility bounds are provided at the effect scale (rate, rate difference, or rate ratio, respectively). For the twosample case, the calculation here is performed at fixed pi2 as given as argument in the function. Note that the power calculation for rates is always based on the normal approximation.
Returns a TrialDesignPlanRates
object.
# Calculate the power, stopping probabilities, and expected sample size in a twoarmed # design at given maximum sample size N = 200 # in a threestage O'Brien & Fleming design with information rate vector (0.2,0.5,1), # nonbinding futility boundaries (0,0), i.e., # the study stops for futility if the pvalue exceeds 0.5 at interm, and # allocation ratio = 2 for a range of pi1 values when testing H0: pi1  pi2 = 0.1: getPowerRates(getDesignGroupSequential(informationRates = c(0.2,0.5,1), futilityBounds = c(0,0)), groups = 2, thetaH0 = 0.1, pi1 = seq(0.3, 0.6, 0.1), directionUpper = FALSE, pi2 = 0.7, allocationRatioPlanned = 2, maxNumberOfSubjects = 200) # Calculate the power, stopping probabilities, and expected sample size in a single # arm design at given maximum sample size N = 60 in a threestage twosided # O'Brien & Fleming design with information rate vector (0.2,0.5,1) # for a range of pi1 values when testing H0: pi = 0.3: getPowerRates(getDesignGroupSequential(informationRates = c(0.2,0.5,1), sided = 2), groups = 1, thetaH0 = 0.3, pi1 = seq(0.3, 0.5, 0.05), maxNumberOfSubjects = 60)