Learn R Programming

rpact (version 3.0.3)

getConditionalPower: Get Conditional Power

Description

Calculates and returns the conditional power.

Usage

getConditionalPower(stageResults, ..., nPlanned, allocationRatioPlanned = 1)

Arguments

stageResults

The results at given stage, obtained from getStageResults.

...

Further (optional) arguments to be passed:

thetaH1 and assumedStDev or pi1, pi2

The assumed effect size or assumed rates to calculate the conditional power. Depending on the type of dataset, either thetaH1 (means and survival) or pi1, pi2 (rates) can be specified. For testing means, an assumed standard deviation can be specified, default is 1.

iterations

Iterations for simulating the power for Fisher's combination test. If the power for more than one remaining stages is to be determined for Fisher's combination test, it is estimated via simulation with specified iterations, the default value is 10000.

seed

Seed for simulating the power for Fisher's combination test. See above, default is a random seed.

nPlanned

The additional (i.e., "new" and not cumulative) sample size planned for each of the subsequent stages. The argument must be a vector with length equal to the number of remaining stages and contain the combined sample size from both treatment groups if two groups are considered. For survival outcomes, it should contain the planned number of additional events. For multi-arm designs, it is the per-comparison (combined) sample size.

allocationRatioPlanned

The planned allocation ratio n1 / n2 for a two treatment groups design, default is 1. For multi-arm designs, it is the allocation ratio relating the active arm(s) to the control.

Value

Returns a ConditionalPowerResults object. The following generics (R generic functions) are available for this result object:

How to get help for generic functions

Click on the link of a generic in the list above to go directly to the help documentation of the rpact specific implementation of the generic. Note that you can use the R function methods to get all the methods of a generic and to identify the object specific name of it, e.g., use methods("plot") to get all the methods for the plot generic. There you can find, e.g., plot.AnalysisResults and obtain the specific help documentation linked above by typing ?plot.AnalysisResults.

Details

The conditional power is calculated only if the effect size and the sample size is specified.

For Fisher's combination test, the conditional power for more than one remaining stages is estimated via simulation.

See Also

plot.StageResults or plot.AnalysisResults for plotting the conditional power.

Other analysis functions: getAnalysisResults(), getClosedCombinationTestResults(), getClosedConditionalDunnettTestResults(), getConditionalRejectionProbabilities(), getFinalConfidenceInterval(), getFinalPValue(), getRepeatedConfidenceIntervals(), getRepeatedPValues(), getStageResults(), getTestActions()

Examples

Run this code
# NOT RUN {
design <- getDesignInverseNormal(kMax = 2)
data1 <- getDataset(
   n      = c(20, 30),
   means  = c(50, 51),
   stDevs = c(130, 140)
)
data2 <- getDataset(
   n1     = c(22, 13, 22, 13),
   n2     = c(22, 11, 22, 11),  
   means1 = c(1, 1.1, 1, 1),
   means2 = c(1.4, 1.5, 1, 2.5), 
   stds1  = c(1, 2, 2, 1.3),
   stds2  = c(1, 2, 2, 1.3))
stageResults <- getStageResults(
   getDesignGroupSequential(kMax = 4), 
   dataInput = data2, stage = 2, directionUpper = FALSE) 
getConditionalPower(stageResults, thetaH1 = -0.4, 
   nPlanned = c(64, 64), assumedStDev = 1.5, allocationRatioPlanned = 3)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab